GNU bug report logs - #5992
Crash in bidi_paragraph_init

Previous Next

Package: emacs;

Reported by: Juanma Barranquero <lekktu <at> gmail.com>

Date: Tue, 20 Apr 2010 22:58:02 UTC

Severity: normal

Found in version 24.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5992 in the body.
You can then email your comments to 5992 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5992; Package emacs,bidi. (Tue, 20 Apr 2010 22:58:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juanma Barranquero <lekktu <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 20 Apr 2010 22:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Bug-Gnu-Emacs <bug-gnu-emacs <at> gnu.org>
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





Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Wed, 21 Apr 2010 18:16:01 GMT) Full text and rfc822 format available.

Notification sent to Juanma Barranquero <lekktu <at> gmail.com>:
bug acknowledged by developer. (Wed, 21 Apr 2010 18:16:01 GMT) Full text and rfc822 format available.

Message #10 received at 5992-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 5992-done <at> debbugs.gnu.org
Subject: Re: bug#5992: Crash in bidi_paragraph_init
Date: Wed, 21 Apr 2010 21:14:45 +0300
> From: Juanma Barranquero <lekktu <at> gmail.com>
> 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.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5992; Package emacs,bidi. (Wed, 21 Apr 2010 19:35:01 GMT) Full text and rfc822 format available.

Message #13 received at 5992 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 5992 <at> debbugs.gnu.org
Cc: eliz <at> gnu.org
Subject: Re: bug#5992: Crash in bidi_paragraph_init
Date: Wed, 21 Apr 2010 15:34:25 -0400
> 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.

Actually, IIRC what paragraphs.el says is not quite that "@foo " is
a paragraph separator, but that a line that starts with "@foo " is
a paragraph separator (i.e. is not part of a paragraph).

So it doesn't seem incompatible with your needs.


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 20 May 2010 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 36 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.