From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Juanma Barranquero" <lekktu@gmail.com>
Cc: Emacs-Devel <emacs-devel@gnu.org>
Subject: Re: assertion failed: c == event->code
Date: Wed, 12 Dec 2007 12:30:36 -0500 [thread overview]
Message-ID: <jwv4penn81u.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <f7ccd24b0712120714p37b2a96cwe1a6216823c894a9@mail.gmail.com> (Juanma Barranquero's message of "Wed, 12 Dec 2007 16:14:15 +0100")
> I'm getting a failed assertion:
> keyboard.c:5548: Emacs fatal error: assertion failed: c == event->code
> Breakpoint 1, w32_abort () at w32fns.c:9127
> 9127 button = MessageBox (NULL,
> (gdb) bt
> #0 w32_abort () at w32fns.c:9127
> #1 0x0101f2fb in die (msg=0x13598f8 "assertion failed: c == event->code",
> file=0x135686a "keyboard.c", line=5548) at alloc.c:6287
> #2 0x01091bfc in read_char (commandflag=1, nmaps=2, maps=0x82fb70,
> prev_event=25171969, used_mouse_menu=0x82fc18, end_time=0x0)
> at keyboard.c:5548
> #3 0x010928d1 in read_key_sequence (keybuf=0x82fce4, bufsize=30,
> prompt=25171969, dont_downcase_last=0, can_return_switch_frame=1,
> fix_current_buffer=1) at keyboard.c:9459
> #4 0x010952e1 in command_loop_1 () at keyboard.c:1666
> #5 0x0101b0b7 in internal_condition_case (bfun=0x1095082 <command_loop_1>,
> handlers=25244841, hfun=0x108cba3 <cmd_error>) at eval.c:1493
> #6 0x0108bdd0 in command_loop_2 () at keyboard.c:1381
> #7 0x0101b152 in internal_catch (tag=25236817,
> func=0x108bdad <command_loop_2>, arg=25171969) 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=8585136, argv=0xa92778) 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-Ñ, C-ç, C-º).
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
next prev parent reply other threads:[~2007-12-12 17:30 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-12 15:14 assertion failed: c == event->code Juanma Barranquero
2007-12-12 17:30 ` Stefan Monnier [this message]
2007-12-12 18:00 ` Juanma Barranquero
2007-12-12 20:05 ` Stefan Monnier
2007-12-12 22:54 ` Juanma Barranquero
2007-12-12 23:41 ` Jason Rumney
2007-12-13 14:16 ` Jason Rumney
2007-12-13 15:09 ` Juanma Barranquero
2007-12-13 16:37 ` Jason Rumney
2007-12-13 16:44 ` Juanma Barranquero
2007-12-14 9:24 ` Jason Rumney
2007-12-14 10:11 ` Juanma Barranquero
2007-12-14 1:08 ` Kenichi Handa
2007-12-14 8:47 ` Jason Rumney
2007-12-14 11:11 ` Kenichi Handa
2007-12-14 12:23 ` Jason Rumney
2007-12-14 14:25 ` Juanma Barranquero
2007-12-16 15:19 ` Juanma Barranquero
2007-12-16 20:49 ` Jason Rumney
2007-12-16 20:53 ` Juanma Barranquero
2007-12-16 20:59 ` Juanma Barranquero
2007-12-16 21:25 ` Miles Bader
2007-12-17 1:52 ` Jason Rumney
2007-12-17 9:06 ` Juanma Barranquero
2007-12-12 18:36 ` Andreas Schwab
2007-12-12 17:54 ` martin rudalics
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv4penn81u.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=lekktu@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.