From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: aidalgol@amuri.net Newsgroups: gmane.emacs.bugs Subject: bug#18438: 24.4.50; assertion failed in bidi.c Date: Mon, 20 Oct 2014 08:49:47 +1300 Message-ID: <3f58803f7aad502a95f0dff635170867@amuri.net> References: <4745242cd3e424a6c4d5db0e8d3e33d0@amuri.net> <83h9zrlzc8.fsf@gnu.org> <54297FDB.6090606@cornell.edu> <837g0mmkf3.fsf@gnu.org> <6b19fab333f3d362ae61b30b299d7206@amuri.net> <83iok5ku74.fsf@gnu.org> <88ccbe34bf58322ae4b2a5657390c041@amuri.net> <83ppe1itu9.fsf@gnu.org> <837g08bdcy.fsf@gnu.org> <1c93d571dbd64d473e8c53ba59063425@amuri.net> <83k3416hlf.fsf@gnu.org> <02fd9e39e5724b113eb47ecef0408ae5@amuri.net> <83mw8w4gp6.fsf@gnu.org> <543FC3F6.9010101@cornell.edu> <83mw8scedk.fsf@gnu.org> <5443DAD2.6090007@cornell.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1413748226 22161 80.91.229.3 (19 Oct 2014 19:50:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Oct 2014 19:50:26 +0000 (UTC) To: <18438@debbugs.gnu.org> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 19 21:50:15 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XfwUZ-0003au-PE for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Oct 2014 21:50:15 +0200 Original-Received: from localhost ([::1]:41000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfwUZ-00015K-D0 for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Oct 2014 15:50:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfwUR-00012T-BE for bug-gnu-emacs@gnu.org; Sun, 19 Oct 2014 15:50:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XfwUM-00041m-TC for bug-gnu-emacs@gnu.org; Sun, 19 Oct 2014 15:50:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35728) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfwUM-00041G-PN for bug-gnu-emacs@gnu.org; Sun, 19 Oct 2014 15:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XfwUM-0003hp-2y for bug-gnu-emacs@gnu.org; Sun, 19 Oct 2014 15:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: aidalgol@amuri.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Oct 2014 19:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18438 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 18438-submit@debbugs.gnu.org id=B18438.141374819314228 (code B ref 18438); Sun, 19 Oct 2014 19:50:02 +0000 Original-Received: (at 18438) by debbugs.gnu.org; 19 Oct 2014 19:49:53 +0000 Original-Received: from localhost ([127.0.0.1]:56059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XfwUD-0003hP-2n for submit@debbugs.gnu.org; Sun, 19 Oct 2014 15:49:53 -0400 Original-Received: from goat.amuri.net ([203.99.132.195]:42159) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XfwU8-0003h4-Ic for 18438@debbugs.gnu.org; Sun, 19 Oct 2014 15:49:50 -0400 Original-Received: from webmail.amuri.net (localhost [127.0.0.1]) by goat.amuri.net (Postfix) with ESMTP id 55CF1FFC8A; Mon, 20 Oct 2014 08:49:47 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=amuri.net; s=mail1; t=1413748187; bh=6mKlPLh7/ov36DXYO2Y8agcq1R4nqkIjUbBLF7UZxJE=; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To: Cc:Subject:In-Reply-To:References:Message-ID; b=kMSF+P6PM1LnblLtqzxeFYIGbKdsD3nCsucsvJ7ZRnt/Ayxfb7OfU2uFIvgSWT6Gr +0d0N9CCB1Q9OHFZb57BPbNisM2kvA/KV89NtBv/D7tBKPVOTYPpBM4bquYaqa/txm s0hD1Em7GRDSJADG9I+tK2Jn6brn5FjsQNWhGebI= In-Reply-To: <5443DAD2.6090007@cornell.edu> X-Sender: aidalgol@amuri.net User-Agent: Roundcube Webmail/0.5.3 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:94797 On Sun, 19 Oct 2014 11:37:54 -0400, Ken Brown wrote: > On 10/19/2014 10:39 AM, Eli Zaretskii wrote: >> The rest of what the comments in w32_wnd_proc say is correct, but >> again unrelated, for the same reasons. > > OK, thanks for checking. > >> In fact, I cannot explain to >> myself at all how _any_ code that is not thread-safe could cause >> such >> a phenomenon. I can think of no other explanations for what we see >> except some code that somehow modifies the CPU flags between the >> compare instruction and the following jump instruction. Otherwise, >> how can it be that the value is valid, but Emacs still aborts? Any >> other ideas? > > What about your earlier suggestion (from > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18438#139) to force a > 64-bit compare instruction for 'type', with the latter in a 64-bit > register: > > === modified file 'src/bidi.c' > --- src/bidi.c 2014-04-06 15:56:01 +0000 > +++ src/bidi.c 2014-10-10 07:12:01 +0000 > @@ -326,7 +326,14 @@ bidi_get_type (int ch, bidi_dir_t overri > static void > bidi_check_type (bidi_type_t type) > { > - eassert (UNKNOWN_BT <= type && type <= NEUTRAL_ON); > + volatile ptrdiff_t qtype = type; > + > + if (!(suppress_checking || (UNKNOWN_BT <= qtype && qtype <= > NEUTRAL_ON))) > + { > + fprintf (stderr, "\r\n%s:%d: bidi type %d is not in > [%d..%d]\r\n", > + __FILE__, __LINE__, type, UNKNOWN_BT, NEUTRAL_ON); > + emacs_abort (); > + } > } > > /* Given a bidi TYPE of a character, return its category. */ > > > Aidan, have you tried this yet? Oops! No, I somehow missed this patch when I first read that post. I think I absent-mindedly mistook it for the same patch as the one in . Applying now and doing a clean build. Note that this means that my last backtrace was with the patch in message #103, *NOT* the one in #139 that forces a 64-bit comparison.