From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: BT Templeton Newsgroups: gmane.emacs.bugs Subject: bug#11853: Emacs.app font initialization segfault Date: Wed, 04 Jul 2012 01:00:33 -0400 Message-ID: <87hatonmry.fsf@olor.terpri.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1341378086 1786 80.91.229.3 (4 Jul 2012 05:01:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 4 Jul 2012 05:01:26 +0000 (UTC) To: 11853@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 04 07:01:25 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SmHiO-0006N4-5g for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Jul 2012 07:01:24 +0200 Original-Received: from localhost ([::1]:40300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmHiN-0001Mv-3e for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Jul 2012 01:01:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmHiK-0001Mm-BK for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 01:01:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmHiI-00071r-Ap for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 01:01:19 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmHiI-00071g-7V for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 01:01:18 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SmHms-0007jd-CQ for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 01:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: BT Templeton Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Jul 2012 05:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11853 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.134137834829707 (code B ref -1); Wed, 04 Jul 2012 05:06:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Jul 2012 05:05:48 +0000 Original-Received: from localhost ([127.0.0.1]:46703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SmHmd-0007j5-0U for submit@debbugs.gnu.org; Wed, 04 Jul 2012 01:05:47 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50608) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SmHmY-0007iw-7P for submit@debbugs.gnu.org; Wed, 04 Jul 2012 01:05:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmHhv-000700-EJ for submit@debbugs.gnu.org; Wed, 04 Jul 2012 01:00:56 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:49872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmHhv-0006zw-B9 for submit@debbugs.gnu.org; Wed, 04 Jul 2012 01:00:55 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmHht-0001M7-Ab for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 01:00:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmHhp-0006yS-Vy for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 01:00:52 -0400 Original-Received: from deleuze.hcoop.net ([69.90.123.67]:58169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmHhp-0006wt-RN for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 01:00:49 -0400 Original-Received: from cpe-071-070-253-241.nc.res.rr.com ([71.70.253.241] helo=olor.terpri.org) by deleuze.hcoop.net with esmtpsa (TLS-1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.63) (envelope-from ) id 1SmHhi-0000zz-LH for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 01:00:42 -0400 Original-Received: from localhost ([::1] helo=olor.terpri.org) by olor.terpri.org with esmtp (Exim 4.80) (envelope-from ) id 1SmHhZ-0007oP-7d for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 01:00:33 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61559 Archived-At: When built under GNUstep, Emacs.app crashes while creating the initial frame: --8<---------------cut here---------------start------------->8--- Program received signal SIGSEGV, Segmentation fault. ns_charset_covers (pct=, set2=0x1db24d8, set1=) at nsfont.m:279 279 off++; (gdb) bt #0 ns_charset_covers (pct=, set2=0x1db24d8, set1=) at nsfont.m:279 #1 ns_get_covering_families (script=0x1c83c38, pct=) at nsfont.m:470 #2 ns_findfonts (font_spec=15502181, isMatch=0 '\000') at nsfont.m:514 #3 0x00000000005f1c6c in font_list_entities (frame=21141749, spec=21133645) at font.c:2754 #4 0x00000000005f3acb in font_find_for_lface (f=0x14298f0, attrs=0x7fffffffb2e0, spec=21129941, c=-1) at font.c:3225 #5 0x00000000005f3e3d in font_load_for_lface (f=0x14298f0, attrs=0x7fffffffb2e0, spec=21129941) at font.c:3291 #6 0x00000000005f4029 in font_open_by_spec (f=0x14298f0, spec=21129941) at font.c:3354 #7 0x00000000005f4093 in font_open_by_name (f=0x14298f0, name=0x1c0e5c0 "FreeMono") at font.c:3370 #8 0x000000000044b909 in x_set_font (f=0x14298f0, arg=18808561, oldval=13346530) at frame.c:3177 #9 0x000000000044a4b3 in x_set_frame_parameters (f=0x14298f0, alist=13346530) at frame.c:2822 #10 0x000000000044d5db in x_default_parameter (f=0x14298f0, alist=19139910, prop=15528290, deflt=18808561, xprop=0x6c1333 "font", xclass=0x6c132e "Font", type=RES_TYPE_STRING) at frame.c:3880 #11 0x000000000068c1a0 in Fx_create_frame (parms=19139910) at nsfns.m:1261 #12 0x00000000005d8eef in Ffuncall (nargs=2, args=0x7fffffffb7d8) at eval.c:2819 #13 0x00000000006264a9 in exec_byte_code (bytestr=9921745, vector=9921781, maxdepth=16, args_template=13346530, nargs=0, args=0x0) at bytecode.c:784 #14 0x00000000005d9982 in funcall_lambda (fun=9921677, nargs=1, arg_vector=0x7fffffffbcd0) at eval.c:3051 #15 0x00000000005d90e3 in Ffuncall (nargs=2, args=0x7fffffffbcc8) at eval.c:2868 #16 0x00000000006264a9 in exec_byte_code (bytestr=10574537, vector=10574573, maxdepth=20, args_template=13346530, nargs=0, args=0x0) at bytecode.c:784 #17 0x00000000005d9982 in funcall_lambda (fun=10574477, nargs=1, arg_vector=0x7fffffffc1c0) at eval.c:3051 #18 0x00000000005d90e3 in Ffuncall (nargs=2, args=0x7fffffffc1b8) at eval.c:2868 #19 0x00000000006264a9 in exec_byte_code (bytestr=10569457, vector=10569493, maxdepth=24, args_template=13346530, nargs=0, args=0x0) at bytecode.c:784 #20 0x00000000005d9982 in funcall_lambda (fun=10569405, nargs=0, arg_vector=0x7fffffffc6c0) at eval.c:3051 #21 0x00000000005d90e3 in Ffuncall (nargs=1, args=0x7fffffffc6b8) at eval.c:2868 #22 0x00000000006264a9 in exec_byte_code (bytestr=9959433, vector=9959469, maxdepth=72, args_template=0, nargs=0, args=0x7fffffffcc28) at bytecode.c:784 #23 0x00000000005d966d in funcall_lambda (fun=9959381, nargs=0, arg_vector=0x7fffffffcc28) at eval.c:2985 #24 0x00000000005d90e3 in Ffuncall (nargs=1, args=0x7fffffffcc20) at eval.c:2868 #25 0x00000000006264a9 in exec_byte_code (bytestr=9956345, vector=9956381, maxdepth=32, args_template=0, nargs=0, args=0x7fffffffd070) at bytecode.c:784 #26 0x00000000005d966d in funcall_lambda (fun=9956293, nargs=0, arg_vector=0x7fffffffd070) at eval.c:2985 #27 0x00000000005d942c in apply_lambda (fun=9956293, args=13346530) at eval.c:2928 #28 0x00000000005d7942 in eval_sub (form=18604566) at eval.c:2211 #29 0x00000000005d703e in Feval (form=18604566, lexical=13346530) at eval.c:2020 #30 0x00000000005d7765 in eval_sub (form=18611638) at eval.c:2169 #31 0x0000000000607440 in readevalloop (readcharfun=15462674, stream=0xee55b0, sourcename=15618625, printflag=0, unibyte=13346530, readfun=13346530, start=13346530, end=13346530) at lread.c:1819 #32 0x0000000000605ebb in Fload (file=15511473, noerror=13346530, nomessage=13346530, nosuffix=13346530, must_suffix=13346530) at lread.c:1303 #33 0x00000000005d7801 in eval_sub (form=15451142) at eval.c:2180 #34 0x00000000005d703e in Feval (form=15451142, lexical=13346530) at eval.c:2020 #35 0x000000000052fbf9 in top_level_2 () at keyboard.c:1162 #36 0x00000000005d576b in internal_condition_case (bfun=0x52fbd2 , handlers=13910114, hfun=0x52f683 ) at eval.c:1332 #37 0x000000000052fc44 in top_level_1 (ignore=13346530) at keyboard.c:1170 #38 0x00000000005d506e in internal_catch (tag=13905986, func=0x52fbfb , arg=13346530) at eval.c:1089 #39 0x000000000052fb27 in command_loop () at keyboard.c:1125 #40 0x000000000052f129 in recursive_edit_1 () at keyboard.c:752 #41 0x000000000052f318 in Frecursive_edit () at keyboard.c:816 #42 0x000000000052d15f in main (argc=2, argv=0x7fffffffe118) at emacs.c:1693 Lisp Backtrace: "x-create-frame" (0xffffb7e0) "x-create-frame-with-faces" (0xffffbcd0) "make-frame" (0xffffc1c0) "frame-initialize" (0xffffc6c0) "command-line" (0xffffcc28) "normal-top-level" (0xffffd070) "eval" (0xffffd310) "load" (0xffffd7e0) --8<---------------cut here---------------end--------------->8--- This is probably a GNUstep bug, but the following patch fixes the problem. diff --git a/src/nsfont.m b/src/nsfont.m index 556102b..302a2d0 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -271,6 +271,9 @@ ns_charset_covers(NSCharacterSet *set1, NSCharacterSet *set2, float pct) const unsigned short *bytes2 = [[set2 bitmapRepresentation] bytes]; int i, off = 0, tot = 0; + if (! (bytes1 && bytes2)) + return NO; + for (i=0; i<4096; i++, bytes1++, bytes2++) if (*bytes2) {