unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
Cc: 45658@debbugs.gnu.org
Subject: bug#45658: Infinite loop in run loop on macOS
Date: Wed, 6 Jan 2021 18:53:41 +0000	[thread overview]
Message-ID: <X/YHNRPuY0+w00RW@breton.holly.idiocy.org> (raw)
In-Reply-To: <CAKDRQS40rKnNmTqbJM97OETfCKnz=5EvUNf1pDZiEWx-iD6+Yw@mail.gmail.com>

On Wed, Jan 06, 2021 at 07:04:37AM +0000, Jimmy Yuen Ho Wong wrote:
> > Is this still mostly when you switch away from Emacs?
> 
> Yes. I'm on Catalina and here's my configure flags if that helps:
> 
> "--disable-silent-rules --prefix=/opt/local --with-ns --with-libgmp
> --with-json --with-xml2 --with-modules --with-lcms2 --with-rsvg
> --with-gnutls 'CFLAGS=-pipe -O0 -ggdb3
> -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
> -arch x86_64' 'CPPFLAGS=-I/opt/local/include
> -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk'
> 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-no_pie
> -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
> -arch x86_64'"
> 
> > Can you do "bt all" and send the whole output?

Thanks. I've raised a bug report for this. Unfortunately I can't see
what's causing this just now... My best guess is that there's a missed
ns_send_appdefined somewhere. Can you switch to the thread that's
running fd_handler and see what it's doing? There are only two
branches, so it should be easy to work out which one is in use.

> (lldb) bt all
> 
> * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
>   * frame #0: 0x00007fff6a0ccdfa libsystem_kernel.dylib`mach_msg_trap + 10
>     frame #1: 0x00007fff6a0cd1fd libsystem_kernel.dylib`mach_msg + 201
>     frame #2: 0x00007fff2fedbef5 CoreFoundation`__CFRunLoopServiceMachPort + 247
>     frame #3: 0x00007fff2feda9c2 CoreFoundation`__CFRunLoopRun + 1319
>     frame #4: 0x00007fff2fed9e3e CoreFoundation`CFRunLoopRunSpecific + 462
>     frame #5: 0x00007fff2eb06abd HIToolbox`RunCurrentEventLoopInMode + 292
>     frame #6: 0x00007fff2eb067d5 HIToolbox`ReceiveNextEventCommon + 584
>     frame #7: 0x00007fff2eb06579
> HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 64
>     frame #8: 0x00007fff2d14c039 AppKit`_DPSNextEvent + 883
>     frame #9: 0x00007fff2d14a880 AppKit`-[NSApplication(NSEvent)
> _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
>     frame #10: 0x00007fff2d13c58e AppKit`-[NSApplication run] + 658
>     frame #11: 0x000000010036c5fa Emacs`-[EmacsApp
> run](self=0x000000010525e180, _cmd="run") at nsterm.m:5602:9
>     frame #12: 0x000000010036a8eb Emacs`ns_select(nfds=30,
> readfds=0x00007ffeefbfd1f0, writefds=0x00007ffeefbfd170,
> exceptfds=0x0000000000000000, timeout=0x00007ffeefbfd148,
> sigmask=0x0000000000000000) at nsterm.m:4690:3
>     frame #13: 0x00000001002f567a
> Emacs`wait_reading_process_output(time_limit=10, nsecs=0, read_kbd=-1,
> do_display=true, wait_for_cell=0x0000000000000000,
> wait_proc=0x0000000000000000, just_wait_proc=0) at process.c:5577:18
>     frame #14: 0x0000000100010bfe
> Emacs`sit_for(timeout=0x000000000000002a, reading=true,
> display_option=1) at dispnew.c:6064:3
>     frame #15: 0x0000000100173432 Emacs`read_char(commandflag=1,
> map=0x00000001de6881f3, prev_event=0x0000000000000000,
> used_mouse_menu=0x00007ffeefbfdddf, end_time=0x0000000000000000) at
> keyboard.c:2738:11
>     frame #16: 0x000000010016e569
> Emacs`read_key_sequence(keybuf=0x00007ffeefbfe0e0,
> prompt=0x0000000000000000, dont_downcase_last=false,
> can_return_switch_frame=true, fix_current_buffer=true,
> prevent_redisplay=false) at keyboard.c:9554:12
>     frame #17: 0x000000010016cf89 Emacs`command_loop_1 at keyboard.c:1350:15
>     frame #18: 0x0000000100269a9f
> Emacs`internal_condition_case(bfun=(Emacs`command_loop_1 at
> keyboard.c:1236), handlers=0x0000000000000090, hfun=(Emacs`cmd_error
> at keyboard.c:919)) at eval.c:1356:25
>     frame #19: 0x0000000100184cdc
> Emacs`command_loop_2(ignore=0x0000000000000000) at keyboard.c:1091:11
>     frame #20: 0x000000010026940a
> Emacs`internal_catch(tag=0x000000000000c840,
> func=(Emacs`command_loop_2 at keyboard.c:1087),
> arg=0x0000000000000000) at eval.c:1117:25
>     frame #21: 0x000000010016bf1a Emacs`command_loop at keyboard.c:1070:2
>     frame #22: 0x000000010016bda0 Emacs`recursive_edit_1 at keyboard.c:714:9
>     frame #23: 0x000000010016c0e9 Emacs`Frecursive_edit at keyboard.c:786:3
>     frame #24: 0x00000001001695b4 Emacs`main(argc=1,
> argv=0x00007ffeefbfe690) at emacs.c:2066:3
>     frame #25: 0x00007fff69f8bcc9 libdyld.dylib`start + 1
>   thread #4, name = 'gmain'
>     frame #0: 0x00007fff6a0d50fe libsystem_kernel.dylib`__select + 10
>     frame #1: 0x0000000102045174 libglib-2.0.0.dylib`g_poll + 546
>     frame #2: 0x0000000102038f63
> libglib-2.0.0.dylib`g_main_context_iterate + 340
>     frame #3: 0x0000000102039011
> libglib-2.0.0.dylib`g_main_context_iteration + 55
>     frame #4: 0x000000010203a0c1 libglib-2.0.0.dylib`glib_worker_main + 30
>     frame #5: 0x000000010205a844 libglib-2.0.0.dylib`g_thread_proxy + 90
>     frame #6: 0x00007fff6a190109 libsystem_pthread.dylib`_pthread_start + 148
>     frame #7: 0x00007fff6a18bb8b libsystem_pthread.dylib`thread_start + 15
>   thread #7
>     frame #0: 0x00007fff6a0d187e libsystem_kernel.dylib`__pselect + 10
>     frame #1: 0x00007fff6a0d179b
> libsystem_kernel.dylib`pselect$DARWIN_EXTSN + 42
>     frame #2: 0x000000010036def3 Emacs`-[EmacsApp
> fd_handler:](self=0x000000010525e180, _cmd="fd_handler:",
> unused=0x0000000000000000) at nsterm.m:6100:20
>     frame #3: 0x00007fff3256d7b2 Foundation`__NSThread__start__ + 1064
>     frame #4: 0x00007fff6a190109 libsystem_pthread.dylib`_pthread_start + 148
>     frame #5: 0x00007fff6a18bb8b libsystem_pthread.dylib`thread_start + 15
>   thread #11, name = 'com.apple.NSEventThread'
>     frame #0: 0x00007fff6a0ccdfa libsystem_kernel.dylib`mach_msg_trap + 10
>     frame #1: 0x00007fff6a0cd170 libsystem_kernel.dylib`mach_msg + 60
>     frame #2: 0x00007fff2fedbef5 CoreFoundation`__CFRunLoopServiceMachPort + 247
>     frame #3: 0x00007fff2feda9c2 CoreFoundation`__CFRunLoopRun + 1319
>     frame #4: 0x00007fff2fed9e3e CoreFoundation`CFRunLoopRunSpecific + 462
>     frame #5: 0x00007fff2d2ed954 AppKit`_NSEventThread + 132
>     frame #6: 0x00007fff6a190109 libsystem_pthread.dylib`_pthread_start + 148
>     frame #7: 0x00007fff6a18bb8b libsystem_pthread.dylib`thread_start + 15
>   thread #127
>     frame #0: 0x00007fff6a0ce4ce libsystem_kernel.dylib`__workq_kernreturn + 10
>     frame #1: 0x00007fff6a18caa1 libsystem_pthread.dylib`_pthread_wqthread + 390
>     frame #2: 0x00007fff6a18bb77 libsystem_pthread.dylib`start_wqthread + 15

-- 
Alan Third





       reply	other threads:[~2021-01-06 18:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <e73a23d1-46b8-1542-5996-ca1afb5b0d30@gmail.com>
     [not found] ` <X+78YNyHEa36fYsp@breton.holly.idiocy.org>
     [not found]   ` <CAKDRQS5eF0S2nk70mcW20yz_A8J36M=qtMwsTaV_wKWgTUZOwQ@mail.gmail.com>
     [not found]     ` <X/NQ2mjwBp0+Ex+c@breton.holly.idiocy.org>
     [not found]       ` <CAKDRQS40rKnNmTqbJM97OETfCKnz=5EvUNf1pDZiEWx-iD6+Yw@mail.gmail.com>
2021-01-06 18:53         ` Alan Third [this message]
2021-01-09 23:21           ` bug#45658: Infinite loop in run loop on macOS Jimmy Yuen Ho Wong
2021-01-09 23:33             ` Jimmy Yuen Ho Wong
2021-01-10  0:01             ` Alan Third
2021-01-10  0:46               ` Jimmy Yuen Ho Wong
2021-01-10 10:28                 ` Alan Third
2021-01-14  9:52                   ` Jimmy Yuen Ho Wong
2021-10-20  2:02           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-20 20:24             ` Alan Third
2021-10-20 20:39               ` Jimmy Yuen Ho Wong
2022-01-31 17:19                 ` Lars Ingebrigtsen
2022-03-01 15:45                   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=X/YHNRPuY0+w00RW@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=45658@debbugs.gnu.org \
    --cc=wyuenho@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).