GNU bug report logs - #3399
Crash in multi-TTY mode

Previous Next

Package: emacs;

Reported by: "Shannon Jones" <cz2s20d02 <at> sneakemail.com>

Date: Wed, 27 May 2009 02:50:03 UTC

Severity: normal

Merged with 3407

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 3399 <at> debbugs.gnu.org, Shannon Jones <cz2s20d02 <at> sneakemail.com>
Subject: bug#3399: Crash in multi-TTY mode
Date: Fri, 29 May 2009 12:58:20 +0900
>>>>> On Thu, 28 May 2009 09:14:06 -0400, Stefan Monnier <monnier <at> iro.umontreal.ca> said:

>> 1. Older libX11 that doesn't care about XlibDisplayDfltRMDB at all.
>> 2. Newer libX11, when the first XGetDefault call sets dpy->db to a
>> non-NULL value.
>> 3. Newer libX11, when the first XGetDefault call sets dpy->db to NULL.

>> Case 3 corresponds to the problematic scenario I mentioned in my
>> previous mail and the other cases should work fine currently.  Undoing
>> my recent change means that we don't destroy the database ourselves,
>> and it leaks memory in Case 2 and 3.

As I corrected, the memory leak happens only in Case 2, which is the
most common case I guess.

> What if (as asked) we don't just undo your change, but additionally
> return to freeing the DB (so we'll get a crash in case 1)?  Will we then
> also get a crash in case 2 or 3?

It will crash in Case 3 as well as 1.  XCloseDisplay destroys the
associated database because XlibDisplayDfltRMDB is set, although the
database was not actually what's allocated by some XGetDefault call.
That's why I consider this is a bug in libX11.

				     YAMAMOTO Mitsuharu
				mituharu <at> math.s.chiba-u.ac.jp



This bug report was last modified 15 years and 184 days ago.

Previous Next


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