unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 3399@emacsbugs.donarmstrong.com,
	Shannon Jones <cz2s20d02@sneakemail.com>
Subject: bug#3399: Crash in multi-TTY mode
Date: Fri, 29 May 2009 12:58:20 +0900	[thread overview]
Message-ID: <wl63fkwof7.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <jwvfxepnzhf.fsf-monnier+emacsbugreports@gnu.org>

>>>>> On Thu, 28 May 2009 09:14:06 -0400, Stefan Monnier <monnier@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@math.s.chiba-u.ac.jp





  reply	other threads:[~2009-05-29  3:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-27  2:44 bug#3399: Crash in multi-TTY mode Shannon Jones
2009-05-27  8:27 ` YAMAMOTO Mitsuharu
2009-05-27 14:31   ` Stefan Monnier
2009-05-28  0:47     ` YAMAMOTO Mitsuharu
2009-05-28  1:25       ` YAMAMOTO Mitsuharu
2009-05-28 13:14       ` Stefan Monnier
2009-05-29  3:58         ` YAMAMOTO Mitsuharu [this message]
2009-05-29 14:30           ` Stefan Monnier
2009-05-30  2:25             ` YAMAMOTO Mitsuharu
2009-05-30 20:37               ` Stefan Monnier
2009-05-31  7:05                 ` YAMAMOTO Mitsuharu
2009-06-01 14:37                   ` Stefan Monnier

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=wl63fkwof7.wl%mituharu@math.s.chiba-u.ac.jp \
    --to=mituharu@math.s.chiba-u.ac.jp \
    --cc=3399@emacsbugs.donarmstrong.com \
    --cc=cz2s20d02@sneakemail.com \
    --cc=monnier@iro.umontreal.ca \
    /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).