From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#5992: Crash in bidi_paragraph_init Date: Wed, 21 Apr 2010 21:14:45 +0300 Message-ID: <83hbn44qqy.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1271874574 4966 80.91.229.12 (21 Apr 2010 18:29:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 21 Apr 2010 18:29:34 +0000 (UTC) Cc: 5992-done@debbugs.gnu.org To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 21 20:29:32 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O4efz-00057Z-IO for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Apr 2010 20:29:31 +0200 Original-Received: from localhost ([127.0.0.1]:51133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4efy-0007rZ-T1 for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Apr 2010 14:29:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O4eft-0007n7-2s for bug-gnu-emacs@gnu.org; Wed, 21 Apr 2010 14:29:25 -0400 Original-Received: from [140.186.70.92] (port=43135 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4efq-0007ew-7K for bug-gnu-emacs@gnu.org; Wed, 21 Apr 2010 14:29:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O4efo-00009q-Iz for bug-gnu-emacs@gnu.org; Wed, 21 Apr 2010 14:29:22 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40833) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4efo-00009m-H5 for bug-gnu-emacs@gnu.org; Wed, 21 Apr 2010 14:29:20 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1O4eSv-0004vT-TZ for bug-gnu-emacs@gnu.org; Wed, 21 Apr 2010 14:16:01 -0400 Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Apr 2010 18:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 5992 X-GNU-PR-Package: emacs,bidi X-GNU-PR-Keywords: Mail-Followup-To: 5992@debbugs.gnu.org, eliz@gnu.org Original-Received: via spool by 5992-done@debbugs.gnu.org id=D5992.127187373918922 (code D ref 5992); Wed, 21 Apr 2010 18:16:01 +0000 Original-Received: (at 5992-done) by debbugs.gnu.org; 21 Apr 2010 18:15:39 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4eSY-0004v9-7o for submit@debbugs.gnu.org; Wed, 21 Apr 2010 14:15:38 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4eSV-0004v3-Mm for 5992-done@debbugs.gnu.org; Wed, 21 Apr 2010 14:15:36 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0L1800A00NY35O00@a-mtaout20.012.net.il> for 5992-done@debbugs.gnu.org; Wed, 21 Apr 2010 21:14:39 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.129.222]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L180074HO0CMLA0@a-mtaout20.012.net.il>; Wed, 21 Apr 2010 21:14:39 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 21 Apr 2010 14:16:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:36406 Archived-At: > From: Juanma Barranquero > 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.