Subject: Re: bug#7949: 24.0.50; GNU Emacs with Xaw3d does not launch as X client

From: Peter Dyballa <[email-masked]>
Date: Tue, 1 Feb 2011 18:23:27 +0100

Am 01.02.2011 um 08:20 schrieb Jan Djärv:

> % gdb emacs
> (gdb) b x_connection_closed
> (gdb) r -xrm '*synchronous: true'
> // error occurs
> (gdb) p error_message
> (gdb) bt

I did from inside GNU Emacs, with gud-gdb. Here is the contents of the  
*gud-emacs* buffer (looks pretty good):

Current directory is .../emacs-24.0.50/src/
GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:15:14  
UTC 2009)
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

DISPLAY = :0
TERM = dumb
Breakpoint 1 at 0x7a58bc0
Breakpoint 2 at 0x1667ec: file sysdep.c, line 838.
(gdb) b x_connection_closed
Breakpoint 3 at 0x1052e4: file xterm.c, line 7688.
(gdb) r -xrm '*synchronous: true'
Starting program: .../emacs-24.0.50/src/emacs -xrm '*synchronous: true'
Reading symbols for shared libraries +++++++++++++++++++++++++ 
+ 
...............................................................................................warning 
: Could not find object file [for some bzr related things]

.. done
Breakpoint 1 at 0x9134abc0

Breakpoint 3, x_connection_closed (dpy=0x3034e00,  
error_message=0xbfffb948 "X protocol error: BadValue (integer  
parameter out of range for operation) on protocol request 45") at  
xterm.c:433
(gdb) p error_message
$1 = 0xbfffb948 "X protocol error: BadValue (integer parameter out of  
range for operation) on protocol request 45"
(gdb) bt
#0  x_connection_closed (dpy=0x3034e00, error_message=0xbfffb948 "X  
protocol error: BadValue (integer parameter out of range for  
operation) on protocol request 45") at xterm.c:433
#1  0x00105770 in x_error_quitter (display=0x3034e00,  
error=0xbfffb948) at xterm.c:7862
#2  0x001057e4 in x_error_handler (display=<value temporarily  
unavailable, due to optimizations>, error=<value temporarily  
unavailable, due to optimizations>) at xterm.c:7832
#3  0x006d8b38 in _XError ()
#4  0x006d52f8 in handle_error ()
#5  0x006d55e4 in handle_response ()
#6  0x006d60c0 in _XReply ()
#7  0x006b2b74 in _XQueryFont ()
#8  0x006b3dd8 in XLoadQueryFont ()
#9  0x0056692c in XtCvtStringToFontStruct ()
#10 0x00563958 in CallConverter ()
#11 0x00563f2c in _XtConvert ()
#12 0x00582a60 in GetResources ()
#13 0x00583124 in _XtGetResources ()
#14 0x00569b14 in xtCreate ()
#15 0x0056a1cc in _XtCreateWidget ()
#16 0x0056a288 in XtCreateWidget ()
#17 0x00272194 in xlw_create_menubar (instance=0x187fe00) at lwlib- 
Xlw.c:151
#18 0x00270568 in allocate_widget_instance [inlined] () at .../ 
emacs-24.0.50/lwlib/lwlib.c:814
#19 lw_make_widget (id=<value temporarily unavailable, due to  
optimizations>, parent=0x1856710, pop_up_p=0 '\0') at .../ 
emacs-24.0.50/lwlib/lwlib.c:858
#20 0x000772e0 in set_frame_menubar (f=0x184af60, first_time=<value  
temporarily unavailable, due to optimizations>, deep_p=1) at xmenu.c: 
1213
#21 0x00112d54 in Fx_create_frame (parms=23147686) at xfns.c:3415
#22 0x001e1ae4 in Ffuncall (nargs=<value temporarily unavailable, due  
to optimizations>, args=<value temporarily unavailable, due to  
optimizations>) at eval.c:2842
#23 0x00233614 in Fbyte_code (bytestr=<value temporarily unavailable,  
due to optimizations>, vector=<value temporarily unavailable, due to  
optimizations>, maxdepth=<value temporarily unavailable, due to  
optimizations>) at bytecode.c:676
#24 0x001e1274 in funcall_lambda (fun=2961272, nargs=2307640,  
arg_vector=0x431808) at eval.c:3028
#25 0x001e172c in Ffuncall (nargs=4397064, args=<value temporarily  
unavailable, due to optimizations>) at eval.c:2902
#26 0x00233614 in Fbyte_code (bytestr=<value temporarily unavailable,  
due to optimizations>, vector=<value temporarily unavailable, due to  
optimizations>, maxdepth=<value temporarily unavailable, due to  
optimizations>) at bytecode.c:676
#27 0x001e1274 in funcall_lambda (fun=3298960, nargs=2307640,  
arg_vector=0x431808) at eval.c:3028
#28 0x001e172c in Ffuncall (nargs=4397064, args=<value temporarily  
unavailable, due to optimizations>) at eval.c:2902
#29 0x00233614 in Fbyte_code (bytestr=<value temporarily unavailable,  
due to optimizations>, vector=<value temporarily unavailable, due to  
optimizations>, maxdepth=<value temporarily unavailable, due to  
optimizations>) at bytecode.c:676
#30 0x001e1274 in funcall_lambda (fun=3296296, nargs=2307640,  
arg_vector=0x431808) at eval.c:3028
#31 0x001e172c in Ffuncall (nargs=4397064, args=<value temporarily  
unavailable, due to optimizations>) at eval.c:2902
#32 0x00233614 in Fbyte_code (bytestr=<value temporarily unavailable,  
due to optimizations>, vector=<value temporarily unavailable, due to  
optimizations>, maxdepth=<value temporarily unavailable, due to  
optimizations>) at bytecode.c:676
#33 0x001e1274 in funcall_lambda (fun=2998368, nargs=2307640,  
arg_vector=0x431808) at eval.c:3028
#34 0x001e172c in Ffuncall (nargs=4397064, args=<value temporarily  
unavailable, due to optimizations>) at eval.c:2902
#35 0x00233614 in Fbyte_code (bytestr=<value temporarily unavailable,  
due to optimizations>, vector=<value temporarily unavailable, due to  
optimizations>, maxdepth=<value temporarily unavailable, due to  
optimizations>) at bytecode.c:676
#36 0x001e1274 in funcall_lambda (fun=2995792, nargs=2307640,  
arg_vector=0x431808) at eval.c:3028
#37 0x001e39e4 in apply_lambda (fun=4659208, args=<value temporarily  
unavailable, due to optimizations>, eval_flag=1) at eval.c:2954
#38 0x001e04ec in Feval (form=<value temporarily unavailable, due to  
optimizations>) at eval.c:2314
#39 0x001df9ec in internal_condition_case (bfun=0x1435e0  
<top_level_2>, handlers=41977714, hfun=0x147910 <cmd_error>) at eval.c: 
1408
#40 0x001458cc in top_level_1 (ignore=<value temporarily unavailable,  
due to optimizations>) at keyboard.c:1146
#41 0x001dfb50 in internal_catch (tag=<value temporarily unavailable,  
due to optimizations>, func=0x145870 <top_level_1>, arg=41949218) at  
eval.c:1152
#42 0x00147dd0 in recursive_edit_1 () at keyboard.c:1101
#43 0x00148014 in Frecursive_edit () at keyboard.c:793
#44 0x0013e430 in main (argc=3, argv=0xbffff7bc) at emacs.c:1682

Lisp Backtrace:
"x-create-frame" (0xbfffe214)
"x-create-frame-with-faces" (0xbfffe474)
"make-frame" (0xbfffe6d4)
"frame-initialize" (0xbfffe934)
"command-line" (0xbfffeb94)
"normal-top-level" (0xbfffed40)
(gdb) The program is running.  Exit anyway? (y or n) y

Debugger finished

Line #433 is the for statement in this function:

/* Return the struct x_display_info corresponding to DPY.  */

	struct x_display_info *
	x_display_info_for_display (Display *dpy)
	{
	  struct x_display_info *dpyinfo;
	
	  for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next)
	    if (dpyinfo->display == dpy)
	      return dpyinfo;
	
	  return 0;
	}

I'll compile once more with -O0 and line #7566 in xterm.c commented.

--
Greetings

   Pete

Only two things are infinite, the universe and human stupidity, and  
I'm not sure about the former.
				– Albert Einstein