GNU bug report logs - #18573
24.3.93; set-face-attribute crashes Emacs on OS X 10.9.4

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: "enquiries@HIDDEN" <enquiries@HIDDEN>; dated Sat, 27 Sep 2014 16:47:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Severity set to 'normal' from 'important' Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 18573 <at> debbugs.gnu.org:


Received: (at 18573) by debbugs.gnu.org; 1 Oct 2014 18:16:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 01 14:16:42 2014
Received: from localhost ([127.0.0.1]:57667 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XZOS9-0007qY-Jd
	for submit <at> debbugs.gnu.org; Wed, 01 Oct 2014 14:16:41 -0400
Received: from mtaout22.012.net.il ([80.179.55.172]:60692)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1XZOS6-0007qN-0w
 for 18573 <at> debbugs.gnu.org; Wed, 01 Oct 2014 14:16:39 -0400
Received: from conversion-daemon.a-mtaout22.012.net.il by
 a-mtaout22.012.net.il (HyperSendmail v2007.08) id
 <0NCS00E002NVRF00@HIDDEN> for 18573 <at> debbugs.gnu.org;
 Wed, 01 Oct 2014 21:16:36 +0300 (IDT)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0NCS00EEO2ROH660@HIDDEN>;
 Wed, 01 Oct 2014 21:16:36 +0300 (IDT)
Date: Wed, 01 Oct 2014 21:16:33 +0300
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#18573: 24.3.93;
 set-face-attribute crashes Emacs when started with -nw
In-reply-to: <59B4B4EE-8CC0-49BF-A32B-D062EFEB353E@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Jan =?iso-8859-1?Q?Dj=E4rv?= <jan.h.d@HIDDEN>
Message-id: <8361g3k64e.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 8BIT
References: <5426E238.6060301@HIDDEN>
 <5CAB16D6-ECC8-4D23-A0E2-FCEADF48C1B0@HIDDEN> <8361g6mjl8.fsf@HIDDEN>
 <DAA564B7-9D0C-4FCC-8CE2-6B77D2BDEF31@HIDDEN> <838ukzk7dj.fsf@HIDDEN>
 <59B4B4EE-8CC0-49BF-A32B-D062EFEB353E@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 18573
Cc: enquiries@HIDDEN, 18573 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

> From: Jan Djrv <jan.h.d@HIDDEN>
> Date: Wed, 1 Oct 2014 20:11:34 +0200
> Cc: enquiries@HIDDEN,
>  18573 <at> debbugs.gnu.org
> 
> 
> 1 okt 2014 kl. 19:49 skrev Eli Zaretskii <eliz@HIDDEN>:
> 
> > If the frame argument is t, we could try looking for a GUI frame; that
> > way, we would signal an error in fewer cases.  After all, using the
> > selected frame is arbitrary.
> > 
> > At the very least, I think we should have a FIXME comment there
> > describing the problem.
> 
> I added a comment.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18573; Package emacs. Full text available.

Message received at 18573 <at> debbugs.gnu.org:


Received: (at 18573) by debbugs.gnu.org; 1 Oct 2014 18:11:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 01 14:11:41 2014
Received: from localhost ([127.0.0.1]:57659 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XZONJ-0007hy-1b
	for submit <at> debbugs.gnu.org; Wed, 01 Oct 2014 14:11:41 -0400
Received: from mailfe08.swip.net ([212.247.154.225]:59973 helo=swip.net)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <jan.h.d@HIDDEN>) id 1XZONF-0007ho-CI
 for 18573 <at> debbugs.gnu.org; Wed, 01 Oct 2014 14:11:38 -0400
X-T2-Spam-Status: No, hits=0.8 required=5.0 tests=BAYES_50
Received: from hosdjarv.se (account mj138573@HIDDEN [46.59.42.57] verified)
 by mailfe08.swip.net (CommuniGate Pro SMTP 5.4.4)
 with ESMTPA id 537678858; Wed, 01 Oct 2014 20:11:35 +0200
Content-Type: text/plain; charset=iso-8859-1
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
Subject: Re: bug#18573: 24.3.93;
 set-face-attribute crashes Emacs when started with -nw
From: =?iso-8859-1?Q?Jan_Dj=E4rv?= <jan.h.d@HIDDEN>
In-Reply-To: <838ukzk7dj.fsf@HIDDEN>
Date: Wed, 1 Oct 2014 20:11:34 +0200
Content-Transfer-Encoding: 7bit
Message-Id: <59B4B4EE-8CC0-49BF-A32B-D062EFEB353E@HIDDEN>
References: <5426E238.6060301@HIDDEN>
 <5CAB16D6-ECC8-4D23-A0E2-FCEADF48C1B0@HIDDEN> <8361g6mjl8.fsf@HIDDEN>
 <DAA564B7-9D0C-4FCC-8CE2-6B77D2BDEF31@HIDDEN> <838ukzk7dj.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.1878.6)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 18573
Cc: enquiries@HIDDEN, 18573 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)


1 okt 2014 kl. 19:49 skrev Eli Zaretskii <eliz@HIDDEN>:

> If the frame argument is t, we could try looking for a GUI frame; that
> way, we would signal an error in fewer cases.  After all, using the
> selected frame is arbitrary.
> 
> At the very least, I think we should have a FIXME comment there
> describing the problem.

I added a comment.

	Jan D.






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18573; Package emacs. Full text available.

Message received at 18573 <at> debbugs.gnu.org:


Received: (at 18573) by debbugs.gnu.org; 1 Oct 2014 17:55:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 01 13:55:12 2014
Received: from localhost ([127.0.0.1]:57651 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XZO7L-0007KB-LO
	for submit <at> debbugs.gnu.org; Wed, 01 Oct 2014 13:55:11 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.181]:16482)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1XZO7J-0007K2-3Y
 for 18573 <at> debbugs.gnu.org; Wed, 01 Oct 2014 13:55:09 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ArYGAIDvNVNFxKjo/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCw4mEhQYDSSIBAjSGReOegeEOAEDqRmBaoNMIQ
X-IPAS-Result: ArYGAIDvNVNFxKjo/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCw4mEhQYDSSIBAjSGReOegeEOAEDqRmBaoNMIQ
X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="91432367"
Received: from 69-196-168-232.dsl.teksavvy.com (HELO pastel.home)
 ([69.196.168.232])
 by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA;
 01 Oct 2014 13:55:08 -0400
Received: by pastel.home (Postfix, from userid 20848)
 id 324E24821; Wed,  1 Oct 2014 13:55:08 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Glenn Morris <rgm@HIDDEN>
Subject: Re: bug#18573: 24.3.93;
 set-face-attribute crashes Emacs when started with -nw
Message-ID: <jwvtx3nwu8t.fsf-monnier+emacsbugs@HIDDEN>
References: <5426E238.6060301@HIDDEN>
 <5CAB16D6-ECC8-4D23-A0E2-FCEADF48C1B0@HIDDEN>
 <5427FDF5.6040908@HIDDEN> <pra95fvipn.fsf@HIDDEN>
Date: Wed, 01 Oct 2014 13:55:08 -0400
In-Reply-To: <pra95fvipn.fsf@HIDDEN> (Glenn Morris's message of
 "Wed, 01 Oct 2014 12:49:08 -0400")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 18573
Cc: Jan =?windows-1252?Q?Dj=E4rv?= <jan.h.d@HIDDEN>,
 "enquiries@HIDDEN" <enquiries@HIDDEN>, 18573 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

>> I have tried with GNU Emacs 24.3.1 (x86_64-apple-darwin, NS
>> apple-appkit-1038.36) of 2013-03-13 on bob.porkrind.org, from
>> emacsformacosx.com, and Emacs does not crash.
> So should this be fixed in emacs-24,

Yes.

> and should the pretest wait for it?

Depends if there's an easy quick fix.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18573; Package emacs. Full text available.

Message received at 18573 <at> debbugs.gnu.org:


Received: (at 18573) by debbugs.gnu.org; 1 Oct 2014 17:49:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 01 13:49:37 2014
Received: from localhost ([127.0.0.1]:57643 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XZO1w-0007C3-VW
	for submit <at> debbugs.gnu.org; Wed, 01 Oct 2014 13:49:37 -0400
Received: from mtaout23.012.net.il ([80.179.55.175]:38653)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1XZO1u-0007Br-28
 for 18573 <at> debbugs.gnu.org; Wed, 01 Oct 2014 13:49:35 -0400
Received: from conversion-daemon.a-mtaout23.012.net.il by
 a-mtaout23.012.net.il (HyperSendmail v2007.08) id
 <0NCS002001IBLM00@HIDDEN> for 18573 <at> debbugs.gnu.org;
 Wed, 01 Oct 2014 20:49:32 +0300 (IDT)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0NCS002JQ1IJFJA0@HIDDEN>;
 Wed, 01 Oct 2014 20:49:32 +0300 (IDT)
Date: Wed, 01 Oct 2014 20:49:28 +0300
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#18573: 24.3.93;
 set-face-attribute crashes Emacs when started with -nw
In-reply-to: <DAA564B7-9D0C-4FCC-8CE2-6B77D2BDEF31@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Jan =?iso-8859-1?Q?Dj=E4rv?= <jan.h.d@HIDDEN>
Message-id: <838ukzk7dj.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 8BIT
References: <5426E238.6060301@HIDDEN>
 <5CAB16D6-ECC8-4D23-A0E2-FCEADF48C1B0@HIDDEN> <8361g6mjl8.fsf@HIDDEN>
 <DAA564B7-9D0C-4FCC-8CE2-6B77D2BDEF31@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 18573
Cc: enquiries@HIDDEN, 18573 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

> From: Jan Djrv <jan.h.d@HIDDEN>
> Date: Wed, 1 Oct 2014 19:43:11 +0200
> Cc: enquiries@HIDDEN,
>  18573 <at> debbugs.gnu.org
> 
> > But if this doesn't work, then what are our alternatives?  We could
> > loop over all the frames looking for a GUI frame, and use that.  But
> > what if there's no such frame?  Signal an error?
> 
> There is a fundamental error here.  Emacs allows specifying face attributes for future GUI frames when only non-GUI frames exists.  But those attributes requires GUI frames to be realized.
> We are missing a "lazy" realization that only saves the text version of the attribute and realizes only when an apropriate frame is available.
> 
> For now I comitted the "wont crash" solution (don't execute the code for tty frames) in the emacs 24 branch.  No error is signalled and no looping is done to find a GUI frame.  I'm not sure if we should do that.

If the frame argument is t, we could try looking for a GUI frame; that
way, we would signal an error in fewer cases.  After all, using the
selected frame is arbitrary.

At the very least, I think we should have a FIXME comment there
describing the problem.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18573; Package emacs. Full text available.

Message received at 18573 <at> debbugs.gnu.org:


Received: (at 18573) by debbugs.gnu.org; 1 Oct 2014 17:43:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 01 13:43:18 2014
Received: from localhost ([127.0.0.1]:57639 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XZNvp-00072t-Md
	for submit <at> debbugs.gnu.org; Wed, 01 Oct 2014 13:43:18 -0400
Received: from mailfe06.swip.net ([212.247.154.161]:53483 helo=swip.net)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <jan.h.d@HIDDEN>) id 1XZNvm-00072j-Ux
 for 18573 <at> debbugs.gnu.org; Wed, 01 Oct 2014 13:43:16 -0400
X-T2-Spam-Status: No, hits=-0.0 required=5.0 tests=BAYES_20
Received: from hosdjarv.se (account mj138573@HIDDEN [46.59.42.57] verified)
 by mailfe06.swip.net (CommuniGate Pro SMTP 5.4.4)
 with ESMTPA id 534091946; Wed, 01 Oct 2014 19:43:12 +0200
Content-Type: text/plain; charset=iso-8859-1
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
Subject: Re: bug#18573: 24.3.93;
 set-face-attribute crashes Emacs when started with -nw
From: =?iso-8859-1?Q?Jan_Dj=E4rv?= <jan.h.d@HIDDEN>
In-Reply-To: <8361g6mjl8.fsf@HIDDEN>
Date: Wed, 1 Oct 2014 19:43:11 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <DAA564B7-9D0C-4FCC-8CE2-6B77D2BDEF31@HIDDEN>
References: <5426E238.6060301@HIDDEN>
 <5CAB16D6-ECC8-4D23-A0E2-FCEADF48C1B0@HIDDEN> <8361g6mjl8.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.1878.6)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 18573
Cc: enquiries@HIDDEN, 18573 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hi.

29 sep 2014 kl. 19:18 skrev Eli Zaretskii <eliz@HIDDEN>:

>> From: Jan Dj=E4rv <jan.h.d@HIDDEN>
>> Date: Sun, 28 Sep 2014 10:44:15 +0200
>> Cc: 18573 <at> debbugs.gnu.org
>>=20
>> This seems to be a generic error in xfaces.c.  It tries to load a =
font without checking the type
>> of frame.  The type is tty, but it tries to load a font anyway, and =
eventually ends up in (font.c) font_pixel_size, which does:
>>=20
>> #define FRAME_RES_Y(f)						=
\
>>  (eassert (FRAME_WINDOW_P (f)), FRAME_DISPLAY_INFO (f)->resy)
>>=20
>> Now, FRAME_DISPLAY_INFO for a NS compiled Emacs is
>>=20
>> #define FRAME_DISPLAY_INFO(f) ((f)->output_data.ns->display_info)
>>=20
>> but the frame is not an NS frame, it is a tty frame, so bad things =
happen.
>> It is the same for X, but there it just happens to return a nonsense =
value, so the code continues without crashing, and eventually discovers =
that there are no font dirvers and the load font fails.
>>=20
>> The code is in xfaces.c, Finternal_set_lisp_face_attribute, around =
line 3120 where it calls
>> font_load_for_lface.
>>=20
>> The code in question is not called if compiled for a tty (#ifdef:ed =
out), but it is called when the frame is a tty frame on a non-tty =
compiled Emacs.
>>=20
>> I think these cases should be the same, i.e. font_load_for_lface not =
called for tty frames.
>=20
> I believe this happens when internal-set-lisp-face-attribute is
> called with its FRAME argument t, meaning change the default for new
> (i.e. future) frames.  Since the code needs a frame, it just uses the
> selected frame, which in this case happens to be a TTY frame.
>=20
> Is that description correct?

Yes.

>=20
> If so, the question is how to fix this.  If we simply do nothing when
> the selected frame is a TTY frame, and then create a GUI frame at some
> future point, will the new default take effect?  If it will, then I
> agree that the code under this condition
>=20
> 	      if (! FONT_OBJECT_P (value))
>=20
> should not be executed when the selected frame is a TTY frame.

If this code is not run for the initial tty frame, then a GUI frame made =
later with make-frame-on-display does not get this font.  The face is =
not changed for future frames.

>=20
> But if this doesn't work, then what are our alternatives?  We could
> loop over all the frames looking for a GUI frame, and use that.  But
> what if there's no such frame?  Signal an error?

There is a fundamental error here.  Emacs allows specifying face =
attributes for future GUI frames when only non-GUI frames exists.  But =
those attributes requires GUI frames to be realized.
We are missing a "lazy" realization that only saves the text version of =
the attribute and realizes only when an apropriate frame is available.

For now I comitted the "wont crash" solution (don't execute the code for =
tty frames) in the emacs 24 branch.  No error is signalled and no =
looping is done to find a GUI frame.  I'm not sure if we should do that.

	Jan D.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18573; Package emacs. Full text available.

Message received at 18573 <at> debbugs.gnu.org:


Received: (at 18573) by debbugs.gnu.org; 1 Oct 2014 16:49:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 01 12:49:11 2014
Received: from localhost ([127.0.0.1]:57603 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XZN5S-0004Sd-Tm
	for submit <at> debbugs.gnu.org; Wed, 01 Oct 2014 12:49:11 -0400
Received: from fencepost.gnu.org ([208.118.235.10]:33497)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rgm@HIDDEN>) id 1XZN5R-0004SW-8h
 for 18573 <at> debbugs.gnu.org; Wed, 01 Oct 2014 12:49:09 -0400
Received: from rgm by fencepost.gnu.org with local (Exim 4.71)
 (envelope-from <rgm@HIDDEN>)
 id 1XZN5Q-00040N-6b; Wed, 01 Oct 2014 12:49:08 -0400
From: Glenn Morris <rgm@HIDDEN>
To: Jan =?utf-8?Q?Dj=C3=A4rv?= <jan.h.d@HIDDEN>,  18573 <at> debbugs.gnu.org
Subject: Re: bug#18573: 24.3.93;
 set-face-attribute crashes Emacs when started with -nw
References: <5426E238.6060301@HIDDEN>
 <5CAB16D6-ECC8-4D23-A0E2-FCEADF48C1B0@HIDDEN>
 <5427FDF5.6040908@HIDDEN>
X-Spook: Marxist Saudi Arabia Ft. Bragg CNCIS propaganda Operation
X-Ran: #A"1Sq4hD>s8gBA42/g%P}qD^l<?=Gt"0:P45ex>l*1-+-/'?7^p\za.EW`$9j?f2MHctZ
X-Hue: cyan
X-Attribution: GM
Date: Wed, 01 Oct 2014 12:49:08 -0400
In-Reply-To: <5427FDF5.6040908@HIDDEN> (enquiries@HIDDEN's message of "Sun, 28
 Sep 2014 14:24:21 +0200")
Message-ID: <pra95fvipn.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Score: -5.6 (-----)
X-Debbugs-Envelope-To: 18573
Cc: "enquiries@HIDDEN" <enquiries@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.6 (-----)

"enquiries@HIDDEN" wrote:

> I have tried with GNU Emacs 24.3.1 (x86_64-apple-darwin, NS
> apple-appkit-1038.36) of 2013-03-13 on bob.porkrind.org, from
> emacsformacosx.com, and Emacs does not crash.

So should this be fixed in emacs-24, and should the pretest wait for it?





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18573; Package emacs. Full text available.

Message received at 18573 <at> debbugs.gnu.org:


Received: (at 18573) by debbugs.gnu.org; 29 Sep 2014 17:34:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 29 13:34:13 2014
Received: from localhost ([127.0.0.1]:55589 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XYepw-0003kP-KB
	for submit <at> debbugs.gnu.org; Mon, 29 Sep 2014 13:34:13 -0400
Received: from mail.forumcivico.org ([176.58.106.92]:38383)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <enquiries@HIDDEN>) id 1XYeps-0003kF-MI
 for 18573 <at> debbugs.gnu.org; Mon, 29 Sep 2014 13:34:09 -0400
Received: from dummy.name; Mon, 29 Sep 2014 19:34:07 +0200
Message-ID: <5429980C.20805@HIDDEN>
Date: Mon, 29 Sep 2014 19:34:04 +0200
From: "enquiries@HIDDEN" <enquiries@HIDDEN>
MIME-Version: 1.0
To: Eli Zaretskii <eliz@HIDDEN>, =?UTF-8?B?SmFuIERqw6Rydg==?=
 <jan.h.d@HIDDEN>
Subject: Re: bug#18573: 24.3.93; set-face-attribute crashes Emacs when started
 with -nw
References: <5426E238.6060301@HIDDEN>
 <5CAB16D6-ECC8-4D23-A0E2-FCEADF48C1B0@HIDDEN> <8361g6mjl8.fsf@HIDDEN>
In-Reply-To: <8361g6mjl8.fsf@HIDDEN>
X-TagToolbar-Keys: D20140929193404632
X-Mailer: CommuniGate Pro WebUser v5.4.8
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 18573
Cc: 18573 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

On 29/09/2014 19:18, Eli Zaretskii wrote:
>> From: Jan Djärv <jan.h.d@HIDDEN>
>> Date: Sun, 28 Sep 2014 10:44:15 +0200
>> Cc: 18573 <at> debbugs.gnu.org
>>
>> This seems to be a generic error in xfaces.c.  It tries to load a font without checking the type
>> of frame.  The type is tty, but it tries to load a font anyway, and eventually ends up in (font.c) font_pixel_size, which does:
>>
>> #define FRAME_RES_Y(f)						\
>>    (eassert (FRAME_WINDOW_P (f)), FRAME_DISPLAY_INFO (f)->resy)
>>
>> Now, FRAME_DISPLAY_INFO for a NS compiled Emacs is
>>
>> #define FRAME_DISPLAY_INFO(f) ((f)->output_data.ns->display_info)
>>
>> but the frame is not an NS frame, it is a tty frame, so bad things happen.
>> It is the same for X, but there it just happens to return a nonsense value, so the code continues without crashing, and eventually discovers that there are no font dirvers and the load font fails.
>>
>> The code is in xfaces.c, Finternal_set_lisp_face_attribute, around line 3120 where it calls
>> font_load_for_lface.
>>
>> The code in question is not called if compiled for a tty (#ifdef:ed out), but it is called when the frame is a tty frame on a non-tty compiled Emacs.
>>
>> I think these cases should be the same, i.e. font_load_for_lface not called for tty frames.
>
> I believe this happens when internal-set-lisp-face-attribute is
> called with its FRAME argument t, meaning change the default for new
> (i.e. future) frames.  Since the code needs a frame, it just uses the
> selected frame, which in this case happens to be a TTY frame.
>
> Is that description correct?
>
> If so, the question is how to fix this.  If we simply do nothing when
> the selected frame is a TTY frame, and then create a GUI frame at some
> future point, will the new default take effect?  If it will, then I
> agree that the code under this condition
>
> 	      if (! FONT_OBJECT_P (value))
>
> should not be executed when the selected frame is a TTY frame.
>
> But if this doesn't work, then what are our alternatives?  We could
> loop over all the frames looking for a GUI frame, and use that.  But
> what if there's no such frame?  Signal an error?
>



That description sounds correct to me, although I have no knowledge of 
the innards of Emacs.

Signalling an error would be better than crashing of course. Still, the 
crash is not happening with prior version (GNU Emacs 24.3.1).

Sam




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18573; Package emacs. Full text available.

Message received at 18573 <at> debbugs.gnu.org:


Received: (at 18573) by debbugs.gnu.org; 29 Sep 2014 17:18:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 29 13:18:25 2014
Received: from localhost ([127.0.0.1]:55584 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XYeae-0003ML-RJ
	for submit <at> debbugs.gnu.org; Mon, 29 Sep 2014 13:18:25 -0400
Received: from mtaout28.012.net.il ([80.179.55.184]:40045)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1XYeac-0003MB-3P
 for 18573 <at> debbugs.gnu.org; Mon, 29 Sep 2014 13:18:23 -0400
Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il
 (HyperSendmail v2007.08) id <0NCO00600A7YJ900@HIDDEN> for
 18573 <at> debbugs.gnu.org; Mon, 29 Sep 2014 20:17:13 +0300 (IDT)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0NCO00NTKAOP6H90@HIDDEN>; Mon, 29 Sep 2014 20:17:13 +0300 (IDT)
Date: Mon, 29 Sep 2014 20:18:11 +0300
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#18573: 24.3.93;
 set-face-attribute crashes Emacs when started with -nw
In-reply-to: <5CAB16D6-ECC8-4D23-A0E2-FCEADF48C1B0@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Jan =?utf-8?Q?Dj=C3=A4rv?= <jan.h.d@HIDDEN>
Message-id: <8361g6mjl8.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-transfer-encoding: 8BIT
References: <5426E238.6060301@HIDDEN>
 <5CAB16D6-ECC8-4D23-A0E2-FCEADF48C1B0@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 18573
Cc: enquiries@HIDDEN, 18573 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

> From: Jan Djärv <jan.h.d@HIDDEN>
> Date: Sun, 28 Sep 2014 10:44:15 +0200
> Cc: 18573 <at> debbugs.gnu.org
> 
> This seems to be a generic error in xfaces.c.  It tries to load a font without checking the type
> of frame.  The type is tty, but it tries to load a font anyway, and eventually ends up in (font.c) font_pixel_size, which does:
> 
> #define FRAME_RES_Y(f)						\
>   (eassert (FRAME_WINDOW_P (f)), FRAME_DISPLAY_INFO (f)->resy)
> 
> Now, FRAME_DISPLAY_INFO for a NS compiled Emacs is
> 
> #define FRAME_DISPLAY_INFO(f) ((f)->output_data.ns->display_info)
> 
> but the frame is not an NS frame, it is a tty frame, so bad things happen.
> It is the same for X, but there it just happens to return a nonsense value, so the code continues without crashing, and eventually discovers that there are no font dirvers and the load font fails.
> 
> The code is in xfaces.c, Finternal_set_lisp_face_attribute, around line 3120 where it calls
> font_load_for_lface.
> 
> The code in question is not called if compiled for a tty (#ifdef:ed out), but it is called when the frame is a tty frame on a non-tty compiled Emacs.
> 
> I think these cases should be the same, i.e. font_load_for_lface not called for tty frames.

I believe this happens when internal-set-lisp-face-attribute is
called with its FRAME argument t, meaning change the default for new
(i.e. future) frames.  Since the code needs a frame, it just uses the
selected frame, which in this case happens to be a TTY frame.

Is that description correct?

If so, the question is how to fix this.  If we simply do nothing when
the selected frame is a TTY frame, and then create a GUI frame at some
future point, will the new default take effect?  If it will, then I
agree that the code under this condition

	      if (! FONT_OBJECT_P (value))

should not be executed when the selected frame is a TTY frame.

But if this doesn't work, then what are our alternatives?  We could
loop over all the frames looking for a GUI frame, and use that.  But
what if there's no such frame?  Signal an error?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18573; Package emacs. Full text available.

Message received at 18573 <at> debbugs.gnu.org:


Received: (at 18573) by debbugs.gnu.org; 28 Sep 2014 12:24:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 28 08:24:31 2014
Received: from localhost ([127.0.0.1]:54149 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XYDWg-0001aN-KK
	for submit <at> debbugs.gnu.org; Sun, 28 Sep 2014 08:24:31 -0400
Received: from mail.forumcivico.org ([176.58.106.92]:51755)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <enquiries@HIDDEN>) id 1XYDWb-0001a9-Cz
 for 18573 <at> debbugs.gnu.org; Sun, 28 Sep 2014 08:24:29 -0400
Received: from dummy.name; Sun, 28 Sep 2014 14:24:24 +0200
Message-ID: <5427FDF5.6040908@HIDDEN>
Date: Sun, 28 Sep 2014 14:24:21 +0200
From: "enquiries@HIDDEN" <enquiries@HIDDEN>
MIME-Version: 1.0
To: =?UTF-8?B?SmFuIERqw6Rydg==?= <jan.h.d@HIDDEN>
Subject: Re: bug#18573: 24.3.93; set-face-attribute crashes Emacs when started
 with -nw
References: <5426E238.6060301@HIDDEN>
 <5CAB16D6-ECC8-4D23-A0E2-FCEADF48C1B0@HIDDEN>
In-Reply-To: <5CAB16D6-ECC8-4D23-A0E2-FCEADF48C1B0@HIDDEN>
X-TagToolbar-Keys: D20140928142421898
X-Mailer: CommuniGate Pro WebUser v5.4.8
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 18573
Cc: 18573 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

On 28/09/2014 10:44, Jan Djärv wrote:
> Hello.
>
> 27 sep 2014 kl. 18:13 skrev enquiries@HIDDEN:
>
>>
>> When launched via terminal (cli), Emacs crashes by just having this single line in init.el:
>>
>> (set-face-attribute 'default nil :font  "Menlo-16")
>>
>> Emacs does /not/ crash when launched from the Finder (same init.el)
>>
>
> This seems to be a generic error in xfaces.c.  It tries to load a font without checking the type
> of frame.  The type is tty, but it tries to load a font anyway, and eventually ends up in (font.c) font_pixel_size, which does:
>
> #define FRAME_RES_Y(f)						\
>    (eassert (FRAME_WINDOW_P (f)), FRAME_DISPLAY_INFO (f)->resy)
>
> Now, FRAME_DISPLAY_INFO for a NS compiled Emacs is
>
> #define FRAME_DISPLAY_INFO(f) ((f)->output_data.ns->display_info)
>
> but the frame is not an NS frame, it is a tty frame, so bad things happen.
> It is the same for X, but there it just happens to return a nonsense value, so the code continues without crashing, and eventually discovers that there are no font dirvers and the load font fails.
>
> The code is in xfaces.c, Finternal_set_lisp_face_attribute, around line 3120 where it calls
> font_load_for_lface.
>
> The code in question is not called if compiled for a tty (#ifdef:ed out), but it is called when the frame is a tty frame on a non-tty compiled Emacs.
>
> I think these cases should be the same, i.e. font_load_for_lface not called for tty frames.
>
> 	Jan D.


Hi,

Thank you, that sounds like the reason, although I am not fluent with C 
nor gdb to check and confirm it.

I can add that Emacs just crashes printing this error:

Fatal error 11: Segmentation fault[1] 51512 abort 
/Applications/Emacs.app/Contents/MacOS/Emacs -nw

Also, if that line is wrapped with condition-case err, like this:

(condition-case err (set-face-attribute 'default nil :font "Menlo-16") 
(error (message "Whoops!")))

I experience the same crash with same error message. No additional 
elisp-originating messages.


I have tried with GNU Emacs 24.3.1 (x86_64-apple-darwin, NS 
apple-appkit-1038.36) of 2013-03-13 on bob.porkrind.org, from 
emacsformacosx.com, and Emacs does not crash. So, it must be a bug in 
later versions.

I am of course aware that in any case Emacs will inherit whatever font 
and font size is specified in the terminal app (basically, that line is 
not meaningful in the cli).

Sam





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18573; Package emacs. Full text available.

Message received at 18573 <at> debbugs.gnu.org:


Received: (at 18573) by debbugs.gnu.org; 28 Sep 2014 08:44:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 28 04:44:23 2014
Received: from localhost ([127.0.0.1]:54067 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XYA5e-0003SM-9n
	for submit <at> debbugs.gnu.org; Sun, 28 Sep 2014 04:44:22 -0400
Received: from mailfe07.swip.net ([212.247.154.193]:42403 helo=swip.net)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <jan.h.d@HIDDEN>) id 1XYA5b-0003SC-6I
 for 18573 <at> debbugs.gnu.org; Sun, 28 Sep 2014 04:44:20 -0400
X-T2-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00
Received: from hosdjarv.se (account mj138573@HIDDEN [46.59.42.57] verified)
 by mailfe07.swip.net (CommuniGate Pro SMTP 5.4.4)
 with ESMTPA id 534894815; Sun, 28 Sep 2014 10:44:16 +0200
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
Subject: Re: bug#18573: 24.3.93;
 set-face-attribute crashes Emacs when started with -nw
From: =?iso-8859-1?Q?Jan_Dj=E4rv?= <jan.h.d@HIDDEN>
In-Reply-To: <5426E238.6060301@HIDDEN>
Date: Sun, 28 Sep 2014 10:44:15 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <5CAB16D6-ECC8-4D23-A0E2-FCEADF48C1B0@HIDDEN>
References: <5426E238.6060301@HIDDEN>
To: "enquiries@HIDDEN" <enquiries@HIDDEN>
X-Mailer: Apple Mail (2.1878.6)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 18573
Cc: 18573 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hello.

27 sep 2014 kl. 18:13 skrev enquiries@HIDDEN:

>=20
> When launched via terminal (cli), Emacs crashes by just having this =
single line in init.el:
>=20
> (set-face-attribute 'default nil :font  "Menlo-16")
>=20
> Emacs does /not/ crash when launched from the Finder (same init.el)
>=20

This seems to be a generic error in xfaces.c.  It tries to load a font =
without checking the type
of frame.  The type is tty, but it tries to load a font anyway, and =
eventually ends up in (font.c) font_pixel_size, which does:

#define FRAME_RES_Y(f)						\
  (eassert (FRAME_WINDOW_P (f)), FRAME_DISPLAY_INFO (f)->resy)

Now, FRAME_DISPLAY_INFO for a NS compiled Emacs is

#define FRAME_DISPLAY_INFO(f) ((f)->output_data.ns->display_info)

but the frame is not an NS frame, it is a tty frame, so bad things =
happen.
It is the same for X, but there it just happens to return a nonsense =
value, so the code continues without crashing, and eventually discovers =
that there are no font dirvers and the load font fails.

The code is in xfaces.c, Finternal_set_lisp_face_attribute, around line =
3120 where it calls
font_load_for_lface.

The code in question is not called if compiled for a tty (#ifdef:ed =
out), but it is called when the frame is a tty frame on a non-tty =
compiled Emacs.

I think these cases should be the same, i.e. font_load_for_lface not =
called for tty frames.

	Jan D.

> I am using GNU Emacs 24.3.93.1 (x86_64-apple-darwin13.3.0, NS =
apple-appkit-1265.21) of 2014-08-15 on builder10-9.porkrind.org on OS X =
10.9.4
>=20
>=20
> Sam Ask
>=20
>=20
>=20
>=20
>=20
> In GNU Emacs 24.3.93.1 (x86_64-apple-darwin13.3.0, NS =
apple-appkit-1265.21)
> of 2014-08-15 on builder10-9.porkrind.org
> Windowing system distributor `Apple', version 10.3.1265
> Configured using:
> `configure --with-ns'
>=20
> Important settings:
>  locale-coding-system: utf-8-unix
>=20
> Major mode: Fundamental
>=20
> Minor modes in effect:
>  tooltip-mode: t
>  electric-indent-mode: t
>  mouse-wheel-mode: t
>  tool-bar-mode: t
>  menu-bar-mode: t
>  file-name-shadow-mode: t
>  global-font-lock-mode: t
>  blink-cursor-mode: t
>  auto-composition-mode: t
>  auto-encryption-mode: t
>  auto-compression-mode: t
>  buffer-read-only: t
>  line-number-mode: t
>  transient-mark-mode: t
>=20
> Recent input:
> M-x e m a c s b u <tab> <backspace> <backspace> - b
> u g - r e p o r t <return> <backspace> <backspace>
> <backspace> <backspace> <backspace> <backspace> <backspace>
> <backspace> <backspace> <backspace> <backspace> <backspace>
> <backspace> <backspace> <backspace> <backspace> r e
> p o r t <tab> <return>
>=20
> Recent messages:
> Loading /Users/sam/.emacs.d/init.el (source)...done
> For information about GNU Emacs and the GNU system, type C-h C-a.
> delete-backward-char: Text is read-only
>=20
> Load-path shadows:
> None found.
>=20
> Features:
> (shadow sort gnus-util mail-extr emacsbug message cl-macs format-spec
> rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse
> rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
> ietf-drums mm-util help-fns mail-prsvr mail-utils cl gv cl-loaddefs
> cl-lib time-date tooltip electric uniquify ediff-hook vc-hooks
> lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt
> fringe tabulated-list newcomment lisp-mode prog-mode register page
> menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
> syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
> vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
> romanian slovak czech european ethiopic indian cyrillic chinese
> case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer =
nadvice
> loaddefs button faces cus-face macroexp files text-properties overlay
> sha1 md5 base64 format env code-pages mule custom widget
> hashtable-print-readable backquote make-network-process cocoa ns
> multi-tty emacs)
>=20
> Memory information:
> ((conses 16 75113 4885)
> (symbols 48 17760 0)
> (miscs 40 78 113)
> (strings 32 10523 3551)
> (string-bytes 1 303408)
> (vectors 16 9703)
> (vector-slots 8 378700 13839)
> (floats 8 53 97)
> (intervals 56 214 0)
> (buffers 960 12))
>=20
>=20





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18573; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 27 Sep 2014 16:46:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 27 12:46:59 2014
Received: from localhost ([127.0.0.1]:53862 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XXv97-0004Hi-LI
	for submit <at> debbugs.gnu.org; Sat, 27 Sep 2014 12:46:58 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33393)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <enquiries@HIDDEN>) id 1XXudw-0003SK-Lu
 for submit <at> debbugs.gnu.org; Sat, 27 Sep 2014 12:14:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <enquiries@HIDDEN>) id 1XXudq-0001M0-NI
 for submit <at> debbugs.gnu.org; Sat, 27 Sep 2014 12:14:44 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: *
X-Spam-Status: No, score=1.8 required=5.0 tests=AC_HTML_NONSENSE_TAGS, BAYES_50,
 UNPARSEABLE_RELAY autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:45381)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <enquiries@HIDDEN>) id 1XXudq-0001LK-K9
 for submit <at> debbugs.gnu.org; Sat, 27 Sep 2014 12:14:38 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:35074)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <enquiries@HIDDEN>) id 1XXudg-0007Ih-Ol
 for bug-gnu-emacs@HIDDEN; Sat, 27 Sep 2014 12:14:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <enquiries@HIDDEN>) id 1XXudb-0001JP-US
 for bug-gnu-emacs@HIDDEN; Sat, 27 Sep 2014 12:14:28 -0400
Received: from mail.forumcivico.org ([176.58.106.92]:44260)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <enquiries@HIDDEN>) id 1XXudb-0001G0-Ny
 for bug-gnu-emacs@HIDDEN; Sat, 27 Sep 2014 12:14:23 -0400
Received: from dummy.name; Sat, 27 Sep 2014 18:13:46 +0200
Message-ID: <5426E238.6060301@HIDDEN>
Date: Sat, 27 Sep 2014 18:13:44 +0200
From: "enquiries@HIDDEN" <enquiries@HIDDEN>
MIME-Version: 1.0
To: bug-gnu-emacs@HIDDEN
Subject: 24.3.93; set-face-attribute crashes Emacs on OS X 10.9.4
X-Mailer: CommuniGate Pro WebUser v5.4.8
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -3.0 (---)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sat, 27 Sep 2014 12:46:55 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.0 (---)


When launched via terminal (cli), Emacs crashes by just having this 
single line in init.el:

(set-face-attribute 'default nil :font  "Menlo-16")

Emacs does /not/ crash when launched from the Finder (same init.el)


I am using GNU Emacs 24.3.93.1 (x86_64-apple-darwin13.3.0, NS 
apple-appkit-1265.21) of 2014-08-15 on builder10-9.porkrind.org on OS X 
10.9.4


Sam Ask





In GNU Emacs 24.3.93.1 (x86_64-apple-darwin13.3.0, NS apple-appkit-1265.21)
  of 2014-08-15 on builder10-9.porkrind.org
Windowing system distributor `Apple', version 10.3.1265
Configured using:
  `configure --with-ns'

Important settings:
   locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
   tooltip-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   blink-cursor-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   buffer-read-only: t
   line-number-mode: t
   transient-mark-mode: t

Recent input:
M-x e m a c s b u <tab> <backspace> <backspace> - b
u g - r e p o r t <return> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> r e
p o r t <tab> <return>

Recent messages:
Loading /Users/sam/.emacs.d/init.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
delete-backward-char: Text is read-only

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message cl-macs format-spec
rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util help-fns mail-prsvr mail-utils cl gv cl-loaddefs
cl-lib time-date tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process cocoa ns
multi-tty emacs)

Memory information:
((conses 16 75113 4885)
  (symbols 48 17760 0)
  (miscs 40 78 113)
  (strings 32 10523 3551)
  (string-bytes 1 303408)
  (vectors 16 9703)
  (vector-slots 8 378700 13839)
  (floats 8 53 97)
  (intervals 56 214 0)
  (buffers 960 12))




Acknowledgement sent to "enquiries@HIDDEN" <enquiries@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#18573; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

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