GNU bug report logs - #6284
Crash in w32_wnd_proc at frame deletion

Previous Next

Packages: emacs, w32;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Thu, 27 May 2010 17:45:02 UTC

Severity: normal

Done: Jason Rumney <jasonr <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6284 in the body.
You can then email your comments to 6284 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6284; Package emacs. (Thu, 27 May 2010 17:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Borgman <lennart.borgman <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 27 May 2010 17:45:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Emacs Bugs <bug-gnu-emacs <at> gnu.org>
Subject: Crash in w32_wnd_proc at frame deletion
Date: Thu, 27 May 2010 19:44:27 +0200
Now I finally got a backtrace of this crash. Thanks for the (harsh)
reminders about running under gdb.

Here is part of the backtrace

  Program received signal SIGSEGV, Segmentation fault.
  [Switching to Thread 1836.0xef8]
  0x011cc376 in w32_wnd_proc (hwnd=0x1001ac, msg=32, wParam=1049004,
      lParam=33554433) at w32fns.c:4351
  4351              if (f->output_data.w32->hourglass_p && !menubar_in_use
  (gdb) bt
  #0  0x011cc376 in w32_wnd_proc (hwnd=0x1001ac, msg=32, wParam=1049004,
      lParam=33554433) at w32fns.c:4351
  #1  0x7e418734 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
  #2  0x001001ac in ?? ()
  #3  0x00000020 in ?? ()
  #4  0x001001ac in ?? ()
  #5  0x02000001 in ?? ()
  #6  0x011c9291 in post_character_message (hwnd=0x11c9291, msg=1049004,
      wParam=32, lParam=1049004, dwmodifiers=33554433) at w32fns.c:3049
  #7  0x7e418816 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
  #8  0x011c9291 in post_character_message (hwnd=0x0, msg=18649745,
      wParam=1049004, lParam=32, dwmodifiers=1049004) at w32fns.c:3049
  #9  0x7e428ea0 in USER32!DefWindowProcW () from C:\WINDOWS\system32\user32.dll
  #10 0x00000000 in ?? ()

  Lisp Backtrace:
  "delete-frame" (0x82af44)

It looks like the important part is line 4351. I tried to look at f:

  (gdb) print f
  $1 = (struct frame *) 0x0
  (gdb) print f->output_data
  Cannot access memory at address 0x104

Does this mean that f might be gone here and that there should be a
test for this?




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6284; Package emacs. (Thu, 27 May 2010 18:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 6284 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 6284 <at> debbugs.gnu.org
Subject: Re: bug#6284: Crash in w32_wnd_proc at frame deletion
Date: Thu, 27 May 2010 20:26:22 +0200
On Thu, May 27, 2010 at 19:44, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:

> Now I finally got a backtrace of this crash. Thanks for the (harsh)
> reminders about running under gdb.

More like "stern" :-)

> Here is part of the backtrace

Is that with an optimized or non-optimized build?

Is the crash repeatable at will?

    Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6284; Package emacs. (Thu, 27 May 2010 18:36:02 GMT) Full text and rfc822 format available.

Message #11 received at 6284 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 6284 <at> debbugs.gnu.org
Subject: Re: bug#6284: Crash in w32_wnd_proc at frame deletion
Date: Thu, 27 May 2010 20:34:40 +0200
On Thu, May 27, 2010 at 8:26 PM, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> On Thu, May 27, 2010 at 19:44, Lennart Borgman
> <lennart.borgman <at> gmail.com> wrote:
>
>> Now I finally got a backtrace of this crash. Thanks for the (harsh)
>> reminders about running under gdb.
>
> More like "stern" :-)

My English does not know that.

>> Here is part of the backtrace
>
> Is that with an optimized or non-optimized build?

Non-optimized.

> Is the crash repeatable at will?

Maybe, but I do not know whose will. I know how it happens, but not when.

Anyway, I mailed Eli and asked him immediately since I feared my pc
might hang (which it can do sometimes when bugs jumps in). Thee is a
bug in w32fns.c where this happened. There should be a check if f is
0.

There seems to be more places where this is not checked. I will look
through them and add a patch here.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6284; Package emacs. (Thu, 27 May 2010 22:35:01 GMT) Full text and rfc822 format available.

Message #14 received at 6284 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 6284 <at> debbugs.gnu.org
Subject: Re: bug#6284: Crash in w32_wnd_proc at frame deletion
Date: Fri, 28 May 2010 00:33:49 +0200
[Message part 1 (text/plain, inline)]
On Thu, May 27, 2010 at 8:34 PM, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:
>
> There is a
> bug in w32fns.c where this happened. There should be a check if f is
> 0.
>
> There seems to be more places where this is not checked. I will look
> through them and add a patch here.

I have attached a patch. Please review it and install it.
[bug6284-1.diff (text/x-patch, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6284; Package emacs. (Fri, 28 May 2010 23:45:02 GMT) Full text and rfc822 format available.

Message #17 received at 6284 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 6284 <at> debbugs.gnu.org
Subject: Re: bug#6284: Crash in w32_wnd_proc at frame deletion
Date: Sat, 29 May 2010 01:44:01 +0200
[Message part 1 (text/plain, inline)]
New patch. I missed one place in the previous patch and this just hit me.

It is great running under the debugger and finally being able to find
and fix those bugs I have wondered about quite long now but have not
had time to fix before.

The only problem now is how to get them installed. As I said elsewhere
I currently have no checkout from savannah so I can't checkin the
patches myself AFAIK. Should I get a second checkout from savannah for
this, or?
[bug6284-2.diff (text/x-patch, attachment)]

Reply sent to Jason Rumney <jasonr <at> gnu.org>:
You have taken responsibility. (Fri, 08 Jul 2011 12:55:03 GMT) Full text and rfc822 format available.

Notification sent to Lennart Borgman <lennart.borgman <at> gmail.com>:
bug acknowledged by developer. (Fri, 08 Jul 2011 12:55:03 GMT) Full text and rfc822 format available.

Message #22 received at 6284-done <at> debbugs.gnu.org (full text, mbox):

From: Jason Rumney <jasonr <at> gnu.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: Juanma Barranquero <lekktu <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
	6284-done <at> debbugs.gnu.org
Subject: Re: bug#6284: Crash in w32_wnd_proc at frame deletion
Date: Fri, 08 Jul 2011 20:53:47 +0800
Lennart Borgman <lennart.borgman <at> gmail.com> writes:

> New patch. I missed one place in the previous patch and this just hit me.
>
> It is great running under the debugger and finally being able to find
> and fix those bugs I have wondered about quite long now but have not
> had time to fix before.
>
> The only problem now is how to get them installed. As I said elsewhere
> I currently have no checkout from savannah so I can't checkin the
> patches myself AFAIK. Should I get a second checkout from savannah for
> this, or?

I fixed the two locations where a bug could conceivably occur.  Others
were either #ifdef'ed out, or already protected against dereferencing
the non-existent frame struct.




Message #23 received at 6284-done <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Jason Rumney <jasonr <at> gnu.org>
Cc: Juanma Barranquero <lekktu <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
	6284-done <at> debbugs.gnu.org
Subject: Re: bug#6284: Crash in w32_wnd_proc at frame deletion
Date: Fri, 8 Jul 2011 16:19:01 +0200
On Fri, Jul 8, 2011 at 14:53, Jason Rumney <jasonr <at> gnu.org> wrote:
> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>
>> New patch. I missed one place in the previous patch and this just hit me.
>>
>> It is great running under the debugger and finally being able to find
>> and fix those bugs I have wondered about quite long now but have not
>> had time to fix before.
>>
>> The only problem now is how to get them installed. As I said elsewhere
>> I currently have no checkout from savannah so I can't checkin the
>> patches myself AFAIK. Should I get a second checkout from savannah for
>> this, or?
>
> I fixed the two locations where a bug could conceivably occur.  Others
> were either #ifdef'ed out, or already protected against dereferencing
> the non-existent frame struct.

Thanks.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 06 Aug 2011 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.