From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Gramiak Newsgroups: gmane.emacs.bugs Subject: bug#35204: 27.0.50; Crash on Cygwin Date: Sat, 13 Apr 2019 16:50:38 -0600 Message-ID: <87a7gttt8h.fsf@gmail.com> References: <83ftqr7bnb.fsf@gnu.org> <8336mq6i49.fsf@gnu.org> <83ef6865nj.fsf@gnu.org> <83a7gv4s1b.fsf@gnu.org> <56e372ca-748c-a335-1066-a1032ae1d894@cornell.edu> <831s27mezn.fsf@gnu.org> <87r2a5fsoq.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="65489"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: yamaoka@jpl.org, 35204@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 14 00:51:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hFRUN-000GpF-5w for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Apr 2019 00:51:11 +0200 Original-Received: from localhost ([127.0.0.1]:56798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFRUM-00050x-7c for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Apr 2019 18:51:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFRUG-00050l-0U for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2019 18:51:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFRUE-0005Yj-Pj for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2019 18:51:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45857) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hFRUE-0005Ye-J0 for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2019 18:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hFRUE-0004tj-GR for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2019 18:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Gramiak Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Apr 2019 22:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35204 X-GNU-PR-Package: emacs Original-Received: via spool by 35204-submit@debbugs.gnu.org id=B35204.155519584718807 (code B ref 35204); Sat, 13 Apr 2019 22:51:02 +0000 Original-Received: (at 35204) by debbugs.gnu.org; 13 Apr 2019 22:50:47 +0000 Original-Received: from localhost ([127.0.0.1]:59401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hFRTy-0004tH-SW for submit@debbugs.gnu.org; Sat, 13 Apr 2019 18:50:47 -0400 Original-Received: from mail-pf1-f169.google.com ([209.85.210.169]:35508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hFRTx-0004t4-4z for 35204@debbugs.gnu.org; Sat, 13 Apr 2019 18:50:45 -0400 Original-Received: by mail-pf1-f169.google.com with SMTP id t21so6812968pfh.2 for <35204@debbugs.gnu.org>; Sat, 13 Apr 2019 15:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=U1wCbpeXQu6RisbTsCOAJBzXdRsOxJt241PLJU2ekrc=; b=WI1VbyelUMqBvJjvOMbxJf5NwZSqKp6T6Vc8c2gjN4bLq/0L4FP43fxGdRodzaYZWz IlG15v7WWeFfimURnCUgo+mtW/qW39vIDiGi0AStj40q8an1NGsCjnrmP2g2sei7dogd 63f2rBbg0AO+Sn+IHvmpiOhXJxtqA3Q3za5e4gcEQL9LaCwt2xoUq1PobB3pVTw8X4IW M1JLA4ytPZ7Zxf9UVuCT2wPO6v6Kf9mb83OWUiDtbzif/YJ3KeUK38/DIQEuMj0rV276 BrWZ9rk1Gj/lu8I+a6I4yhF5H+av5m5BSSI6b3uTO5klmFS7Hau5hpEbIYGBFJdpP2hF uSjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=U1wCbpeXQu6RisbTsCOAJBzXdRsOxJt241PLJU2ekrc=; b=q5nBmsTfxehKpmO1MFzJjFxOfE0IqhTV7Iqd6/ufQWDtO4eU/f1tvZ+79K3WRGyM2u 28PNmpgzRmchB4VU0Ifx26lv+kT/yN5zFVlsoHsUkJVen/su3cNeEpzx7zvWlCF2SBmx wN72hGcUBW+NgeGaIT9FzvkRR4Vv8oM4QmiCTUla7tNlTqg5go9lyxGO40Nwc5ytZddE T9XlwXplhCO5G4xOR9mEvvPnUP7thgA1+nM/IEdfoMErPODrF+X9kMPTrebbGZ3gUKYZ xSrrksCgVzmYnZqVjlQ9bCj2Rz46rncnaCRn7KWIvwFb2d/ZCMbVyjEB1ZdZJkciljgO IpvA== X-Gm-Message-State: APjAAAXbutHTmkZUl7Dbqdt/JR12merxX1yv1dNzikr0s9Zz+Uw9Vpmo /j9uBCqAJDaPWIRBgsCwzy/Td1H9 X-Google-Smtp-Source: APXvYqzBYJj0xk8huYKd+86/7ooUtltDJwyjm3LIOmY1yjDKo/7AYlSTbT7kqnW18p3LRHDyjldR0g== X-Received: by 2002:a63:78ce:: with SMTP id t197mr62038167pgc.314.1555195839013; Sat, 13 Apr 2019 15:50:39 -0700 (PDT) Original-Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302]) by smtp.gmail.com with ESMTPSA id w23sm57555747pgj.72.2019.04.13.15.50.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 13 Apr 2019 15:50:38 -0700 (PDT) In-Reply-To: <87r2a5fsoq.fsf@tcd.ie> (Basil L. Contovounesios's message of "Sat, 13 Apr 2019 23:26:13 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:157603 Archived-At: "Basil L. Contovounesios" writes: > Eli Zaretskii writes: > >>> From: Ken Brown >>> CC: "35204@debbugs.gnu.org" <35204@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.