all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#21633: 25.0.50; assertion failure, self-insert-command with negative argument
@ 2015-10-06  9:11 Nicolas Richard
  2015-10-06  9:42 ` Andreas Schwab
  2015-10-06  9:54 ` Andreas Schwab
  0 siblings, 2 replies; 8+ messages in thread
From: Nicolas Richard @ 2015-10-06  9:11 UTC (permalink / raw)
  To: 21633

Using the build mentionned below (i.e. built today) :

emacs -Q
Hit: C-- * (or C-- C-1 *)
=> crash (assertion failed)

Here's my gdb session, when setting a breakpoint :

Breakpoint 3, Fself_insert_command (n=9223372036854775807) at cmds.c:308
308	  CHECK_NUMBER (n);
(gdb) p n
$10 = 9223372036854775807
(gdb) xpr
Lisp_Int1
$11 = -1
(gdb) p CHECK_NUMBER (n)
$12 = void
(gdb) n
310	  if (XFASTINT (n) < 0)
(gdb) p XFASTINT (n)
$13 = 4611686018427387903
(gdb) xpr
Lisp_Misc
warning: value truncated
Cannot access memory at address 0xffffffff

At this point I realize I understand nothing about C and gdb. Anyway, I
say "next" and see that the above `if' statement failed to find the obvious
error :

(gdb) n
313	  if (XFASTINT (n) < 2)
(gdb) l
308	  CHECK_NUMBER (n);
309	
310	  if (XFASTINT (n) < 0)
311	    error ("Negative repetition argument %"pI"d", XFASTINT (n));
312	
313	  if (XFASTINT (n) < 2)
314	    remove_excessive_undo_boundaries ();
315	
316	  /* Barf if the key that invoked this was not a character.  */
317	  if (!CHARACTERP (last_command_event))
(gdb) 

Now I don't know what to do.

In GNU Emacs 25.0.50.2 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2015-10-06
Repository revision: 25b4572073179c8d6dc980ce2df3db4d96cd692f
Windowing system distributor 'The X.Org Foundation', version 11.0.11604000
System Description:	Gentoo Base System release 2.2

Configured using:
 'configure --with-x-toolkit=lucid --enable-checking --with-wide-int
 'CFLAGS= -O0 -g3''

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF
GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS LUCID X11

Important settings:
  value of $LANG: fr_FR.UTF-8
  locale-coding-system: utf-8-unix

-- 
Nicolas Richard





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#21633: 25.0.50; assertion failure, self-insert-command with negative argument
  2015-10-06  9:11 bug#21633: 25.0.50; assertion failure, self-insert-command with negative argument Nicolas Richard
@ 2015-10-06  9:42 ` Andreas Schwab
  2015-10-06 12:26   ` Nicolas Richard
  2015-10-06  9:54 ` Andreas Schwab
  1 sibling, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2015-10-06  9:42 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: 21633

Nicolas Richard <youngfrog@members.fsf.org> writes:

> (gdb) p XFASTINT (n)
> $13 = 4611686018427387903
> (gdb) xpr
> Lisp_Misc
> warning: value truncated
> Cannot access memory at address 0xffffffff
>
> At this point I realize I understand nothing about C and gdb.

XFASTINT unboxes the Lisp_Object.  The value is a plain number.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#21633: 25.0.50; assertion failure, self-insert-command with negative argument
  2015-10-06  9:11 bug#21633: 25.0.50; assertion failure, self-insert-command with negative argument Nicolas Richard
  2015-10-06  9:42 ` Andreas Schwab
@ 2015-10-06  9:54 ` Andreas Schwab
  1 sibling, 0 replies; 8+ messages in thread
From: Andreas Schwab @ 2015-10-06  9:54 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: 21633-done

Fixed in 0befeb0.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#21633: 25.0.50; assertion failure, self-insert-command with negative argument
  2015-10-06  9:42 ` Andreas Schwab
@ 2015-10-06 12:26   ` Nicolas Richard
  2015-10-06 12:44     ` Andreas Schwab
  2015-10-06 15:07     ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Nicolas Richard @ 2015-10-06 12:26 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 21633

Andreas Schwab <schwab@suse.de> writes:
> XFASTINT unboxes the Lisp_Object.  The value is a plain number.

So XFASTINT (n) in this case should be -1 instead of
4611686018427387903. Thanks for the information and for fixing the bug.

As an additionnal information, please note that this seems related to
--with-wide-int (at least I get proper error reporting when not using
this option). Shouldn't XFASTINT be made to work in that case instead of
using XINT ?

-- 
Nico





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#21633: 25.0.50; assertion failure, self-insert-command with negative argument
  2015-10-06 12:26   ` Nicolas Richard
@ 2015-10-06 12:44     ` Andreas Schwab
  2015-10-06 15:07     ` Eli Zaretskii
  1 sibling, 0 replies; 8+ messages in thread
From: Andreas Schwab @ 2015-10-06 12:44 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: 21633

Nicolas Richard <youngfrog@members.fsf.org> writes:

> As an additionnal information, please note that this seems related to
> --with-wide-int (at least I get proper error reporting when not using
> this option). Shouldn't XFASTINT be made to work in that case instead of
> using XINT ?

XFASTINT is only defined for non-negative Lisp_Int.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#21633: 25.0.50; assertion failure, self-insert-command with negative argument
  2015-10-06 12:26   ` Nicolas Richard
  2015-10-06 12:44     ` Andreas Schwab
@ 2015-10-06 15:07     ` Eli Zaretskii
  2015-10-06 15:48       ` Nicolas Richard
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2015-10-06 15:07 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: schwab, 21633

> From: Nicolas Richard <youngfrog@members.fsf.org>
> Date: Tue, 06 Oct 2015 14:26:32 +0200
> Cc: 21633@debbugs.gnu.org
> 
> Thanks for the information and for fixing the bug.

Would you like to write a test for this bug?

TIA





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#21633: 25.0.50; assertion failure, self-insert-command with negative argument
  2015-10-06 15:07     ` Eli Zaretskii
@ 2015-10-06 15:48       ` Nicolas Richard
  2015-10-06 16:01         ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Richard @ 2015-10-06 15:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: schwab, 21633

Eli Zaretskii <eliz@gnu.org> writes:
>> From: Nicolas Richard <youngfrog@members.fsf.org>
>> Date: Tue, 06 Oct 2015 14:26:32 +0200
>> Cc: 21633@debbugs.gnu.org
>> 
>> Thanks for the information and for fixing the bug.
>
> Would you like to write a test for this bug?

I would add

(ert-deftest core-elisp-self-insert-command-with-negative-argument ()
  "Test `self-insert-command' with a negative argument."
  (let ((last-command-event ?a))
    (should-error (self-insert-command -1))))

to test/automated/core-elisp-tests.el.

I didn't find a better place. WDYT ?

-- 
Nico.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#21633: 25.0.50; assertion failure, self-insert-command with negative argument
  2015-10-06 15:48       ` Nicolas Richard
@ 2015-10-06 16:01         ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2015-10-06 16:01 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: schwab, 21633

> From: Nicolas Richard <youngfrog@members.fsf.org>
> Cc:  schwab@suse.de,  21633@debbugs.gnu.org
> Date: Tue, 06 Oct 2015 17:48:54 +0200
> 
> > Would you like to write a test for this bug?
> 
> I would add
> 
> (ert-deftest core-elisp-self-insert-command-with-negative-argument ()
>   "Test `self-insert-command' with a negative argument."
>   (let ((last-command-event ?a))
>     (should-error (self-insert-command -1))))

Yep.

> to test/automated/core-elisp-tests.el.
> 
> I didn't find a better place. WDYT ?

I thought about cmds-tests.el, a new file for the stuff in cmds.c (a
kind-of promise for the future ;-).  But I don't insist, it's up to
you.

Thanks.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-10-06 16:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-06  9:11 bug#21633: 25.0.50; assertion failure, self-insert-command with negative argument Nicolas Richard
2015-10-06  9:42 ` Andreas Schwab
2015-10-06 12:26   ` Nicolas Richard
2015-10-06 12:44     ` Andreas Schwab
2015-10-06 15:07     ` Eli Zaretskii
2015-10-06 15:48       ` Nicolas Richard
2015-10-06 16:01         ` Eli Zaretskii
2015-10-06  9:54 ` Andreas Schwab

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.