Subject: bug#3399: Crash in multi-TTY mode

From: Stefan Monnier <[email-masked]>
Date: Wed, 27 May 2009 10:31:20 -0400

>> I'm almost embarrassed to report this, since it's rather strange and
>> most likely unique to my setup.  Still, it involves a crash so I
>> thought it would be worthwhile to see if anyone else can reproduce
>> it.

> The problematic scenario is:
[...]

Thanks for tracking it down.

> I think this a bug in libX11.  It should either 1) not set
> XlibDisplayDfltRMDB in XGetDefault unless dpy->db becomes non-NULL or
> 2) reset XlibDisplayDfltRMDB in XrmSetDatabase even if the previous
> database is NULL.

I'm not sure I understand all the details, but I really find the
workaround hideous (tho I do think you for coming up with it): what if
we undo your recent change that does XrmSetDatabase(dpyinfo->display,
NULL) and just free the xrm database (i.e. introducing a double-free
crash in older libX11)?  Would this also work around this problem?

        Stefan