unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Bad Protocol request 77
@ 2005-06-29  5:53 Stefan Monnier
  2005-06-29  6:06 ` Stefan Monnier
  2005-06-29 15:05 ` jhd
  0 siblings, 2 replies; 7+ messages in thread
From: Stefan Monnier @ 2005-06-29  5:53 UTC (permalink / raw)



My Emacs is crashing in Gnus when displaying some articles.
I haven't been able to get a reliable recipe yet, but basically I get
a backtrace as shown in the appended session.
The first backtrace is with x-synchronize turned off, the second is with
x-synchronize turned on.

Could give me some hint what I should be looking at?
In the mean time, I'll try to get a reliably reproducible recipe.


        Stefan


(gdb) bt
#0  x_error_quitter (display=0xbfffce30, error=0xbfffcd00) at xterm.c:7788
#1  0x0810175c in x_error_handler (display=0x8714568, error=0xbfffcd00) at xterm.c:7753
#2  0xb7ddf624 in _XError () from /usr/X11R6/lib/libX11.so.6
#3  0xb7ddc5ca in _XEventsQueued () from /usr/X11R6/lib/libX11.so.6
#4  0xb7dcfa59 in XPending () from /usr/X11R6/lib/libX11.so.6
#5  0x080ffc8b in XTread_socket (sd=0, expected=1, hold_quit=0xbfffe790) at xterm.c:7043
#6  0x0813ab25 in read_avail_input (expected=1) at keyboard.c:6676
#7  0x0813ad0c in handle_async_input () at keyboard.c:6819
#8  0x08097ffc in x_write_glyphs (start=0x88053a8, len=69) at xdisp.c:20047
#9  0x08056f33 in update_text_area (w=0x87d2db0, vpos=2) at dispnew.c:4321
#10 0x0805754f in update_window_line (w=0x87d2db0, vpos=2, mouse_face_overwritten_p=0x100) at dispnew.c:4545
#11 0x08056b8f in update_window (w=0x87d2db0, force_p=0) at dispnew.c:4187
#12 0x0805668a in update_window_tree (w=0x87d2db0, force_p=0) at dispnew.c:3930
#13 0x0805654c in update_window_tree (w=0x98eca10, force_p=0) at dispnew.c:3926
#14 0x08056401 in update_frame (f=0x87d2c30, force_p=0, inhibit_hairy_id_p=256) at dispnew.c:3862
#15 0x0807ff31 in redisplay_internal (preserve_echo_area=0) at xdisp.c:10581
#16 0x0807e4d2 in redisplay () at xdisp.c:9799
#17 0x081334c5 in read_char (commandflag=1, nmaps=4, maps=0xbffff20c, prev_event=138334225, used_mouse_menu=0xbffff248) at keyboard.c:2538
#18 0x0813fb86 in read_key_sequence (keybuf=0xbffff370, bufsize=30, prompt=138334225, dont_downcase_last=0, can_return_switch_frame=1, fix_current_buffer=1) at keyboard.c:8825
#19 0x0812de99 in command_loop_1 () at keyboard.c:1528
#20 0x081b93ce in internal_condition_case (bfun=0x812dc20 <command_loop_1>, handlers=138395217, hfun=0x812d6c0 <cmd_error>) at eval.c:1443
#21 0x0812da5e in command_loop_2 () at keyboard.c:1318
#22 0x081b8e8b in internal_catch (tag=256, func=0x812da30 <command_loop_2>, arg=138334225) at eval.c:1202
#23 0x0812da03 in command_loop () at keyboard.c:1297
#24 0x0812d0b5 in recursive_edit_1 () at keyboard.c:990
#25 0x0812d241 in Frecursive_edit () at keyboard.c:1051
#26 0x0812b08d in main (argc=3, argv=0xbffffa24) at emacs.c:1776
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/monnier/src/emacs/trunk/src/emacs -f gnus

Breakpoint 2, x_error_quitter (display=0xbfffddb0, error=0xbfffdce0) at xterm.c:7788
(gdb) bt
#0  x_error_quitter (display=0xbfffddb0, error=0xbfffdce0) at xterm.c:7788
#1  0x0810175c in x_error_handler (display=0x8714568, error=0xbfffdce0) at xterm.c:7753
#2  0xb7ddf624 in _XError () from /usr/X11R6/lib/libX11.so.6
#3  0xb7dddb83 in _XReply () from /usr/X11R6/lib/libX11.so.6
#4  0xb7dd8db4 in XSync () from /usr/X11R6/lib/libX11.so.6
#5  0xb7dd8e75 in _XSyncFunction () from /usr/X11R6/lib/libX11.so.6
#6  0xb7dc99c8 in XDrawImageString16 () from /usr/X11R6/lib/libX11.so.6
#7  0x080f5d8e in x_draw_glyph_string_foreground (s=0xbfffe3bc) at xterm.c:1310
#8  0x080f8a6d in x_draw_glyph_string (s=0xbfffe3bc) at xterm.c:2644
#9  0x080935db in draw_glyphs (w=0x87d2db0, x=415, row=0x88bc980, area=TEXT_AREA, start=0, end=68, hl=DRAW_NORMAL_TEXT, overlaps_p=0) at xdisp.c:18729
#10 0x08097fad in x_write_glyphs (start=0x87d8568, len=68) at xdisp.c:20029
#11 0x08056f33 in update_text_area (w=0x87d2db0, vpos=0) at dispnew.c:4321
#12 0x0805754f in update_window_line (w=0x87d2db0, vpos=0, mouse_face_overwritten_p=0x100) at dispnew.c:4545
#13 0x08056b8f in update_window (w=0x87d2db0, force_p=0) at dispnew.c:4187
#14 0x0805668a in update_window_tree (w=0x87d2db0, force_p=0) at dispnew.c:3930
#15 0x0805654c in update_window_tree (w=0x98db8d0, force_p=0) at dispnew.c:3926
#16 0x08056401 in update_frame (f=0x87d2c30, force_p=0, inhibit_hairy_id_p=256) at dispnew.c:3862
#17 0x0807ff31 in redisplay_internal (preserve_echo_area=0) at xdisp.c:10581
#18 0x0807e4d2 in redisplay () at xdisp.c:9799
#19 0x081334c5 in read_char (commandflag=1, nmaps=4, maps=0xbffff20c, prev_event=138334225, used_mouse_menu=0xbffff248) at keyboard.c:2538
#20 0x0813fb86 in read_key_sequence (keybuf=0xbffff370, bufsize=30, prompt=138334225, dont_downcase_last=0, can_return_switch_frame=1, fix_current_buffer=1) at keyboard.c:8825
#21 0x0812de99 in command_loop_1 () at keyboard.c:1528
#22 0x081b93ce in internal_condition_case (bfun=0x812dc20 <command_loop_1>, handlers=138395217, hfun=0x812d6c0 <cmd_error>) at eval.c:1443
#23 0x0812da5e in command_loop_2 () at keyboard.c:1318
#24 0x081b8e8b in internal_catch (tag=256, func=0x812da30 <command_loop_2>, arg=138334225) at eval.c:1202
#25 0x0812da03 in command_loop () at keyboard.c:1297
#26 0x0812d0b5 in recursive_edit_1 () at keyboard.c:990
#27 0x0812d241 in Frecursive_edit () at keyboard.c:1051
#28 0x0812b08d in main (argc=3, argv=0xbffffa24) at emacs.c:1776
(gdb) up 7
#7  0x080f5d8e in x_draw_glyph_string_foreground (s=0xbfffe3bc) at xterm.c:1310
(gdb) p *s
$1 = {
  x = 217, 
  y = 1, 
  ybase = 12, 
  width = 6, 
  background_width = 6, 
  height = 13, 
  left_overhang = 0, 
  right_overhang = 0, 
  f = 0x87d2c30, 
  w = 0x87d2db0, 
  display = 0x8714568, 
  window = 29360220, 
  row = 0x88bc980, 
  area = TEXT_AREA, 
  char2b = 0xbfffe36c, 
  nchars = 1, 
  hl = DRAW_NORMAL_TEXT, 
  face = 0x8a3ff88, 
  font = 0x9972fe0, 
  font_info = 0x87d4c50, 
  cmp = 0x0, 
  gidx = 0, 
  extends_to_end_of_line_p = 0, 
  background_filled_p = 0, 
  two_byte_p = 1, 
  font_not_found_p = 0, 
  stippled_p = 0, 
  for_overlaps_p = 0, 
  gc = 0x9121ad8, 
  first_glyph = 0x87d89c8, 
  img = 0x0, 
  slice = {
    x = 0, 
    y = 0, 
    width = 0, 
    height = 0
  }, 
  clip_head = 0x0, 
  clip_tail = 0x0, 
  next = 0xbfffe2ec, 
  prev = 0xbfffe48c
}
(gdb) 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bad Protocol request 77
  2005-06-29  5:53 Bad Protocol request 77 Stefan Monnier
@ 2005-06-29  6:06 ` Stefan Monnier
  2005-06-29 15:05 ` jhd
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2005-06-29  6:06 UTC (permalink / raw)


> In the mean time, I'll try to get a reliably reproducible recipe.

OK, got it:

   LANG=fr_CH.UTF-8 emacs -q
   M-x font-lock-mode RET
   M-x customize-face RET font-lock-function-name-face RET
   ... make it bold ...
   C-x b *scratch* RET
   ( d e f u n SPC f o o Multi_key o e

it may depend on the fonts you have installed, tho.
This is on a Debian "sarge-like" system.
The problem basically happens when displaying unicode chars (like œ in the
above recipe) in bold.

If you don't have Multi_key on your keyboard, you can use the TeX input
method and do "\ o e" to enter the œ char.  The crash is identical (it
crashes during display, not during input).


        Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bad Protocol request 77
  2005-06-29  5:53 Bad Protocol request 77 Stefan Monnier
  2005-06-29  6:06 ` Stefan Monnier
@ 2005-06-29 15:05 ` jhd
  2005-06-29 16:41   ` Stefan Monnier
  1 sibling, 1 reply; 7+ messages in thread
From: jhd @ 2005-06-29 15:05 UTC (permalink / raw)
  Cc: emacs-devel

>
> My Emacs is crashing in Gnus when displaying some articles.
> I haven't been able to get a reliable recipe yet, but basically I get
> a backtrace as shown in the appended session.
> The first backtrace is with x-synchronize turned off, the second is  
> with
> x-synchronize turned on.
>
> Could give me some hint what I should be looking at?
> In the mean time, I'll try to get a reliably reproducible recipe.
>
>
>         Stefan
>
>
> (gdb) bt
> #0  x_error_quitter (display=0xbfffce30, error=0xbfffcd00) at  
> xterm.c:7788
> #1  0x0810175c in x_error_handler (display=0x8714568,  
> error=0xbfffcd00) at xterm.c:7753
> #2  0xb7ddf624 in _XError () from /usr/X11R6/lib/libX11.so.6

Can you print out the error string (error parameter to  
x_error_handler)?  77 is just XDrawImageString16 which is in the  
second backtrace as expected.  But it can generate different errors.   
I think it is a BadMatch, which usually indicates bad input to  
XDrawImageString16.  You should be able to walk up to the stack frame  
that calls XDrawImageString16 and examine the input.

     Jan D.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bad Protocol request 77
  2005-06-29 15:05 ` jhd
@ 2005-06-29 16:41   ` Stefan Monnier
  2005-07-01 10:05     ` jhd
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2005-06-29 16:41 UTC (permalink / raw)
  Cc: emacs-devel

>> My Emacs is crashing in Gnus when displaying some articles.
>> I haven't been able to get a reliable recipe yet, but basically I get
>> a backtrace as shown in the appended session.
>> The first backtrace is with x-synchronize turned off, the second is  with
>> x-synchronize turned on.
>> 
>> Could give me some hint what I should be looking at?
>> In the mean time, I'll try to get a reliably reproducible recipe.
>> 
>> 
>> Stefan
>> 
>> 
>> (gdb) bt
>> #0  x_error_quitter (display=0xbfffce30, error=0xbfffcd00) at
>> xterm.c:7788
>> #1  0x0810175c in x_error_handler (display=0x8714568,  error=0xbfffcd00)
>> at xterm.c:7753
>> #2  0xb7ddf624 in _XError () from /usr/X11R6/lib/libX11.so.6

> Can you print out the error string (error parameter to  x_error_handler)?
> 77 is just XDrawImageString16 which is in the  second backtrace as expected.
> But it can generate different errors.   I think it is a BadMatch, which
> usually indicates bad input to  XDrawImageString16.  You should be able to
> walk up to the stack frame  that calls XDrawImageString16 and examine
> the input.

It's indeed a BadMatch, but I don't know what part of the input would be
interesting to examine or what legitimate values should look like,


        Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bad Protocol request 77
  2005-06-29 16:41   ` Stefan Monnier
@ 2005-07-01 10:05     ` jhd
  2005-07-01 15:19       ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: jhd @ 2005-07-01 10:05 UTC (permalink / raw)
  Cc: emacs-devel


>
>> Can you print out the error string (error parameter to   
>> x_error_handler)?
>> 77 is just XDrawImageString16 which is in the  second backtrace as  
>> expected.
>> But it can generate different errors.   I think it is a BadMatch,  
>> which
>> usually indicates bad input to  XDrawImageString16.  You should be  
>> able to
>> walk up to the stack frame  that calls XDrawImageString16 and examine
>> the input.
>>
>
> It's indeed a BadMatch, but I don't know what part of the input  
> would be
> interesting to examine or what legitimate values should look like,


As you had a recipe for reproducing this, it is probably the œ  
character that is either miscoded in the string argument (the  
penultimate argument, an XChar2b *) or it is missing in the font used  
for bold.  If you can print the values in the XChar2b* (the last  
argument to XDrawImageString16 specifies the length in characters,  
i.e. bytes/2) and use xfd to inspect the font used, you should be  
able to tell if all characters in the XChar2b* are present in the font.

     Jan D.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bad Protocol request 77
  2005-07-01 10:05     ` jhd
@ 2005-07-01 15:19       ` Stefan Monnier
  2005-07-01 17:58         ` jhd
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2005-07-01 15:19 UTC (permalink / raw)
  Cc: emacs-devel

> As you had a recipe for reproducing this, it is probably the œ  character
> that is either miscoded in the string argument (the  penultimate argument,
> an XChar2b *) or it is missing in the font used  for bold.  If you can print
> the values in the XChar2b* (the last  argument to XDrawImageString16
> specifies the length in characters,  i.e. bytes/2) and use xfd to inspect
> the font used, you should be  able to tell if all characters in the XChar2b*
> are present in the font.

It's indeed missing from the font,


        Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bad Protocol request 77
  2005-07-01 15:19       ` Stefan Monnier
@ 2005-07-01 17:58         ` jhd
  0 siblings, 0 replies; 7+ messages in thread
From: jhd @ 2005-07-01 17:58 UTC (permalink / raw)
  Cc: emacs-devel

>> As you had a recipe for reproducing this, it is probably the œ   
>> character
>> that is either miscoded in the string argument (the  penultimate  
>> argument,
>> an XChar2b *) or it is missing in the font used  for bold.  If you  
>> can print
>> the values in the XChar2b* (the last  argument to XDrawImageString16
>> specifies the length in characters,  i.e. bytes/2) and use xfd to  
>> inspect
>> the font used, you should be  able to tell if all characters in  
>> the XChar2b*
>> are present in the font.
>>
>
> It's indeed missing from the font,

I don't know if Emacs can do much about this.  Perhaps we could  
handle the error somehow, but there might be many characters passed  
to XDrawImageString16 and not drawing all of them would look bad.  If  
it where only one an empty rectangle could be drawn instead.

     Jan D.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-07-01 17:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-29  5:53 Bad Protocol request 77 Stefan Monnier
2005-06-29  6:06 ` Stefan Monnier
2005-06-29 15:05 ` jhd
2005-06-29 16:41   ` Stefan Monnier
2005-07-01 10:05     ` jhd
2005-07-01 15:19       ` Stefan Monnier
2005-07-01 17:58         ` jhd

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).