Subject: Re: bug#11964: describe-char causes a fatal error (abort trap: 6) in non-windowed mode

From: Jan Djärv <[email-masked]>
Date: Mon, 5 Nov 2012 16:20:49 +0100

Hello.

5 nov 2012 kl. 15:23 skrev Chong Yidong <[email-masked]>:

> Dan Maftei <[email-masked]> writes:
> 
>> GNU Emacs 24.1.1 (x86_64-apple-darwin11.4.0, NS apple-appkit-1138.47)
>> 
>> emacs -Q -nw
>> n C-x 8 <RET> 0303 <RET> C-b C-u C-x =
>> 
>> This crashes emacs. I am returned to bash. "Fatal error (10)" is
>> written to the screen. After about 3 seconds, "Abort trap: 6" is
>> appended to the same line, and I am returned to the prompt.
> 
> I could on reproduce this on x86_64-unknown-linux-gnu with either Emacs
> 24.1 or latest emacs-24 branch.  This may be Mac-only; could someone
> running on Mac OS please check?

Here is a backtrace.  The fontdriver does not have an encode_char function (it is NULL).
But I don't know which driver this is.  Lisp backtrace is broken it seems.

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00000001002b0f6a in Finternal_char_font (position=4320145466, ch=3084) at fontset.c:1886
#2  0x0000000100202c18 in Ffuncall (nargs=3, args=0x7fff5fbfc788) at eval.c:2777
#3  0x000000010026a75b in exec_byte_code (bytestr=4309734321, vector=4322711389, maxdepth=28, args_template=4320145466, nargs=0, args=0x0) at bytecode.c:899
#4  0x0000000100203ad6 in funcall_lambda (fun=4322711477, nargs=1, arg_vector=0x7fff5fbfce30) at eval.c:3006
#5  0x0000000100202fe6 in Ffuncall (nargs=2, args=0x7fff5fbfce28) at eval.c:2823
#6  0x0000000100202251 in call1 (fn=4362368306, arg1=3084) at eval.c:2568
#7  0x000000010021097b in mapcar1 (leni=1, vals=0x7fff5fbfcf60, fn=4362368306, seq=4307596089) at fns.c:2302
#8  0x0000000100210c80 in Fmapconcat (function=4362368306, sequence=4307596089, separator=4298596513) at fns.c:2348
#9  0x0000000100202c61 in Ffuncall (nargs=4, args=0x7fff5fbfd178) at eval.c:2781
#10 0x000000010026a75b in exec_byte_code (bytestr=4309737345, vector=4322715781, maxdepth=36, args_template=4320145466, nargs=0, args=0x0) at bytecode.c:899
#11 0x00000001002695d6 in Fbyte_code (bytestr=4309737345, vector=4322715781, maxdepth=36) at bytecode.c:474
#12 0x0000000100200cfd in eval_sub (form=4354262198) at eval.c:2145
#13 0x00000001001fddaa in internal_catch (tag=4346014154, func=0x1002004d0 <eval_sub>, arg=4354262198) at eval.c:1059
#14 0x000000010026bbf2 in exec_byte_code (bytestr=4309735793, vector=4362397189, maxdepth=84, args_template=4320145466, nargs=0, args=0x0) at bytecode.c:1080
#15 0x0000000100203ad6 in funcall_lambda (fun=4322720557, nargs=1, arg_vector=0x7fff5fbfe0d0) at eval.c:3006
#16 0x0000000100202fe6 in Ffuncall (nargs=2, args=0x7fff5fbfe0c8) at eval.c:2823
#17 0x000000010026a75b in exec_byte_code (bytestr=4299500689, vector=4299500725, maxdepth=52, args_template=4320145466, nargs=0, args=0x0) at bytecode.c:899
#18 0x0000000100203ad6 in funcall_lambda (fun=4299500597, nargs=1, arg_vector=0x7fff5fbfe7b8) at eval.c:3006
#19 0x0000000100202fe6 in Ffuncall (nargs=2, args=0x7fff5fbfe7b0) at eval.c:2823
#20 0x00000001001fb382 in Fcall_interactively (function=4345551946, record_flag=4320145466, keys=4320195981) at callint.c:852
#21 0x0000000100202c61 in Ffuncall (nargs=4, args=0x7fff5fbfed88) at eval.c:2781
#22 0x0000000100202339 in call3 (fn=4345319866, arg1=4345551946, arg2=4320145466, arg3=4320145466) at eval.c:2599
#23 0x0000000100143fa3 in Fcommand_execute (cmd=4345551946, record_flag=4320145466, keys=4320145466, special=4320145466) at keyboard.c:10233
#24 0x000000010012ce06 in command_loop_1 () at keyboard.c:1586
#25 0x00000001001fe51a in internal_condition_case (bfun=0x10012c280 <command_loop_1>, handlers=4320212234, hfun=0x10012b7c0 <cmd_error>) at eval.c:1288
#26 0x000000010012bdaf in command_loop_2 (ignore=4320145466) at keyboard.c:1167
#27 0x00000001001fddaa in internal_catch (tag=4320208330, func=0x10012bd80 <command_loop_2>, arg=4320145466) at eval.c:1059
#28 0x000000010012bd32 in command_loop () at keyboard.c:1146
#29 0x000000010012b137 in recursive_edit_1 () at keyboard.c:778
#30 0x000000010012b38a in Frecursive_edit () at keyboard.c:842
#31 0x000000010012885f in main (argc=3, argv=0x7fff5fbff8d8) at emacs.c:1566

Lisp Backtrace:
No symbol "GCTYPEBITS" in current context.

(gdb) up
#1  0x00000001002b0f6a in Finternal_char_font (position=4320145466, ch=3084) at fontset.c:1886
(gdb) l
1881	    return Qnil;
1882	  face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil);
1883	  face = FACE_FROM_ID (f, face_id);
1884	  if (face->font)
1885	    {
1886	      unsigned code = face->font->driver->encode_char (face->font, c);
1887	      Lisp_Object font_object;
1888	
1889	      if (code == FONT_INVALID_CODE)
1890		return Qnil;
(gdb) p face->font->driver->encode_char
$1 = (unsigned int (*)(struct font *, int)) 0

	Jan D.