emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-bug-tracker] bug#5992: closed (Crash in bidi_paragraph_init)


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#5992: closed (Crash in bidi_paragraph_init)
Date: Wed, 21 Apr 2010 18:16:01 +0000

Your message dated Wed, 21 Apr 2010 21:14:45 +0300
with message-id <address@hidden>
and subject line Re: bug#5992: Crash in bidi_paragraph_init
has caused the GNU bug report #5992,
regarding Crash in bidi_paragraph_init
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
5992: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5992
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Crash in bidi_paragraph_init Date: Wed, 21 Apr 2010 00:49:15 +0200
Package: emacs,bidi
Version: 24.0.50

emacs -Q --eval "(setq-default bidi-display-reordering t)"
..\doc\lispref\locals.texi


Breakpoint 1, w32_abort () at w32fns.c:7349
7349      button = MessageBox (NULL,
(gdb) bt
#0  w32_abort () at w32fns.c:7349
#1  0x012bf00b in bidi_paragraph_init (dir=NEUTRAL_DIR,
bidi_it=0x88d9c8) at bidi.c:909
#2  0x01066004 in set_iterator_to_next (it=0x88d470, reseat_p=1) at xdisp.c:6260
#3  0x0108f3f0 in display_line (it=0x88d470) at xdisp.c:17725
#4  0x010847c7 in try_window (window=55639045, pos=..., flags=1) at
xdisp.c:14674
#5  0x01082be5 in redisplay_window (window=55639045,
just_this_one_p=0) at xdisp.c:14295
#6  0x0107bada in redisplay_window_0 (window=55639045) at xdisp.c:12587
#7  0x010362ca in internal_condition_case_1 (bfun=0x107baa7
<redisplay_window_0>, arg=55639045, handlers=49859198,
    hfun=0x107ba86 <redisplay_window_error>) at eval.c:1560
#8  0x0107ba6d in redisplay_windows (window=55639045) at xdisp.c:12566
#9  0x010796dc in redisplay_internal (preserve_echo_area=0) at xdisp.c:12138
#10 0x010762ec in redisplay () at xdisp.c:11368
#11 0x0100a784 in read_char (commandflag=1, nmaps=2, maps=0x88f960,
prev_event=49874970, used_mouse_menu=0x88fa38, end_time=0x0) at
keyboard.c:2576
#12 0x0101d3f0 in read_key_sequence (keybuf=0x88fbcc, bufsize=30,
prompt=49874970, dont_downcase_last=0, can_return_switch_frame=1,
    fix_current_buffer=1) at keyboard.c:9349
#13 0x01007bf7 in command_loop_1 () at keyboard.c:1636
#14 0x010361e2 in internal_condition_case (bfun=0x100734e
<command_loop_1>, handlers=49932506, hfun=0x1006a75 <cmd_error>) at
eval.c:1512
#15 0x01006f4f in command_loop_2 () at keyboard.c:1356
#16 0x01035c64 in internal_catch (tag=49930674, func=0x1006f2a
<command_loop_2>, arg=49874970) at eval.c:1248
#17 0x01006f08 in command_loop () at keyboard.c:1335
#18 0x01006180 in recursive_edit_1 () at keyboard.c:950
#19 0x0100669b in Frecursive_edit () at keyboard.c:1012
#20 0x01002a95 in main (argc=5, argv=0xd52d30) at emacs.c:1784




--- End Message ---
--- Begin Message --- Subject: Re: bug#5992: Crash in bidi_paragraph_init Date: Wed, 21 Apr 2010 21:14:45 +0300
> From: Juanma Barranquero <address@hidden>
> Date: Wed, 21 Apr 2010 00:49:15 +0200
> Cc: 
> 
> emacs -Q --eval "(setq-default bidi-display-reordering t)"
> ..\doc\lispref\locals.texi
> 
> 
> Breakpoint 1, w32_abort () at w32fns.c:7349
> 7349      button = MessageBox (NULL,
> (gdb) bt
> #0  w32_abort () at w32fns.c:7349
> #1  0x012bf00b in bidi_paragraph_init (dir=NEUTRAL_DIR,
> bidi_it=0x88d9c8) at bidi.c:909
> #2  0x01066004 in set_iterator_to_next (it=0x88d470, reseat_p=1) at 
> xdisp.c:6260

This happens because texinfo.el defines a local value for
paragraph-start and paragraph-separate that match non-empty lines that
don't need to include newlines:

  (setq paragraph-separate
        (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-separate))
  (setq paragraph-start (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-start))

Thus, "@foo " is a paragraph separator.  The bidi reordering code is
not ready for such surprises, because UAX#9 says:

   The algorithm reorders text only within a paragraph; characters in
   one paragraph have no effect on characters in a different
   paragraph. Paragraphs are divided by the Paragraph Separator or
   appropriate Newline Function [...]. Paragraphs may also be
   determined by higher-level protocols: for example, the text in two
   different cells of a table will be in different paragraphs.

We use the ``higher-level protocols'' fire escape to define a
paragraph in Emacsy way.  But the algorithm still expects the
paragraph to begin and end in a newline.  If paragraph-start and
paragraph-separate don't cooperate, sooner or later bidi.c will crash.

In retrospect, it was too audacious of me to use the buffer-local
value of these two variables, considering the interesting ways in
which various modes define them.

I installed a change that uses only the default values of these
variables.  If people think this is not flexible enough, we can always
add something like bidi-paragraph-start etc., or find some other
solution.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]