From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuji Yamano Newsgroups: gmane.emacs.devel Subject: Abort on Mac OS X 10.4.11/ppc Date: Fri, 31 Jul 2009 02:28:44 -0700 (PDT) Message-ID: <20090731.022844.193693926.yyamano@kt.rim.or.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1249038544 24493 80.91.229.12 (31 Jul 2009 11:09:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Jul 2009 11:09:04 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 31 13:08:56 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MWpyp-0000j8-Jx for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2009 13:08:56 +0200 Original-Received: from localhost ([127.0.0.1]:40539 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWpyp-0005WD-7L for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2009 07:08:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWom5-0000XP-2G for emacs-devel@gnu.org; Fri, 31 Jul 2009 05:51:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWoly-0000OQ-V8 for emacs-devel@gnu.org; Fri, 31 Jul 2009 05:51:40 -0400 Original-Received: from [199.232.76.173] (port=55323 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWoly-0000NZ-2Y for emacs-devel@gnu.org; Fri, 31 Jul 2009 05:51:34 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:41063) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MWolx-00075y-5v for emacs-devel@gnu.org; Fri, 31 Jul 2009 05:51:33 -0400 Original-Received: from mbos141-211.alpenstock.jp ([220.156.141.211] helo=phnompenh.mbos.jp) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MWolu-0005wz-Dj for emacs-devel@gnu.org; Fri, 31 Jul 2009 05:51:30 -0400 Original-Received: from [172.16.30.43] ([172.16.30.43]) by phnompenh.mbos.jp ([172.16.30.51]) with ESMTP id 2009073118:31:18:339504.10069.3038772112 for ; Fri, 31 Jul 2009 18:31:18 +0900 (JST) Original-Received: (qmail 14453 invoked from network); 31 Jul 2009 18:31:17 +0900 Original-Received: from unknown (HELO localhost) (yyamano@kt.rim.or.jp@[24.143.249.66]) (envelope-sender ) by soul.mbos (qmail-ldap-1.03) with SMTP for ; 31 Jul 2009 18:31:17 +0900 X-fingerprint: 0DD9 4D1C EBE1 D9B3 4EE0 AC5E F3A4 E5D6 F11A 4171 X-Mailer: Mew version 6.2.51 on Emacs 22.2.50 / Mule 5.0 (SAKAKI) X-TERRACE-SPAMMARK: NOT spam-marked. (by Terrace) X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6 (newer, 3) X-Greylist: delayed 1206 seconds by postgrey-1.27 at nadesico; Fri, 31 Jul 2009 05:51:28 EDT X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Fri, 31 Jul 2009 06:35:40 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:113450 Archived-At: Emacs building from the trunk on Mac OS X 10.4.11/ppc crashes when I eval the following code. It is taken from http://d.hatena.ne.jp/kazu-yamamoto/20090122/1232589385 (setq my-font "-*-*-medium-r-normal--14-*-*-*-*-*-fontset-hiramaru") (setq fixed-width-use-QuickDraw-for-ascii t) (setq mac-allow-anti-aliasing t) (if (= emacs-major-version 22) (require 'carbon-font)) (set-default-font my-font) Here is the stack trace. yyamano@star-mon% gdb ./nextstep/Emacs.app/Contents/MacOS/Emacs GNU gdb 6.1-20040303 (Apple version gdb-384) (Mon Mar 21 00:05:26 GMT 2005) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "powerpc-apple-darwin"...Reading symbols for shared libraries ..... done (gdb) run -q Starting program: /Users/yyamano/work/emacs/emacs-current/nextstep/Emacs.app/Contents/MacOS/Emacs -q Reading symbols for shared libraries ................................................................... done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries ............ done Reading symbols for shared libraries . done Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x00000000 0x90002dc8 in strlen () (gdb) bt #0 0x90002dc8 in strlen () #1 0x90017918 in strdup () #2 0x0017d404 in ns_descriptor_to_entity (desc=0xaced10, extra=41944073, style=0x0) at nsfont.m:169 #3 0x0011a9dc in font_matching_entity (f=0xa7f770, attrs=0x2800409, spec=8275280) at font.c:2946 #4 0x0011c6e8 in font_load_for_lface (f=0xa7f770, attrs=0xbfffe028, spec=11312404) at font.c:3513 #5 0x0011c788 in font_open_by_spec (f=0x0, spec=-1552078012) at font.c:3568 #6 0x0011e958 in font_open_by_name (f=0xa7f770, name=0x4822124 "-*-*-medium-r-normal--14-*-*-*-*-*-fontset-hiramaru") at font.c:3586 #7 0x000195c8 in x_set_font (f=0xa7f770, arg=44656056, oldval=42233803) at frame.c:3356 #8 0x00018664 in x_set_frame_parameters (f=0xa7f770, alist=44656059) at frame.c:3002 #9 0x00018d98 in Fmodify_frame_parameters (frame=11007860, alist=7160213) at frame.c:2548 #10 0x001058e0 in Ffuncall (nargs=0, args=0xbfffe374) at eval.c:3048 #11 0x0013f5fc in Fbyte_code (bytestr=-1552078332, vector=42968777, maxdepth=-1073749136) at bytecode.c:678 #12 0x0010538c in funcall_lambda (fun=2271036, nargs=1, arg_vector=0xbfffe4d0) at eval.c:3232 #13 0x001054a8 in apply_lambda (fun=2271036, args=3502652, eval_flag=44656059) at eval.c:3156 #14 0x00104dc0 in Feval (form=2271032) at eval.c:2418 #15 0x0012b248 in readevalloop (readcharfun=22025852, stream=0x0, sourcename=41944073, evalfun=0x1047ac , printflag=0, unibyte=3473684, readfun=41944073, start=43410754, end=3376) at lread.c:1790 #16 0x0012b654 in Feval_region (start=1536, end=3376, printflag=41944073, read_function=41944073) at lread.c:1886 #17 0x00105924 in Ffuncall (nargs=0, args=0xbfffe710) at eval.c:3055 #18 0x00102630 in Fcall_interactively (function=42024689, record_flag=41944121, keys=-1073747980) at callint.c:868 #19 0x00105900 in Ffuncall (nargs=0, args=0xbfffe9cc) at eval.c:3051 #20 0x00105bf0 in call3 (fn=0, arg1=-1868219584, arg2=-1552078012, arg3=-1814631196) at eval.c:2871 #21 0x000997bc in Fexecute_extended_command (prefixarg=41944073) at keyboard.c:10637 #22 0x001058c4 in Ffuncall (nargs=0, args=0xbfffeb94) at eval.c:3045 #23 0x00102630 in Fcall_interactively (function=41980001, record_flag=41944073, keys=3473684) at callint.c:868 #24 0x00105900 in Ffuncall (nargs=0, args=0xbfffed6c) at eval.c:3051 #25 0x00105bf0 in call3 (fn=0, arg1=-1868219584, arg2=-1552078012, arg3=-1814631196) at eval.c:2871 #26 0x000a3d70 in command_loop_1 () at keyboard.c:1903 #27 0x00103558 in internal_condition_case (bfun=0xa28c8 , handlers=41983665, hfun=0x9a018 ) at eval.c:1512 #28 0x00093990 in command_loop_2 () at keyboard.c:1359 #29 0x001033e4 in internal_catch (tag=0, func=0x93950 , arg=41944073) at eval.c:1248 #30 0x0009365c in command_loop () at keyboard.c:1338 #31 0x00093774 in recursive_edit_1 () at keyboard.c:953 #32 0x0009390c in Frecursive_edit () at keyboard.c:1015 #33 0x00092fb0 in main (argc=3473684, argv=0xbffff948) at emacs.c:1854 (gdb) quit This is the patch to fix the problem. I don't know if it's the rigtht fix, but it seems to work. Index: nsfont.m =================================================================== RCS file: /cvsroot/emacs/emacs/src/nsfont.m,v retrieving revision 1.33 diff -u -r1.33 nsfont.m --- nsfont.m 29 Jul 2009 16:03:14 -0000 1.33 +++ nsfont.m 31 Jul 2009 09:23:39 -0000 @@ -166,14 +166,16 @@ Lisp_Object font_entity = font_make_entity (); /* NSString *psName = [desc postscriptName]; */ NSString *family = [desc objectForKey: NSFontFamilyAttribute]; - char *escapedFamily = strdup ([family UTF8String]); + char *escapedFamily = NULL; + if (family != nil) { + escapedFamily = strdup ([family UTF8String]); + ns_escape_name (escapedFamily); + } unsigned int traits = [desc symbolicTraits]; - ns_escape_name (escapedFamily); - ASET (font_entity, FONT_TYPE_INDEX, Qns); ASET (font_entity, FONT_FOUNDRY_INDEX, Qapple); - ASET (font_entity, FONT_FAMILY_INDEX, intern (escapedFamily)); + ASET (font_entity, FONT_FAMILY_INDEX, escapedFamily ? intern (escapedFamily) : Qnil); ASET (font_entity, FONT_ADSTYLE_INDEX, style ? intern (style) : Qnil); ASET (font_entity, FONT_REGISTRY_INDEX, Qiso10646_1); @@ -696,8 +698,10 @@ if (nsfont == nil) { + const char* familyName = ""; + if (family != nil) familyName = [family UTF8String]; message_with_string ("*** Warning: font in family '%s' not found", - build_string ([family UTF8String]), 1); + build_string (familyName), 1); nsfont = [NSFont userFixedPitchFontOfSize: pixel_size]; } -- Yuji Yamano Peace, unity, love and having fun!