GNU bug report logs - #5858
24.0.50; bidi aborts: "can't happen" happens

Previous Next

Package: emacs;

Reported by: Ari Roponen <ari.roponen <at> gmail.com>

Date: Thu, 8 Apr 2010 09:05:02 UTC

Severity: normal

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 5858 in the body.
You can then email your comments to 5858 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#5858; Package emacs. (Thu, 08 Apr 2010 09:05:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ari Roponen <ari.roponen <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 08 Apr 2010 09:05:02 GMT) Full text and rfc822 format available.

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

From: Ari Roponen <ari.roponen <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; bidi aborts: "can't happen" happens
Date: Thu, 08 Apr 2010 12:03:55 +0300
Hi,

the following code crashes emacs by making code in bidi.c call
abort():

  (let ((bidi-display-reordering t))
    (insert #x650 #x650)		; ARABIC KASRA
    (redisplay))


The place that calls abort() is in bidi_resolve_neutral():

#0  abort () at emacs.c:430
#1  0x0000000000490abe in bidi_resolve_neutral (bidi_it=0x7fffffff9000)
    at bidi.c:1577
#2  0x000000000049119a in bidi_level_of_next_char (bidi_it=0x7fffffff9000)
    at bidi.c:1713
...

(gdb) up
#1  0x0000000000490abe in bidi_resolve_neutral (bidi_it=0x7fffffff9000)
    at bidi.c:1577
1577			  abort ();		/* can't happen: BNs are skipped */
(gdb) l
1572			next_type = STRONG_R;
1573			saved_it.next_for_neutral.type = STRONG_R;
1574			break;
1575		      case WEAK_BN:
1576			if (!bidi_explicit_dir_char (bidi_it->ch))
1577			  abort ();		/* can't happen: BNs are skipped */
1578			/* FALLTHROUGH */
1579		      case NEUTRAL_B:
1580			/* Marched all the way to the end of this level run.
1581			   We need to use the eor type, whose information is


In GNU Emacs 24.0.50.3 (x86_64-unknown-linux-gnu, GTK+ Version 2.19.7)
 of 2010-04-07 on arirop
Windowing system distributor `Fedora Project', version 11.0.10799901

-- 
Ari Roponen





Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 08 Apr 2010 17:44:02 GMT) Full text and rfc822 format available.

Notification sent to Ari Roponen <ari.roponen <at> gmail.com>:
bug acknowledged by developer. (Thu, 08 Apr 2010 17:44:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ari Roponen <ari.roponen <at> gmail.com>
Cc: 5858-done <at> debbugs.gnu.org
Subject: Re: bug#5858: 24.0.50; bidi aborts: "can't happen" happens
Date: Thu, 08 Apr 2010 20:42:57 +0300
> From: Ari Roponen <ari.roponen <at> gmail.com>
> Date: Thu, 08 Apr 2010 12:03:55 +0300
> Cc: 
> 
> the following code crashes emacs by making code in bidi.c call
> abort():
> 
>   (let ((bidi-display-reordering t))
>     (insert #x650 #x650)		; ARABIC KASRA
>     (redisplay))

Heh, a brain-fart from 9 years ago that came back to haunt me...

> The place that calls abort() is in bidi_resolve_neutral():
> 
> #0  abort () at emacs.c:430
> #1  0x0000000000490abe in bidi_resolve_neutral (bidi_it=0x7fffffff9000)
>     at bidi.c:1577
> #2  0x000000000049119a in bidi_level_of_next_char (bidi_it=0x7fffffff9000)
>     at bidi.c:1713
> ...
> 
> (gdb) up
> #1  0x0000000000490abe in bidi_resolve_neutral (bidi_it=0x7fffffff9000)
>     at bidi.c:1577
> 1577			  abort ();		/* can't happen: BNs are skipped */
> (gdb) l
> 1572			next_type = STRONG_R;
> 1573			saved_it.next_for_neutral.type = STRONG_R;
> 1574			break;
> 1575		      case WEAK_BN:
> 1576			if (!bidi_explicit_dir_char (bidi_it->ch))
> 1577			  abort ();		/* can't happen: BNs are skipped */
> 1578			/* FALLTHROUGH */
> 1579		      case NEUTRAL_B:
> 1580			/* Marched all the way to the end of this level run.
> 1581			   We need to use the eor type, whose information is

Yours is an optimized build, right?  Because, in an unoptimized build,
it's a different call to `abort' that is triggered:

  #1  0x011a3931 in bidi_resolve_neutral (bidi_it=0x82d2f8) at bidi.c:1600
  1600                    abort ();
  (gdb) l
  1595                        bidi_copy_it (bidi_it, &saved_it);
  1596                        return bidi_it->type;
  1597                      }
  1598                    break;
  1599                  default:
  1600                    abort ();  <<<<<<<<<<<<<<<<<
  1601                }
  1602              type = bidi_resolve_neutral_1 (saved_it.prev_for_neutral.type,

  1603                                             next_type, current_level);
  1604              saved_it.type = type;

Anyway, I think I fixed it (revno 99851); please try again after
updating your tree.  If it still doesn't work, please re-open this
bug.

Thanks for reporting this.




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

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

Previous Next


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