Subject: bug#571: 23.0.60; Solaris 5.8 version hangs (X resources for faces)

From: Klaus Zeitler <[email-masked]>
Date: Tue, 19 Aug 2008 10:11:25 +0200

>>>>> "Chong" == Chong Yidong <[email-masked]> writes:
    Chong> 
    Chong> Klaus, one thing to diagnose this problem is to run Emacs under
    Chong> gdb, set a breakpoint at `error', and get a backtrace.  Could you
    Chong> do that, and see where in the code this error arises?

Breakpoint 3, error (
    m=0x1cf388 "Attempt to delete the sole visible or iconified frame",
    a1=0xca7d9d "\312}\245", a2=0x36a400 "",
    a3=0x36e400 '\377' <repeats 200 times>...)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:2024
(gdb) bt
#0  error (
    m=0x1cf388 "Attempt to delete the sole visible or iconified frame",
    a1=0xca7d9d "\312}\245", a2=0x36a400 "",
    a3=0x36e400 '\377' <repeats 200 times>...)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:2024
#1  0x00056988 in Fdelete_frame (frame=4134404, force=3688449)
    at /vol/freeware/cvs/emacs/head/emacs/src/frame.c:1393
#2  0x00167a9c in Ffuncall (nargs=1, args=0x391a29)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3045
#3  0x0019b7e4 in Fbyte_code (bytestr=3742249, vector=2327176, maxdepth=16)
    at /vol/freeware/cvs/emacs/head/emacs/src/bytecode.c:678
#4  0x00166f14 in Feval (form=3)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:2379
#5  0x0016415c in Fprogn (args=2327125)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:449
#6  0x001685d0 in unbind_to (count=32, value=3688449)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3397
#7  0x00165638 in unwind_to_catch (catch=0xffbee310, value=3607552)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:1292
#8  0x00165ff0 in Fsignal (error_symbol=3752201, data=13270429)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:1725
#9  0x0016603c in xsignal (error_symbol=3752201, data=13270429)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:1750
#10 0x00166098 in xsignal2 (error_symbol=3752201, arg1=3752201, arg2=13270429)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:1774
#11 0x00152854 in wrong_type_argument (predicate=3916969, value=3724841)
    at /vol/freeware/cvs/emacs/head/emacs/src/data.c:111
#12 0x0017b190 in Ffont_xlfd_name (font=3724841, fold_wildcards=3688449)
    at /vol/freeware/cvs/emacs/head/emacs/src/font.c:4115
#13 0x000c8bf4 in x_update_menu_appearance (f=0x3f1600)
    at /vol/freeware/cvs/emacs/head/emacs/src/xfaces.c:3743
#14 0x000cba24 in realize_basic_faces (f=0x3f1600)
    at /vol/freeware/cvs/emacs/head/emacs/src/xfaces.c:5553
#15 0x000c4b98 in recompute_basic_faces (f=0x3f1600)
    at /vol/freeware/cvs/emacs/head/emacs/src/xfaces.c:916
#16 0x00060704 in init_iterator (it=0xffbed038, w=0x3f1a00, charpos=1,
    bytepos=1, row=0x0, base_face_id=DEFAULT_FACE_ID)
    at /vol/freeware/cvs/emacs/head/emacs/src/xdisp.c:2597
#17 0x00069aac in resize_mini_window (w=0x3f1a00, exact_p=1)
    at /vol/freeware/cvs/emacs/head/emacs/src/xdisp.c:8729
#18 0x000554b0 in do_switch_frame (frame=3828228, track=1, for_deletion=0)
    at /vol/freeware/cvs/emacs/head/emacs/src/frame.c:868
#19 0x00167a80 in Ffuncall (nargs=1, args=0x3c0c01)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3042
#20 0x0019b7e4 in Fbyte_code (bytestr=3935233, vector=2799072, maxdepth=16)
    at /vol/freeware/cvs/emacs/head/emacs/src/bytecode.c:678
#21 0x00166f14 in Feval (form=3)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:2379
#22 0x0016415c in Fprogn (args=2799021)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:449
#23 0x001685d0 in unbind_to (count=272, value=3688449)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3397
#24 0x0019b854 in Fbyte_code (bytestr=3688449, vector=2798800, maxdepth=48)
    at /vol/freeware/cvs/emacs/head/emacs/src/bytecode.c:700
#25 0x00167e7c in funcall_lambda (fun=2798740, nargs=1, arg_vector=0xffbed9b4)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3229
#26 0x00167968 in Ffuncall (nargs=1, args=0xc5e079)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3099
#27 0x0019b7e4 in Fbyte_code (bytestr=12968057, vector=2326936, maxdepth=40)
    at /vol/freeware/cvs/emacs/head/emacs/src/bytecode.c:678
#28 0x00167e7c in funcall_lambda (fun=2326868, nargs=1, arg_vector=0xffbedb5c)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3229
#29 0x00167968 in Ffuncall (nargs=1, args=0xc5e019)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3099
#30 0x0019b7e4 in Fbyte_code (bytestr=12967961, vector=2609104, maxdepth=48)
    at /vol/freeware/cvs/emacs/head/emacs/src/bytecode.c:678
#31 0x00167e7c in funcall_lambda (fun=2609036, nargs=1, arg_vector=0xffbedd04)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3229
#32 0x00167968 in Ffuncall (nargs=1, args=0xcd1139)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3099
#33 0x0019b7e4 in Fbyte_code (bytestr=13439289, vector=2606088, maxdepth=48)
    at /vol/freeware/cvs/emacs/head/emacs/src/bytecode.c:678
#34 0x00167e7c in funcall_lambda (fun=2606036, nargs=0, arg_vector=0xffbedeac)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3229
#35 0x00167968 in Ffuncall (nargs=0, args=0xc88431)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3099
#36 0x0019b7e4 in Fbyte_code (bytestr=13141041, vector=2363072, maxdepth=56)
    at /vol/freeware/cvs/emacs/head/emacs/src/bytecode.c:678
#37 0x00167e7c in funcall_lambda (fun=2363028, nargs=0, arg_vector=0xffbee05c)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3229
#38 0x00167968 in Ffuncall (nargs=0, args=0xc7f509)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3099
#39 0x0019b7e4 in Fbyte_code (bytestr=13104393, vector=2359808, maxdepth=48)
    at /vol/freeware/cvs/emacs/head/emacs/src/bytecode.c:678
#40 0x00167e7c in funcall_lambda (fun=2359764, nargs=0, arg_vector=0xffbee170)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3229
#41 0x00167d2c in apply_lambda (fun=2359764, args=3688449, eval_flag=3630080)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:3153
#42 0x00166d38 in Feval (form=4350317)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:2433
#43 0x00165ad0 in internal_condition_case (bfun=0xfbe9c <top_level_2>,
    handlers=3752153, hfun=0xfbb0c <cmd_error>)
    at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:1511
#44 0x000fbeec in top_level_1 ()
    at /vol/freeware/cvs/emacs/head/emacs/src/keyboard.c:1355
#45 0x00165584 in internal_catch (tag=3748225, func=0xfbeb4 <top_level_1>,
    arg=3688449) at /vol/freeware/cvs/emacs/head/emacs/src/eval.c:1247
#46 0x000fbe00 in command_loop ()
    at /vol/freeware/cvs/emacs/head/emacs/src/keyboard.c:1310
#47 0x000fb6e4 in recursive_edit_1 ()
    at /vol/freeware/cvs/emacs/head/emacs/src/keyboard.c:942
#48 0x000fb868 in Frecursive_edit ()
    at /vol/freeware/cvs/emacs/head/emacs/src/keyboard.c:1004
#49 0x000fa5e0 in main (argc=0, argv=0xffbee77c)
    at /vol/freeware/cvs/emacs/head/emacs/src/emacs.c:1689

Lisp Backtrace:
"delete-frame" (0xffbec624)
"byte-code" (0xffbec6c8)
"select-frame" (0xffbed56c)
"byte-code" (0xffbed610)
"tool-bar-setup" (0xffbed9b4)
"x-create-frame-with-faces" (0xffbedb5c)
"make-frame" (0xffbedd04)
"frame-initialize" (0xffbedeac)
"command-line" (0xffbee05c)
"normal-top-level" (0xffbee170)

So I think the problem is the CHECK_FONT in 

DEFUN ("font-xlfd-name", Ffont_xlfd_name, Sfont_xlfd_name, 1, 2, 0,
       doc: /*  Return XLFD name of FONT.
FONT is a font-spec, font-entity, or font-object.
If the name is too long for XLFD (maximum 255 chars), return nil.
If the 2nd optional arg FOLD-WILDCARDS is non-nil,
the consecutive wildcards are folded to one.  */)
     (font, fold_wildcards)
     Lisp_Object font, fold_wildcards;
{
  char name[256];
  int pixel_size = 0;

  CHECK_FONT (font);
...

(gdb) up
#12 0x0017b190 in Ffont_xlfd_name (font=3724841, fold_wildcards=3688449)
    at /vol/freeware/cvs/emacs/head/emacs/src/font.c:4115
(gdb) p font
$7 = 3724841
(gdb) pr
unspecified

Maybe this already helps. If not I need a few hints how to proceed.
font-xlfd-name seems to be a new function.

Klaus

-- 
 --------------------------------------------------
|  Klaus Zeitler      Alcatel-Lucent               |
|  Email:             [email-masked]  |
 --------------------------------------------------
---
What is mind?  No matter.
What is matter?  Never mind.  -- Thomas Hewitt Key, 1799-1875