emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Abort on Mac OS X 10.4.11/ppc


From: Yuji Yamano
Subject: Abort on Mac OS X 10.4.11/ppc
Date: Fri, 31 Jul 2009 02:28:44 -0700 (PDT)

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.

address@hidden 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 <Feval>, 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 <command_loop_1>, 
handlers=41983665, hfun=0x9a018 <cmd_error>) at eval.c:1512
#28 0x00093990 in command_loop_2 () at keyboard.c:1359
#29 0x001033e4 in internal_catch (tag=0, func=0x93950 <command_loop_2>, 
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!






reply via email to

[Prev in Thread] Current Thread [Next in Thread]