Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
bug#12832: 24.3.50; Emacs lockup when idle
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 31 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Andy Moreton  
View profile  
 More options Nov 8 2012, 7:58 am
Newsgroups: gnu.emacs.bug
From: Andy Moreton <andrewjmore...@gmail.com>
Date: Thu, 08 Nov 2012 12:57:18 +0000
Local: Thurs, Nov 8 2012 7:57 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle
Windows Emacs (built from r110828) was idle for a few minutes while I made a
coffee. On returning, emacs was completely unresponsive and redisplay
was not drawing anything.

Windows XP SP3
MinGW gcc 4.7.2

Backtrace from "thread apply all bt full":

Thread 6 (Thread 8744.0x2080):
#0  0x7c90120f in ntdll!DbgUiConnectToDbg () from C:\WINDOWS\system32\ntdll.dll
No symbol table info available.
#1  0x7c952119 in ntdll!KiIntSystemCall () from C:\WINDOWS\system32\ntdll.dll
No symbol table info available.
#2  0x00000005 in ?? ()
No symbol table info available.
#3  0x00000004 in ?? ()
No symbol table info available.
#4  0x00000001 in ?? ()
No symbol table info available.
#5  0x5ad3ffd0 in ?? ()
No symbol table info available.
#6  0x00000000 in ?? ()
No symbol table info available.

Lisp Backtrace:
"redisplay_internal (C function)" (0x167235c)

Thread 5 (Thread 8744.0x5ec):
#0  0x7c90e514 in ntdll!LdrAccessResource () from C:\WINDOWS\system32\ntdll.dll
No symbol table info available.
#1  0x7c90d9da in ntdll!ZwReadFile () from C:\WINDOWS\system32\ntdll.dll
No symbol table info available.
#2  0x7c801879 in ReadFile () from C:\WINDOWS\system32\kernel32.dll
No symbol table info available.
#3  0x00000610 in ?? ()
No symbol table info available.
#4  0x00000000 in ?? ()
No symbol table info available.

Lisp Backtrace:
"redisplay_internal (C function)" (0x167235c)

Thread 4 (Thread 8744.0x241c):
#0  0x7c90e514 in ntdll!LdrAccessResource () from C:\WINDOWS\system32\ntdll.dll
No symbol table info available.
#1  0x7c90df5a in ntdll!ZwWaitForSingleObject () from
C:\WINDOWS\system32\ntdll.dll
No symbol table info available.
#2  0x7c8025db in WaitForSingleObjectEx () from C:\WINDOWS\system32\kernel32.dll
No symbol table info available.
#3  0x000005d0 in ?? ()
No symbol table info available.
#4  0x00000000 in ?? ()
No symbol table info available.

Lisp Backtrace:
"redisplay_internal (C function)" (0x167235c)

Thread 3 (Thread 8744.0x21d4):
#0  0x7c90e514 in ntdll!LdrAccessResource () from C:\WINDOWS\system32\ntdll.dll
No symbol table info available.
#1  0x7e4191be in USER32!GetProcessWindowStation () from
C:\WINDOWS\system32\user32.dll
No symbol table info available.
#2  0x7e4191f1 in USER32!GetMessageW () from C:\WINDOWS\system32\user32.dll
No symbol table info available.
#3  0x0114875d in w32_msg_pump (msg_buf=0x5b5aff54) at w32fns.c:2386
         msg = {
           hwnd = 0x3f9500bc,
           message = 0xf,
           wParam = 0x0,
           lParam = 0x0,
           time = 0x6cc97f02,
           pt = {
             x = 0xdd,
             y = 0x2f
           }
         }
         result = 0x0
         focus_window = 0x403
#4  0x0114899b in w32_msg_worker@4 (arg=0x0) at w32fns.c:2612
         msg = {
           hwnd = 0x86af0b20,
           message = 0x80502fc0,
           wParam = 0x0,
           lParam = 0x0,
           time = 0x0,
           pt = {
             x = 0x80502fc8,
             y = 0x8dedcca0
           }
         }
         dummy_buf = {
           next = 0x0,
           w32msg = {
             msg = {
               hwnd = 0x0,
               message = 0x0,
               wParam = 0x0,
               lParam = 0x0,
               time = 0x0,
               pt = {
                 x = 0x0,
                 y = 0x0
               }
             },
             dwModifiers = 0x0,
             rect = {
               left = 0x0,
               top = 0x0,
               right = 0x0,
               bottom = 0x0
             }
           },
           result = 0x0,
           completed = 0x0
         }
#5  0x7c80b729 in KERNEL32!GetModuleFileNameA () from
C:\WINDOWS\system32\kernel32.dll
No symbol table info available.
#6  0x00000000 in ?? ()
No symbol table info available.

Lisp Backtrace:
"redisplay_internal (C function)" (0x167235c)

Thread 2 (Thread 8744.0x1840):
#0  0x7c90e514 in ntdll!LdrAccessResource () from C:\WINDOWS\system32\ntdll.dll
No symbol table info available.
#1  0x7c90d21a in ntdll!ZwDelayExecution () from C:\WINDOWS\system32\ntdll.dll
No symbol table info available.
#2  0x7c8023f1 in SleepEx () from C:\WINDOWS\system32\kernel32.dll
No symbol table info available.
#3  0x00000000 in ?? ()
No symbol table info available.

Lisp Backtrace:
"redisplay_internal (C function)" (0x167235c)

Thread 1 (Thread 8744.0xf50):
#0  0x7c90e514 in ntdll!LdrAccessResource () from C:\WINDOWS\system32\ntdll.dll
No symbol table info available.
#1  0x7c90d2aa in ntdll!ZwDuplicateObject () from C:\WINDOWS\system32\ntdll.dll
No symbol table info available.
#2  0x7c80df03 in KERNEL32!DuplicateHandle () from
C:\WINDOWS\system32\kernel32.dll
No symbol table info available.
#3  0xffffffff in ?? ()
No symbol table info available.
#4  0xfffffffe in ?? ()
No symbol table info available.
#5  0xffffffff in ?? ()
No symbol table info available.
#6  0x0162acb8 in real_itimer ()
No symbol table info available.
#7  0x00000000 in ?? ()
No symbol table info available.

Lisp Backtrace:
"redisplay_internal (C function)" (0x167235c)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Nov 8 2012, 11:30 am
Newsgroups: gnu.emacs.bug
From: Eli Zaretskii <e...@gnu.org>
Date: Thu, 08 Nov 2012 18:28:40 +0200
Local: Thurs, Nov 8 2012 11:28 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle

> Date: Thu, 08 Nov 2012 12:57:18 +0000
> From: Andy Moreton <andrewjmore...@gmail.com>

> Windows Emacs (built from r110828) was idle for a few minutes while I made a
> coffee. On returning, emacs was completely unresponsive and redisplay
> was not drawing anything.

If this recurs, maybe try bisecting to find the problematic commit.
Do you know what was the previous revision which you used?

Also, how was Emacs unresponsive -- did it consume any CPU cycles at
all?  Were all the threads locked up, or just some?  If you detach
from it, then attach again, do you see exactly the same backtrace?

> #3  0x0114875d in w32_msg_pump (msg_buf=0x5b5aff54) at w32fns.c:2386
>          msg = {
>            hwnd = 0x3f9500bc,
>            message = 0xf,
>            wParam = 0x0,
>            lParam = 0x0,
>            time = 0x6cc97f02,
>            pt = {
>              x = 0xdd,
>              y = 0x2f
>            }
>          }
>          result = 0x0
>          focus_window = 0x403

This looks like the input thread is waiting for GetMessageW to return,
which is normal -- it means there's no input, and we are waiting for
it.

This is the main thread, but its backtrace looks like the stack is
smashed, and real_itimer is a variable, not a function.

We need more data points on this.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Moreton  
View profile  
 More options Nov 8 2012, 1:34 pm
Newsgroups: gnu.emacs.bug
From: Andy Moreton <andrewjmore...@gmail.com>
Date: Thu, 08 Nov 2012 18:33:11 +0000
Local: Thurs, Nov 8 2012 1:33 pm
Subject: bug#12832: 24.3.50; Emacs lockup when idle
On 08/11/2012 16:28, Eli Zaretskii wrote:

>> Date: Thu, 08 Nov 2012 12:57:18 +0000
>> From: Andy Moreton <andrewjmore...@gmail.com>

>> Windows Emacs (built from r110828) was idle for a few minutes while I made a
>> coffee. On returning, emacs was completely unresponsive and redisplay
>> was not drawing anything.

> If this recurs, maybe try bisecting to find the problematic commit.
> Do you know what was the previous revision which you used?

I rebuild emacs every day from trunk, but only do a full bootstrap when
necessary. I have updated the Mingw compiler this week though, so that could
be an issue. I'll try bisecting (and downgrading the compiler) if I see this
again.

> Also, how was Emacs unresponsive -- did it consume any CPU cycles at
> all?  Were all the threads locked up, or just some?  If you detach
> from it, then attach again, do you see exactly the same backtrace?

Emacs was not consuming any cycles - the system was completely idle.

I'll see if this is reproduceable and try to get more info.

     AndyM


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Nov 9 2012, 4:57 am
Newsgroups: gnu.emacs.bug
From: Eli Zaretskii <e...@gnu.org>
Date: Fri, 09 Nov 2012 11:56:14 +0200
Local: Fri, Nov 9 2012 4:56 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle

> Date: Thu, 08 Nov 2012 18:33:11 +0000
> From: Andy Moreton <andrewjmore...@gmail.com>
> CC: 12...@debbugs.gnu.org

> I rebuild emacs every day from trunk, but only do a full bootstrap when
> necessary. I have updated the Mingw compiler this week though, so that could
> be an issue.

Was the build optimized?  (I'm guessing not, but I want to be sure.)

> I'll try bisecting (and downgrading the compiler) if I see this
> again.

Thanks.

> > Also, how was Emacs unresponsive -- did it consume any CPU cycles at
> > all?  Were all the threads locked up, or just some?  If you detach
> > from it, then attach again, do you see exactly the same backtrace?

> Emacs was not consuming any cycles - the system was completely idle.

OK.  Any idea why you had so many threads?  Normally, Emacs 24.3.50
should have only 3: the main thread, the input thread, and a thread
that runs atimers (Emacs arranges for a timer to fire every 2 seconds,
to check whether any new input has arrived.)  Yet another thread, the
4th one, is automatically started by the OS when you attach a debugger
to Emacs, and this is it:

  Thread 6 (Thread 8744.0x2080):
  #0  0x7c90120f in ntdll!DbgUiConnectToDbg () from C:\WINDOWS\system32\ntdll.dll
  No symbol table info available.
  #1  0x7c952119 in ntdll!KiIntSystemCall () from C:\WINDOWS\system32\ntdll.dll
  No symbol table info available.

But what are the other 2 threads you have, namely:

  Thread 5 (Thread 8744.0x5ec):
  #0  0x7c90e514 in ntdll!LdrAccessResource () from C:\WINDOWS\system32\ntdll.dll
  No symbol table info available.
  #1  0x7c90d9da in ntdll!ZwReadFile () from C:\WINDOWS\system32\ntdll.dll
  No symbol table info available.
  #2  0x7c801879 in ReadFile () from C:\WINDOWS\system32\kernel32.dll
  No symbol table info available.
  #3  0x00000610 in ?? ()
  No symbol table info available.
  #4  0x00000000 in ?? ()
  No symbol table info available.

  Thread 4 (Thread 8744.0x241c):
  #0  0x7c90e514 in ntdll!LdrAccessResource () from C:\WINDOWS\system32\ntdll.dll
  No symbol table info available.
  #1  0x7c90df5a in ntdll!ZwWaitForSingleObject () from
  C:\WINDOWS\system32\ntdll.dll
  No symbol table info available.
  #2  0x7c8025db in WaitForSingleObjectEx () from C:\WINDOWS\system32\kernel32.dll
  No symbol table info available.
  #3  0x000005d0 in ?? ()
  No symbol table info available.
  #4  0x00000000 in ?? ()
  No symbol table info available.

One of them appears to be reading something, the other is waiting for
some event.  Did you have some subprocess running or some network
connection active at that time?  Or maybe your routine operation has
some subprocesses (a speller, perhaps?) and/or network connections
active?

> > We need more data points on this.

> I'll see if this is reproduceable and try to get more info.

Thanks.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Moreton  
View profile  
 More options Nov 9 2012, 5:49 am
Newsgroups: gnu.emacs.bug
From: Andy Moreton <andrewjmore...@gmail.com>
Date: Fri, 09 Nov 2012 10:48:31 +0000
Local: Fri, Nov 9 2012 5:48 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle
On 09/11/2012 09:56, Eli Zaretskii wrote:

>> Date: Thu, 08 Nov 2012 18:33:11 +0000
>> From: Andy Moreton <andrewjmore...@gmail.com>
>> CC: 12...@debbugs.gnu.org

>> I rebuild emacs every day from trunk, but only do a full bootstrap when
>> necessary. I have updated the Mingw compiler this week though, so that could
>> be an issue.

> Was the build optimized?  (I'm guessing not, but I want to be sure.)

system-configuration-options includes --no-opt, so unoptimized.

[snipped]
 > One of them appears to be reading something, the other is waiting for
 > some event.  Did you have some subprocess running or some network
 > connection active at that time?  Or maybe your routine operation has
 > some subprocesses (a speller, perhaps?) and/or network connections
 > active?

I have some files open via tramp (pscp method) on another machine. This uses
putty for ssh (plink.exe) and scp (pscp.exe) for file tranfers. At the time of
the lockup, emacs had a CMD.EXE subprocess running plink.exe.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Nov 9 2012, 6:16 am
Newsgroups: gnu.emacs.bug
From: Eli Zaretskii <e...@gnu.org>
Date: Fri, 09 Nov 2012 13:14:45 +0200
Local: Fri, Nov 9 2012 6:14 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle

> Date: Fri, 09 Nov 2012 10:48:31 +0000
> From: Andy Moreton <andrewjmore...@gmail.com>
> CC: 12...@debbugs.gnu.org

> I have some files open via tramp (pscp method) on another machine. This uses
> putty for ssh (plink.exe) and scp (pscp.exe) for file tranfers. At the time of
> the lockup, emacs had a CMD.EXE subprocess running plink.exe.

Thanks.  I wanted to know this to try to reproduce the lockup here.  I
will try that as soon as the problem with crashes on Windows is
resolved.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Nov 9 2012, 1:11 pm
Newsgroups: gnu.emacs.bug
From: Eli Zaretskii <e...@gnu.org>
Date: Fri, 09 Nov 2012 20:11:01 +0200
Local: Fri, Nov 9 2012 1:11 pm
Subject: bug#12832: 24.3.50; Emacs lockup when idle

> Date: Fri, 09 Nov 2012 13:14:45 +0200
> From: Eli Zaretskii <e...@gnu.org>
> Cc: 12...@debbugs.gnu.org

> > Date: Fri, 09 Nov 2012 10:48:31 +0000
> > From: Andy Moreton <andrewjmore...@gmail.com>
> > CC: 12...@debbugs.gnu.org

> > I have some files open via tramp (pscp method) on another machine. This uses
> > putty for ssh (plink.exe) and scp (pscp.exe) for file tranfers. At the time of
> > the lockup, emacs had a CMD.EXE subprocess running plink.exe.

> Thanks.  I wanted to know this to try to reproduce the lockup here.  I
> will try that as soon as the problem with crashes on Windows is
> resolved.

The latest trunk is up and running for more than 3 hours with no
problems.  I have a shell buffer running plink and a remote file
fetched with pscp.  I also have display-time active.

Any other features you have on that could trigger periodic processing
of any kind?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Moreton  
View profile  
 More options Nov 9 2012, 1:38 pm
Newsgroups: gnu.emacs.bug
From: Andy Moreton <andrewjmore...@gmail.com>
Date: Fri, 09 Nov 2012 18:38:36 +0000
Local: Fri, Nov 9 2012 1:38 pm
Subject: bug#12832: 24.3.50; Emacs lockup when idle
On 09/11/2012 18:11, Eli Zaretskii wrote:

I have seen this once again, after doing a full bootstrap from tip this
morning to ensure I wasn't seeing artifacts of a broken build. It seems to
happen about once a day.

> Any other features you have on that could trigger periodic processing
> of any kind?

Not that I know of. The emacs-server is running, but I not used anything that
connects to it, so it should be doing anything. I do use gnus to read news,
but quit gnus after I've read some groups (the lockup was several hours later).

The compiler update may be at issue, so I'll try downgrading back to MinGW gcc
4.7.0 and doing a full bootstrap.

Anything else I should look for in gdb ?

     AndyM


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Nov 9 2012, 2:12 pm
Newsgroups: gnu.emacs.bug
From: Eli Zaretskii <e...@gnu.org>
Date: Fri, 09 Nov 2012 21:12:21 +0200
Local: Fri, Nov 9 2012 2:12 pm
Subject: bug#12832: 24.3.50; Emacs lockup when idle

> Date: Fri, 09 Nov 2012 18:38:36 +0000
> From: Andy Moreton <andrewjmore...@gmail.com>
> CC: 12...@debbugs.gnu.org

> The compiler update may be at issue, so I'll try downgrading back to MinGW gcc
> 4.7.0 and doing a full bootstrap.

That's a good idea.

> Anything else I should look for in gdb ?

Try continuing the other threads, and see if they are all stuck, or
just the main one.  I think the command is "thread NUMBER continue".

Also, looking at the threads in the Process Explorer should tell if
they are alive or locked up.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Nov 9 2012, 2:16 pm
Newsgroups: gnu.emacs.bug
From: Eli Zaretskii <e...@gnu.org>
Date: Fri, 09 Nov 2012 21:15:57 +0200
Local: Fri, Nov 9 2012 2:15 pm
Subject: bug#12832: 24.3.50; Emacs lockup when idle

> Date: Fri, 09 Nov 2012 21:12:21 +0200
> From: Eli Zaretskii <e...@gnu.org>
> Cc: 12...@debbugs.gnu.org

> Try continuing the other threads, and see if they are all stuck, or
> just the main one.  I think the command is "thread NUMBER continue".

Sorry, the correct command is "thread apply NUMBER continue".

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Nov 13 2012, 8:01 am
Newsgroups: gnu.emacs.bug
From: Eli Zaretskii <e...@gnu.org>
Date: Tue, 13 Nov 2012 14:59:55 +0200
Local: Tues, Nov 13 2012 7:59 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle
It looks like Fabrice just saw a very similar, if not identical,
lockup:

This backtrace is more informative.  I'm beginning to think that
there's some deadlock between threads that use a critical section,
because all of the threads are parked at the same interface:
ntdll!LdrAccessResource, and at least one of them waits for a critical
section:

> Thread 3 (Thread 6696.0xc28):
> #0  0x7c91e514 in ntdll!LdrAccessResource () from /cygdrive/c/WINDOWS/system32/ntdll.dll
> #1  0x7c91df5a in ntdll!ZwWaitForSingleObject () from /cygdrive/c/WINDOWS/system32/ntdll.dll
> #2  0x7c929b23 in ntdll!RtlpWaitForCriticalSection () from /cygdrive/c/WINDOWS/system32/ntdll.dll
> #3  0x7c911046 in ntdll!RtlEnumerateGenericTableLikeADirectory () from /cygdrive/c/WINDOWS/system32/ntdll.dll
> #4  0x006811a0 in ?? ()
> #5  0x012e871e in post_msg (lpmsg=0x5b8cfa94) at w32xfns.c:279
> #6  0x01147b48 in my_post_msg (wmsg=0x5b8cfa94, hwnd=0x2cec0092, msg=0, wParam=103, lParam=2228225) at w32fns.c:1942

Fabrice, what bzr revision did you compile, and with what version of
GCC?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fabrice Niessen  
View profile  
 More options Nov 13 2012, 8:14 am
Newsgroups: gnu.emacs.bug
From: "Fabrice Niessen" <f...@missioncriticalit.com>
Date: Tue, 13 Nov 2012 14:13:19 +0100
Local: Tues, Nov 13 2012 8:13 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle
Dear Eli,

I did not compile it myself. I took a version compiled (on 22 October) by Dani
Moncayo, downloaded from https://www.dropbox.com/sh/7jr3vbv9tm1zod0/jPuvfrJAe8.

However, eval'ing emacs-bzr-version returns:

"110618 monn...@iro.umontreal.ca-20121022132928-232zm0fecassmhfb"

> and with what version of GCC?

No idea, sorry...

Does his recipe
(https://www.dropbox.com/sh/7jr3vbv9tm1zod0/qpjXONObVR/emacs-build-rec...)
give you valuable information?

Best regards,
Fabrice


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dani Moncayo  
View profile  
 More options Nov 13 2012, 8:40 am
Newsgroups: gnu.emacs.bug
From: Dani Moncayo <dmonc...@gmail.com>
Date: Tue, 13 Nov 2012 14:39:34 +0100
Local: Tues, Nov 13 2012 8:39 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle

>> and with what version of GCC?

> No idea, sorry...

> Does his recipe
> (https://www.dropbox.com/sh/7jr3vbv9tm1zod0/qpjXONObVR/emacs-build-rec...)
> give you valuable information?

That build was from revno 110618 (2012-10-22), so the GCC version
should be 4.7.0, since MinGW didn't upgrade to 4.7.2 until 2012-11-05.
 (My builds thereafter were with GCC 4.7.2)

--
Dani Moncayo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Nov 13 2012, 9:07 am
Newsgroups: gnu.emacs.bug
From: Eli Zaretskii <e...@gnu.org>
Date: Tue, 13 Nov 2012 16:07:14 +0200
Local: Tues, Nov 13 2012 9:07 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle

> Date: Tue, 13 Nov 2012 14:39:34 +0100
> From: Dani Moncayo <dmonc...@gmail.com>
> Cc: Eli Zaretskii <e...@gnu.org>, 12...@debbugs.gnu.org,
>    Andy Moreton <andrewjmore...@gmail.com>

> That build was from revno 110618 (2012-10-22), so the GCC version
> should be 4.7.0, since MinGW didn't upgrade to 4.7.2 until 2012-11-05.

Thanks.  Andrew used 4.7.0 before the crashes, so I don't think the
compiler version is an issue.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Moreton  
View profile  
 More options Nov 13 2012, 9:26 am
Newsgroups: gnu.emacs.bug
From: Andy Moreton <andrewjmore...@gmail.com>
Date: Tue, 13 Nov 2012 14:25:30 +0000
Local: Tues, Nov 13 2012 9:25 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle
On 13/11/2012 14:07, Eli Zaretskii wrote:

>> Date: Tue, 13 Nov 2012 14:39:34 +0100
>> From: Dani Moncayo <dmonc...@gmail.com>
>> Cc: Eli Zaretskii <e...@gnu.org>, 12...@debbugs.gnu.org,
>>        Andy Moreton <andrewjmore...@gmail.com>

>> That build was from revno 110618 (2012-10-22), so the GCC version
>> should be 4.7.0, since MinGW didn't upgrade to 4.7.2 until 2012-11-05.

> Thanks.  Andrew used 4.7.0 before the crashes, so I don't think the
> compiler version is an issue.

Correct - I've done a clean bootstrap using 4.7.0, and I see this problem on
both trunk and emacs-24 branches.

Looking emacs-24 (r110863) with Process Explorer:

212412   emacs.exe+0x32291              State:  Wait:DelayExecution
212616   emacs.exe+0x148efe             State:  Wait:Suspended
212604   emacs.exe+0x142350             State:  Wait:WrUserRequest
236140   RPCRT4.dll!ThreadStartRoutine  State:  Wait:WrQueue

I tried suspending and then resuming each thread in turn from Process
Explorer. Resuming thread 212604 unblocked emacs and it started working again.

    AndyM


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Nov 13 2012, 10:17 am
Newsgroups: gnu.emacs.bug
From: Eli Zaretskii <e...@gnu.org>
Date: Tue, 13 Nov 2012 17:16:38 +0200
Local: Tues, Nov 13 2012 10:16 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle

Was that the only thread whose resumption unlocks Emacs?  If so, can
you find out what thread was that?  Process Explorer can show that
call-stack, and you should be able to find out what functions were
referenced by using the "info line" command inside GDB.  Like this:

  (gdb) info line *0x11c3d40
  Line 863 of "sysdep.c" starts at address 0x11c3d40 <init_sys_modes+7>
     and ends at 0x11c3d4a <init_sys_modes+17>.

(Note the asterisk before the address.)

WrUserRequest seems to indicate that the thread was suspended by the
application itself, which would point the blaming finger at my
implementation of SIGALRM (see w32proc.c), whereby when the timer
expires, the thread which runs the timer code suspends the main
thread, invokes the signal handler, and then resumes the main thread.
If my guess is correct, this would mean that the thread whose state is
WrUserRequest is the main (a.k.a. "Lisp") thread.

Another possibility is that this is the input thread, the one that
calls GetMessage.  But then I don't understand why it is blocked
forever until manually resumed.  Hmm...

If you attach GDB, do you again see garbled backtrace, like in the
original report?  Or do you see something more informative?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Moreton  
View profile  
 More options Nov 13 2012, 11:01 am
Newsgroups: gnu.emacs.bug
From: Andy Moreton <andrewjmore...@gmail.com>
Date: Tue, 13 Nov 2012 16:00:30 +0000
Local: Tues, Nov 13 2012 11:00 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle
On 13/11/2012 15:16, Eli Zaretskii wrote:

I tried to get call stacks from process Explorer, but that made it die :-(

The fatc that thread 236140 is at ThreadStartRoutine makes me wonder if this
is related to the perils of DllMain (i.e. the loader lock).

> If you attach GDB, do you again see garbled backtrace, like in the
> original report?  Or do you see something more informative?

Sorry, I don't have the original process running any more - it's hard to get
anything done with an unresponsive app of the screen. I'll try to dig out more
info the next time I get a lockup.

The one thing that does seem completely consistent is that the lockup happens
after several minutes of being idle (i.e. no keyboard or mouse input).

     AndyM


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Nov 13 2012, 11:35 am
Newsgroups: gnu.emacs.bug
From: Eli Zaretskii <e...@gnu.org>
Date: Tue, 13 Nov 2012 18:35:02 +0200
Local: Tues, Nov 13 2012 11:35 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle

> Date: Tue, 13 Nov 2012 16:00:30 +0000
> From: Andy Moreton <andrewjmore...@gmail.com>
> CC: dmonc...@gmail.com, f...@missioncriticalit.com, 12...@debbugs.gnu.org

> The fact that thread 236140 is at ThreadStartRoutine makes me wonder if this
> is related to the perils of DllMain (i.e. the loader lock).

Sorry, I don't follow.  Can you say more about this problem, or point
me to some accessible documentation about it?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Moreton  
View profile  
 More options Nov 13 2012, 11:41 am
Newsgroups: gnu.emacs.bug
From: Andy Moreton <andrewjmore...@gmail.com>
Date: Tue, 13 Nov 2012 16:40:29 +0000
Local: Tues, Nov 13 2012 11:40 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle
On 13/11/2012 16:35, Eli Zaretskii wrote:

>> Date: Tue, 13 Nov 2012 16:00:30 +0000
>> From: Andy Moreton <andrewjmore...@gmail.com>
>> CC: dmonc...@gmail.com, f...@missioncriticalit.com, 12...@debbugs.gnu.org

>> The fact that thread 236140 is at ThreadStartRoutine makes me wonder if this
>> is related to the perils of DllMain (i.e. the loader lock).

> Sorry, I don't follow.  Can you say more about this problem, or point
> me to some accessible documentation about it?

The DllMain notifications for process and thread create/destroy are called
with the (system internal) loader lock held. This means that anything called
from these routines should not use locks, or deadlock is possible. So I was
wondering if the thread manipulation for timer handling is interacting with
those mechanisms.

Of course I don't know nearly enough about Win32 to actually say much useful
here, so the actual problem is probably something else entirely.

     AndyM


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Nov 13 2012, 12:05 pm
Newsgroups: gnu.emacs.bug
From: Eli Zaretskii <e...@gnu.org>
Date: Tue, 13 Nov 2012 19:04:48 +0200
Local: Tues, Nov 13 2012 12:04 pm
Subject: bug#12832: 24.3.50; Emacs lockup when idle
Can you please try the patch below and see if it prevents the
lock-ups?

=== modified file 'src/w32proc.c'
--- src/w32proc.c       2012-11-05 03:18:32 +0000
+++ src/w32proc.c       2012-11-13 16:59:53 +0000
@@ -431,13 +431,24 @@ timer_loop (LPVOID arg)
          /* Simulate a signal delivered to the thread which installed
             the timer, by suspending that thread while the handler
             runs.  */
-         DWORD result = SuspendThread (itimer->caller_thread);
+         DWORD result;
+
+         if (dwMainThreadId)
+           enter_crit ();
+         result = SuspendThread (itimer->caller_thread);

          if (result == (DWORD)-1)
-           return 2;
+           {
+             if (dwMainThreadId)
+               leave_crit ();
+             return 2;
+           }

          handler (sig);
          ResumeThread (itimer->caller_thread);
+
+         if (dwMainThreadId)
+           leave_crit ();
        }

       /* Update expiration time and loop.  */


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Nov 13 2012, 12:20 pm
Newsgroups: gnu.emacs.bug
From: Eli Zaretskii <e...@gnu.org>
Date: Tue, 13 Nov 2012 19:20:07 +0200
Local: Tues, Nov 13 2012 12:20 pm
Subject: bug#12832: 24.3.50; Emacs lockup when idle

Thanks for the explanation.

> Of course I don't know nearly enough about Win32 to actually say much useful
> here, so the actual problem is probably something else entirely.

Don't assume I know more than you do ;-)

Anyway, I actually don't understand why some thread is at
ThreadStartRoutine, if that fact really means that a thread is being
created.  The timer thread is created during startup, and is not shut
down until Emacs shuts down.  And we don't create any other threads in
the middle of a session (unless the user invokes profiler).

So the only way I can understand this ThreadStartRoutine business is
that somehow the timer thread exited due to an error (look for a line
saying "return 2;" in timer_loop), and then the next time Emacs sets
up the 2-sec atimer, a new thread will be started.

So could you please set a breakpoint at line 575 in w32proc.c, which
is this:

  /* Start a new thread.  */
  itimer->terminate = 0;
  itimer->type = which; <<<<<<<<<<<<<<<<<<<<<<<<<<<

run Emacs under GDB, and see if this breakpoint breaks more than once
when you run Emacs as usual?  It should break one time during startup,
and never thereafter.  To make sure you don't disrupt the timers,
define commands for this breakpoint that simply continue, like this:

  (gdb) break w32proc.c:575
  (gdb) commands
  > continue
  > end


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Moreton  
View profile  
 More options Nov 14 2012, 7:45 am
Newsgroups: gnu.emacs.bug
From: Andy Moreton <andrewjmore...@gmail.com>
Date: Wed, 14 Nov 2012 12:44:39 +0000
Local: Wed, Nov 14 2012 7:44 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle
On 13/11/2012 17:04, Eli Zaretskii wrote:

I applied this to emacs-24 branch (r110866) this morning. So far I've not seen
a lockup, but I'll to run it for a day or two to be sure.

     AndyM


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Moreton  
View profile  
 More options Nov 14 2012, 11:30 am
Newsgroups: gnu.emacs.bug
From: Andy Moreton <andrewjmore...@gmail.com>
Date: Wed, 14 Nov 2012 16:29:53 +0000
Local: Wed, Nov 14 2012 11:29 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle
On 14/11/2012 12:44, Andy Moreton wrote:

After longer uptime, it seems this patch is not successful. I haven't had a
complete lockup, but I have seen a couple of glitches where it froze but then
recovered a short while later.

The unfreeze may have been due to capturing a stack trace with Process
Explorer (I have upgraded to the latest version which is less buggy).

The patched emacs-24 does seem to leak handles: at the moment Process Explorer
report that emacs has 50805 handles in all, most of which are thread handles.
The number of handles seems to increase at a rate of 2 to 4 per second.

     AndyM


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lennart Borgman  
View profile  
 More options Nov 14 2012, 11:49 am
Newsgroups: gnu.emacs.bug
From: Lennart Borgman <lennart.borg...@gmail.com>
Date: Wed, 14 Nov 2012 17:48:41 +0100
Local: Wed, Nov 14 2012 11:48 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle
I have no time to build Emacs now and have not had it for a very long
time. However I have seen Emacs freeze a lot of times when it is idle.
This started to get more common when I moved to a 64-bit windows 7
(from windows xp, 32-bit).

I have always thought that this must be bad handling of the messages
from the operating systems, but I have had no chance to pin this down.
Reading here I wonder if data are accessed somewhere in a system time
thread without critical section handling.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli Zaretskii  
View profile  
 More options Nov 14 2012, 11:52 am
Newsgroups: gnu.emacs.bug
From: Eli Zaretskii <e...@gnu.org>
Date: Wed, 14 Nov 2012 18:51:44 +0200
Local: Wed, Nov 14 2012 11:51 am
Subject: bug#12832: 24.3.50; Emacs lockup when idle

> Date: Wed, 14 Nov 2012 16:29:53 +0000
> From: Andy Moreton <andrewjmore...@gmail.com>
> CC: dmonc...@gmail.com, f...@missioncriticalit.com, 12...@debbugs.gnu.org

> After longer uptime, it seems this patch is not successful. I haven't had a
> complete lockup, but I have seen a couple of glitches where it froze but then
> recovered a short while later.

OK, that was a stab in the dark anyway.

I found a few problems in the code and fixed them in revision 110867
on the emacs-24 branch.  Please try the latest branch (without the
patch) and see if the problem persists.

> The patched emacs-24 does seem to leak handles: at the moment Process Explorer
> report that emacs has 50805 handles in all, most of which are thread handles.
> The number of handles seems to increase at a rate of 2 to 4 per second.

Yes, that's one of the problems I fixed in r110867.  Shame on me.

(I think the fact that the handle to the caller thread was constantly
modified could be the reason for the lockup, if the change happened
between SuspendThread and ResumeThread calls.)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 31   Newer >
« Back to Discussions « Newer topic     Older topic »