From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: assertion failed: c == event->code Date: Wed, 12 Dec 2007 12:30:36 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1197480677 14255 80.91.229.12 (12 Dec 2007 17:31:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Dec 2007 17:31:17 +0000 (UTC) Cc: Emacs-Devel To: "Juanma Barranquero" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 12 18:31:27 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J2VQT-0001nu-2i for ged-emacs-devel@m.gmane.org; Wed, 12 Dec 2007 18:31:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2VQB-0000Ur-2D for ged-emacs-devel@m.gmane.org; Wed, 12 Dec 2007 12:30:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J2VQ7-0000Ue-7d for emacs-devel@gnu.org; Wed, 12 Dec 2007 12:30:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J2VQ5-0000Th-Mq for emacs-devel@gnu.org; Wed, 12 Dec 2007 12:30:54 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2VQ5-0000TL-DU for emacs-devel@gnu.org; Wed, 12 Dec 2007 12:30:53 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J2VQ5-0008WP-5I for emacs-devel@gnu.org; Wed, 12 Dec 2007 12:30:53 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 999812CF4EF; Wed, 12 Dec 2007 12:30:52 -0500 (EST) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 2E48B3FE0; Wed, 12 Dec 2007 12:30:36 -0500 (EST) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 19F0D6CAB2; Wed, 12 Dec 2007 12:30:36 -0500 (EST) In-Reply-To: (Juanma Barranquero's message of "Wed, 12 Dec 2007 16:14:15 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:85101 Archived-At: > I'm getting a failed assertion: > keyboard.c:5548: Emacs fatal error: assertion failed: c =3D=3D event->code > Breakpoint 1, w32_abort () at w32fns.c:9127 > 9127 button =3D MessageBox (NULL, > (gdb) bt > #0 w32_abort () at w32fns.c:9127 > #1 0x0101f2fb in die (msg=3D0x13598f8 "assertion failed: c =3D=3D event-= >code", > file=3D0x135686a "keyboard.c", line=3D5548) at alloc.c:6287 > #2 0x01091bfc in read_char (commandflag=3D1, nmaps=3D2, maps=3D0x82fb70, > prev_event=3D25171969, used_mouse_menu=3D0x82fc18, end_time=3D0x0) > at keyboard.c:5548 > #3 0x010928d1 in read_key_sequence (keybuf=3D0x82fce4, bufsize=3D30, > prompt=3D25171969, dont_downcase_last=3D0, can_return_switch_frame=3D= 1, > fix_current_buffer=3D1) at keyboard.c:9459 > #4 0x010952e1 in command_loop_1 () at keyboard.c:1666 > #5 0x0101b0b7 in internal_condition_case (bfun=3D0x1095082 , > handlers=3D25244841, hfun=3D0x108cba3 ) at eval.c:1493 > #6 0x0108bdd0 in command_loop_2 () at keyboard.c:1381 > #7 0x0101b152 in internal_catch (tag=3D25236817, > func=3D0x108bdad , arg=3D25171969) at eval.c:1229 > #8 0x0108c9dc in command_loop () at keyboard.c:1360 > #9 0x0108cd06 in recursive_edit_1 () at keyboard.c:969 > #10 0x0108ce71 in Frecursive_edit () at keyboard.c:1031 > #11 0x01002b0c in main (argc=3D8585136, argv=3D0xa92778) at emacs.c:1781 > That's on Windows XP, with an up-to-date trunk build, built with "gcc > (GCC) 4.2.1-sjlj (mingw32-2)". > The error happens (repeatably) whenever I press Ctrl + a non-ASCII key > (for example, C-=D1, C-=E7, C-=BA). Hmm.. if you just remove this eassert, you should get back the previous behavior. But then I wonder: is this previous behavior correct, and if so, why? Basically, the issue is that when a key is pressed, the W32 code inserts a "ASCII_KEYSTROKE_EVENT" in the queue, even for non-ASCII chars, and then keyboard.c applies a "& 0377" to it, so there's a risk of losing some bits and turning a non-ASCII keypress into some ASCII char. This "& 0377" was introduced by: revision 1.135 date: 1993-08-11 07:56:40 +0000; author: rms; state: Exp; lines: +1 -= 1; (make_lispy_event): Clear all but 0377 in event->code. ---------------------------- so I have no idea why it's there. Stefan