GNU bug report logs - #35204
27.0.50; Crash on Cygwin

Previous Next

Package: emacs;

Reported by: Katsumi Yamaoka <yamaoka <at> jpl.org>

Date: Tue, 9 Apr 2019 08:09:02 UTC

Severity: normal

Merged with 35259

Found in version 27.0.50

Done: Katsumi Yamaoka <yamaoka <at> jpl.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alex Gramiak <agrambot <at> gmail.com>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: Eli Zaretskii <eliz <at> gnu.org>, yamaoka <at> jpl.org, 35204 <at> debbugs.gnu.org
Subject: bug#35204: 27.0.50; Crash on Cygwin
Date: Sat, 13 Apr 2019 16:50:38 -0600
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> From: Ken Brown <kbrown <at> cornell.edu>
>>> CC: "35204 <at> debbugs.gnu.org" <35204 <at> debbugs.gnu.org>
>>> Date: Fri, 12 Apr 2019 14:54:21 +0000
>>> 
>>> I can replicate the crash on my system, but reverting only a tiny part of the 
>>> commits in question seems to fix it, in the sense that I can successfully 
>>> evaluate x-display-monitor-attributes-list:
>>> 
>>> diff --git a/src/xfns.c b/src/xfns.c
>>> index 13f66f0718..3e4d037716 100644
>>> --- a/src/xfns.c
>>> +++ b/src/xfns.c
>>> @@ -5030,7 +5030,7 @@ Internal use only, use `display-monitor-attributes-list' 
>>> instead.  */)
>>>         mi->mm_height = height_mm;
>>> 
>>>   #if GTK_CHECK_VERSION (3, 22, 0)
>>> -      mi->name = xstrdup (gdk_monitor_get_model (monitor));
>>> +      mi->name = g_strdup (gdk_monitor_get_model (monitor));
>>>   #elif GTK_CHECK_VERSION (2, 14, 0)
>>>         mi->name = gdk_screen_get_monitor_plug_name (gscreen, i);
>>>   #endif
>>> 
>>> I don't know enough about GTK to know why this fixes it or why no one else has 
>>> reported the problem.  It's hard to see why this would be specific to Cygwin.
>>
>> We release storage of mi->name (in free_monitors) by calling xfree, so
>> I'm surprised g_strdup is right here, as that is documented to need
>> g_free instead.  I wonder what am I missing.
>
> I think the missing clue is in bug#35259: gdk_monitor_get_model may
> return NULL, which g_strdup gladly accepts, but xstrdup does not.
>
> https://debbugs.gnu.org/35259

Yeah, this is it. I suppose the reason why it wasn't reported before is
that it depends on GTK not being able to grab your monitor name, which
is hardware-dependent. I must have assumed that using g_strdup meant
that I didn't need to check for NULL.

It should be fixed with commit 7308c2edf, so please test again. Sorry
for the inconvenience.




This bug report was last modified 6 years and 40 days ago.

Previous Next


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