unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Who's maintaining the Win32 display code?
@ 2003-09-17  0:30 David Abrahams
  2003-09-17  1:25 ` Tak Ota
  0 siblings, 1 reply; 7+ messages in thread
From: David Abrahams @ 2003-09-17  0:30 UTC (permalink / raw)



I've been reporting these crashes for several months; is anyone going
to try to track this down or at least give me some pointers?  If not,
maybe as I suggested earlier Win32 should be dropped as a target
platform.  I've done my best to debug the code, but without some
guidance as to what's supposed to be happening, I'm lost.  I can say
that it appears to be trying to draw my cursor.  In w32_text_out(),
s->gc->font appears to be garbage and s->font appears to be valid.
There appear to be many ways to get to a W32FontStruct from a
glyph_string*; I have no idea whether any or all of them are supposed
to match up, but I am guessing that there's a lot of redundancy here
and the invariant is too complicated to be easily maintained.  Anyway,
that's about all I can contribute: stack traces and speculation.

I'm very discouraged :(

 	emacs.exe!get_cached_font_char(bdffont * fontp=0x31003935, int strchr=0x00000020)  Line 343 + 0x16	C
 	emacs.exe!get_bitmap_with_cache(bdffont * fontp=0x31003935, int strchr=0x00000020)  Line 541 + 0xd	C
 	emacs.exe!w32_BDF_TextOut(bdffont * fontp=0x31003935, HDC__ * hdc=0x1f010988, int left=0x00000313, int top=0x000000b1, unsigned char * text=0x0082ec70, int dim=0x00000001, int bytelen=0x00000000, int fixed_pitch_size=0x00000000)  Line 672 + 0xd	C
 	emacs.exe!w32_text_out()  Line 1130 + 0x33	C
 	emacs.exe!x_draw_glyph_string_foreground(glyph_string * s=0x0082ec74)  Line 1505 + 0x25	C
 	emacs.exe!x_draw_glyph_string(glyph_string * s=0x0082ec74)  Line 2381 + 0x9	C
 	emacs.exe!draw_glyphs()  Line 17421 + 0xf	C
 	emacs.exe!draw_phys_cursor_glyph(window * w=0x01c74000, glyph_row * row=0x02080658, draw_glyphs_face hl=DRAW_CURSOR)  Line 18853 + 0x36	C
 	emacs.exe!w32_draw_window_cursor()  Line 5135 + 0xf	C
>	emacs.exe!display_and_set_cursor(window * w=0x01c74000, int on=0x00000001, int hpos=0x00000000, int vpos=0x0000000e, int x=0x00000000, int y=0x000000a8)  Line 19049 + 0x2a	C
 	emacs.exe!x_update_window_end(window * w=0x01c74000, int cursor_on_p=0x00000001, int mouse_face_overwritten_p=0x00000000)  Line 542 + 0x25	C
 	emacs.exe!update_window(window * w=0x01c74000, int force_p=0x00000000)  Line 4199 + 0x1d	C
 	emacs.exe!update_window_tree(window * w=0x01c74000, int force_p=0x00000000)  Line 3885 + 0xd	C
 	emacs.exe!update_window_tree(window * w=0x024eb400, int force_p=0x00000000)  Line 3881 + 0x16	C
 	emacs.exe!update_frame(frame * f=0x01676a00, int force_p=0x00000000, int inhibit_hairy_id_p=0x00000000)  Line 3822 + 0xd	C
 	emacs.exe!redisplay_internal(int preserve_echo_area=0x00000001)  Line 10114 + 0xd	C
 	emacs.exe!redisplay_preserve_echo_area(int from_where=0x00000008)  Line 10253 + 0x7	C
 	emacs.exe!detect_input_pending_run_timers(int do_display=0x00000001)  Line 9913 + 0x7	C
 	emacs.exe!wait_reading_process_input(int time_limit=0x0000001e, int microsecs=0x00000000, int read_kbd=0x0fffffff, int do_display=0x00000001)  Line 4116 + 0x9	C
 	emacs.exe!sit_for(int sec=0x0000001e, int usec=0x00000000, int reading=0x00000001, int display=0x00000001, int initial_display=0x00000000)  Line 6251 + 0x15	C
 	emacs.exe!read_char(int commandflag=0x00000001, int nmaps=0x00000003, int * maps=0x0082f8ec, int prev_event=0x113a8404, int * used_mouse_menu=0x0082fab0)  Line 2721 + 0x24	C
 	emacs.exe!read_key_sequence(int * keybuf=0x0082fc44, int bufsize=0x0000001e, int prompt=0x113a8404, int dont_downcase_last=0x00000000, int can_return_switch_frame=0x00000001, int fix_current_buffer=0x00000001)  Line 8827 + 0x2a	C
 	emacs.exe!command_loop_1()  Line 1505 + 0x1b	C
 	emacs.exe!internal_condition_case(int (void)* bfun=0x010176f0, int handlers=0x113c7e44, int (void)* hfun=0x010171c0)  Line 1333 + 0x5	C
 	emacs.exe!command_loop_2()  Line 1292 + 0x15	C
 	emacs.exe!internal_catch(int tag=0x113bd404, int (void)* func=0x01017540, int arg=0x113a8404)  Line 1094 + 0x9	C
 	emacs.exe!command_loop()  Line 1271 + 0x17	C
 	emacs.exe!recursive_edit_1()  Line 987 + 0x5	C
 	emacs.exe!Frecursive_edit()  Line 1044	C
 	emacs.exe!main()  Line 1668	C
 	emacs.exe!mainCRTStartup()  Line 259 + 0x12	C
 	emacs.exe!_start()  Line 131	C
 	kernel32.dll!77e814c7() 	

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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

* Re: Who's maintaining the Win32 display code?
  2003-09-17  0:30 Who's maintaining the Win32 display code? David Abrahams
@ 2003-09-17  1:25 ` Tak Ota
  2003-09-17  3:04   ` David Abrahams
  0 siblings, 1 reply; 7+ messages in thread
From: Tak Ota @ 2003-09-17  1:25 UTC (permalink / raw)
  Cc: emacs-devel

I've been using emacs on w32 platform everyday for years.  I rebuild
from the head of CVS at least once a week.  I'm sorry but I have never
seen the crash you have been reporting.  I use BDF font too.  Does it
crash even when started with -q --no-site-file options?  Can't you
narrow the case so that someone else can reproduce the crash?

-Tak

Tue, 16 Sep 2003 20:30:53 -0400: David Abrahams <dave@boost-consulting.com> wrote:

> 
> I've been reporting these crashes for several months; is anyone going
> to try to track this down or at least give me some pointers?  If not,
> maybe as I suggested earlier Win32 should be dropped as a target
> platform.  I've done my best to debug the code, but without some
> guidance as to what's supposed to be happening, I'm lost.  I can say
> that it appears to be trying to draw my cursor.  In w32_text_out(),
> s->gc->font appears to be garbage and s->font appears to be valid.
> There appear to be many ways to get to a W32FontStruct from a
> glyph_string*; I have no idea whether any or all of them are supposed
> to match up, but I am guessing that there's a lot of redundancy here
> and the invariant is too complicated to be easily maintained.  Anyway,
> that's about all I can contribute: stack traces and speculation.
> 
> I'm very discouraged :(
> 
>  	emacs.exe!get_cached_font_char(bdffont * fontp=0x31003935, int strchr=0x00000020)  Line 343 + 0x16	C
>  	emacs.exe!get_bitmap_with_cache(bdffont * fontp=0x31003935, int strchr=0x00000020)  Line 541 + 0xd	C
>  	emacs.exe!w32_BDF_TextOut(bdffont * fontp=0x31003935, HDC__ * hdc=0x1f010988, int left=0x00000313, int top=0x000000b1, unsigned char * text=0x0082ec70, int dim=0x00000001, int bytelen=0x00000000, int fixed_pitch_size=0x00000000)  Line 672 + 0xd	C
>  	emacs.exe!w32_text_out()  Line 1130 + 0x33	C
>  	emacs.exe!x_draw_glyph_string_foreground(glyph_string * s=0x0082ec74)  Line 1505 + 0x25	C
>  	emacs.exe!x_draw_glyph_string(glyph_string * s=0x0082ec74)  Line 2381 + 0x9	C
>  	emacs.exe!draw_glyphs()  Line 17421 + 0xf	C
>  	emacs.exe!draw_phys_cursor_glyph(window * w=0x01c74000, glyph_row * row=0x02080658, draw_glyphs_face hl=DRAW_CURSOR)  Line 18853 + 0x36	C
>  	emacs.exe!w32_draw_window_cursor()  Line 5135 + 0xf	C
> >	emacs.exe!display_and_set_cursor(window * w=0x01c74000, int on=0x00000001, int hpos=0x00000000, int vpos=0x0000000e, int x=0x00000000, int y=0x000000a8)  Line 19049 + 0x2a	C
>  	emacs.exe!x_update_window_end(window * w=0x01c74000, int cursor_on_p=0x00000001, int mouse_face_overwritten_p=0x00000000)  Line 542 + 0x25	C
>  	emacs.exe!update_window(window * w=0x01c74000, int force_p=0x00000000)  Line 4199 + 0x1d	C
>  	emacs.exe!update_window_tree(window * w=0x01c74000, int force_p=0x00000000)  Line 3885 + 0xd	C
>  	emacs.exe!update_window_tree(window * w=0x024eb400, int force_p=0x00000000)  Line 3881 + 0x16	C
>  	emacs.exe!update_frame(frame * f=0x01676a00, int force_p=0x00000000, int inhibit_hairy_id_p=0x00000000)  Line 3822 + 0xd	C
>  	emacs.exe!redisplay_internal(int preserve_echo_area=0x00000001)  Line 10114 + 0xd	C
>  	emacs.exe!redisplay_preserve_echo_area(int from_where=0x00000008)  Line 10253 + 0x7	C
>  	emacs.exe!detect_input_pending_run_timers(int do_display=0x00000001)  Line 9913 + 0x7	C
>  	emacs.exe!wait_reading_process_input(int time_limit=0x0000001e, int microsecs=0x00000000, int read_kbd=0x0fffffff, int do_display=0x00000001)  Line 4116 + 0x9	C
>  	emacs.exe!sit_for(int sec=0x0000001e, int usec=0x00000000, int reading=0x00000001, int display=0x00000001, int initial_display=0x00000000)  Line 6251 + 0x15	C
>  	emacs.exe!read_char(int commandflag=0x00000001, int nmaps=0x00000003, int * maps=0x0082f8ec, int prev_event=0x113a8404, int * used_mouse_menu=0x0082fab0)  Line 2721 + 0x24	C
>  	emacs.exe!read_key_sequence(int * keybuf=0x0082fc44, int bufsize=0x0000001e, int prompt=0x113a8404, int dont_downcase_last=0x00000000, int can_return_switch_frame=0x00000001, int fix_current_buffer=0x00000001)  Line 8827 + 0x2a	C
>  	emacs.exe!command_loop_1()  Line 1505 + 0x1b	C
>  	emacs.exe!internal_condition_case(int (void)* bfun=0x010176f0, int handlers=0x113c7e44, int (void)* hfun=0x010171c0)  Line 1333 + 0x5	C
>  	emacs.exe!command_loop_2()  Line 1292 + 0x15	C
>  	emacs.exe!internal_catch(int tag=0x113bd404, int (void)* func=0x01017540, int arg=0x113a8404)  Line 1094 + 0x9	C
>  	emacs.exe!command_loop()  Line 1271 + 0x17	C
>  	emacs.exe!recursive_edit_1()  Line 987 + 0x5	C
>  	emacs.exe!Frecursive_edit()  Line 1044	C
>  	emacs.exe!main()  Line 1668	C
>  	emacs.exe!mainCRTStartup()  Line 259 + 0x12	C
>  	emacs.exe!_start()  Line 131	C
>  	kernel32.dll!77e814c7() 	
> 
> -- 
> Dave Abrahams
> Boost Consulting
> www.boost-consulting.com
> 
> 
> 
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://mail.gnu.org/mailman/listinfo/emacs-devel

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

* Re: Who's maintaining the Win32 display code?
  2003-09-17  1:25 ` Tak Ota
@ 2003-09-17  3:04   ` David Abrahams
  2003-09-17  5:14     ` Peter Lee
  2003-09-17  6:58     ` Jason Rumney
  0 siblings, 2 replies; 7+ messages in thread
From: David Abrahams @ 2003-09-17  3:04 UTC (permalink / raw)
  Cc: emacs-devel

Tak,

Thanks for responding.

Tak Ota <Takaaki.Ota@am.sony.com> writes:

> I've been using emacs on w32 platform everyday for years.  I rebuild
> from the head of CVS at least once a week.  I'm sorry but I have never
> seen the crash you have been reporting.  

Don't be sorry; be thankful! 

> I use BDF font too.  

FWIW, I don't even know what "BDF font" is.

> Does it crash even when started with -q --no-site-file options?

I don't know, because I probably couldn't use emacs effectively for
long enough with those options to reproduce the problem.  It happens
about once a day.

> Can't you narrow the case so that someone else can reproduce the
> crash?

It crashes seemingly at random; usually when I'm typing, but almost
always in the same place.  I've done everything I know how to,
including undocumented things like recompiling emacs with GLYPH_DEBUG
and no optimization, and starting emacs under the visual studio
debugger.  I'm at a loss.  None of my other regular programs are
crashing, but then I don't use anything except possibly IE as much as
I use emacs.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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

* Re: Who's maintaining the Win32 display code?
  2003-09-17  3:04   ` David Abrahams
@ 2003-09-17  5:14     ` Peter Lee
  2003-09-17  6:58     ` Jason Rumney
  1 sibling, 0 replies; 7+ messages in thread
From: Peter Lee @ 2003-09-17  5:14 UTC (permalink / raw)


>>>> David Abrahams writes:

    Tak>> Does it crash even when started with -q --no-site-file options?

    David> I don't know, because I probably couldn't use emacs
    David> effectively for long enough with those options to reproduce
    David> the problem.  It happens about once a day.

In that case, maybe you could dump your init files here.  I used
21.3.1 for a long time and for the last few months have been using cvs
and haven't seen the crash you are reporting.  I'm on windows xp.

I'd be willing to try your init files (assuming I can get hold of all
the dependent packages) for a few days to see if I can reproduce.  I
would guess that if you ran emacs with -q --no-site-file for a day
you wouldn't see a crash.

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

* Re: Who's maintaining the Win32 display code?
  2003-09-17  3:04   ` David Abrahams
  2003-09-17  5:14     ` Peter Lee
@ 2003-09-17  6:58     ` Jason Rumney
  2003-09-17 11:56       ` David Abrahams
  1 sibling, 1 reply; 7+ messages in thread
From: Jason Rumney @ 2003-09-17  6:58 UTC (permalink / raw)
  Cc: Tak Ota, emacs-devel

David Abrahams <dave@boost-consulting.com> writes:

> FWIW, I don't even know what "BDF font" is.

Strange, since the stack trace shows clearly that you are using one,
and it is not possible to use BDF fonts on Windows accidently.

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

* Re: Who's maintaining the Win32 display code?
  2003-09-17  6:58     ` Jason Rumney
@ 2003-09-17 11:56       ` David Abrahams
  2003-09-23 23:50         ` David Abrahams
  0 siblings, 1 reply; 7+ messages in thread
From: David Abrahams @ 2003-09-17 11:56 UTC (permalink / raw)
  Cc: Tak Ota, emacs-devel

Jason Rumney <jasonr@gnu.org> writes:

> David Abrahams <dave@boost-consulting.com> writes:
>
>> FWIW, I don't even know what "BDF font" is.
>
> Strange, since the stack trace shows clearly that you are using one,
> and it is not possible to use BDF fonts on Windows accidently.

Maybe that's a symptom of the bug here.  The only fonts I'm using are
AFAICT standard Windows TrueType fonts that come with the system.
The relevant section of my .emacs is:

  ; is it gnu emacs or xemacs
  (setq my-gnup (not (string-match "^\\(XEmacs\\).*" (emacs-version))))

  (setq my-windows
        (or (eq system-type 'windows-nt)
        (eq system-type 'cygwin32)
        (eq system-type 'cygwin)))


  (if my-gnup
      (condition-case nil
          (progn
            (set-default-font "-*-Lucida Console-normal-r-*-*-12-96-96-96-c-*-iso8859-1")
            (set-face-font 'italic "-*-Lucida Console-normal-i-*-*-12-96-96-96-c-*-*-1")
            (set-face-font 'bold-italic "-*-Lucida Console-bold-i-*-*-12-96-96-96-c-*-*-1")
            )
        (error nil)))

There is no other font selection going on anywhere, at least not
AFAICT.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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

* Re: Who's maintaining the Win32 display code?
  2003-09-17 11:56       ` David Abrahams
@ 2003-09-23 23:50         ` David Abrahams
  0 siblings, 0 replies; 7+ messages in thread
From: David Abrahams @ 2003-09-23 23:50 UTC (permalink / raw)


David Abrahams <dave@boost-consulting.com> writes:

> Jason Rumney <jasonr@gnu.org> writes:
>
>> David Abrahams <dave@boost-consulting.com> writes:
>>
>>> FWIW, I don't even know what "BDF font" is.
>>
>> Strange, since the stack trace shows clearly that you are using one,
>> and it is not possible to use BDF fonts on Windows accidently.
>
> Maybe that's a symptom of the bug here.  The only fonts I'm using are
> AFAICT standard Windows TrueType fonts that come with the system.
> The relevant section of my .emacs is:
>
>   ; is it gnu emacs or xemacs
>   (setq my-gnup (not (string-match "^\\(XEmacs\\).*" (emacs-version))))
>
>   (setq my-windows
>         (or (eq system-type 'windows-nt)
>         (eq system-type 'cygwin32)
>         (eq system-type 'cygwin)))
>
>
>   (if my-gnup
>       (condition-case nil
>           (progn
>             (set-default-font "-*-Lucida Console-normal-r-*-*-12-96-96-96-c-*-iso8859-1")
>             (set-face-font 'italic "-*-Lucida Console-normal-i-*-*-12-96-96-96-c-*-*-1")
>             (set-face-font 'bold-italic "-*-Lucida Console-bold-i-*-*-12-96-96-96-c-*-*-1")
>             )
>         (error nil)))
>
> There is no other font selection going on anywhere, at least not
> AFAICT.

And furthermore, having set a breakpoint in w32_BDF_TextOut I can
confirm that emacs doesn't try to draw any BDF fonts for me when
operating normally.  I think the fact that it arrives there in the
first place is a symptom of whatever's gone wrong before.

That's a pretty strong clue.  Does anyone know this code well enough
to use that to make progress on this bug?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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

end of thread, other threads:[~2003-09-23 23:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-17  0:30 Who's maintaining the Win32 display code? David Abrahams
2003-09-17  1:25 ` Tak Ota
2003-09-17  3:04   ` David Abrahams
2003-09-17  5:14     ` Peter Lee
2003-09-17  6:58     ` Jason Rumney
2003-09-17 11:56       ` David Abrahams
2003-09-23 23:50         ` David Abrahams

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).