GNU bug report logs - #51131
29.0.50; Segfault in ERT test

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Mon, 11 Oct 2021 06:08:01 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51131 in the body.
You can then email your comments to 51131 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#51131; Package emacs. (Mon, 11 Oct 2021 06:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Helmut Eller <eller.helmut <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 11 Oct 2021 06:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Helmut Eller <eller.helmut <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; Segfault in ERT test
Date: Mon, 11 Oct 2021 08:07:34 +0200
Emacs receives a segmentation fault when executing this file:

  (ert-deftest segfault ()
    (let ((debug-on-error nil))
      (error "foo")))
  
with

  emacs -Q -batch -l /tmp/test.el -f ert-run-tests-batch-and-exit

The backtrace in gdb is very long and seems to show an endless recursion
in Fsignal:

gdb -q --args emacs -Q -batch -l /tmp/test.el -f ert-run-tests-batch-and-exit
Reading symbols from emacs...
(gdb) r
Starting program: /home/helmut/bin/emacs -Q -batch -l /tmp/test.el -f ert-run-tests-batch-and-exit
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff228c700 (LWP 10498)]
Running 1 tests (2021-10-11 08:04:00+0200, selector ‘t’)

Thread 1 "emacs" received signal SIGSEGV, Segmentation fault.
0x00005555556ff741 in signal_or_quit (error_symbol=0xfc60, 
    data=0x555556079a53, keyboard_quit=false) at eval.c:1768
1768    {
(gdb) bt 20
#0  0x00005555556ff741 in signal_or_quit
    (error_symbol=0xfc60, data=0x555556079a53, keyboard_quit=false)
    at eval.c:1768
#1  0x0000555555599594 in Fsignal (error_symbol=<optimized out>, 
    error_symbol <at> entry=0xfc60, data=<optimized out>) at eval.c:1750
#2  0x000055555559974d in xsignal (data=<optimized out>, error_symbol=0xfc60)
    at lisp.h:4152
#3  xsignal2
    (error_symbol=error_symbol <at> entry=0xfc60, arg1=arg1 <at> entry=0xdb00, arg2=arg2 <at> entry=0x555555dc33a5) at eval.c:1913
#4  0x00005555555987f0 in wrong_type_argument
    (predicate=predicate <at> entry=0xdb00, value=value <at> entry=0x555555dc33a5)
    at data.c:143
#5  0x000055555559985e in CHECK_TYPE (x=0x555555dc33a5, predicate=0xdb00, ok=0)
    at lisp.h:759
#6  CHECK_SYMBOL (x=0x555555dc33a5) at lisp.h:1028
#7  specbind (symbol=0x555555dc33a5, value=<optimized out>) at eval.c:3542
#8  0x00005555556ffbf5 in signal_or_quit
    (error_symbol=<optimized out>, data=0x555556079a23, keyboard_quit=<optimized out>) at lisp.h:1002
#9  0x0000555555599594 in Fsignal (error_symbol=<optimized out>, 
    error_symbol <at> entry=0xfc60, data=<optimized out>) at eval.c:1750
#10 0x000055555559974d in xsignal (data=<optimized out>, error_symbol=0xfc60)
    at lisp.h:4152
#11 xsignal2
    (error_symbol=error_symbol <at> entry=0xfc60, arg1=arg1 <at> entry=0xdb00, arg2=arg2 <at> entry=0x555555dc33a5) at eval.c:1913
#12 0x00005555555987f0 in wrong_type_argument
    (predicate=predicate <at> entry=0xdb00, value=value <at> entry=0x555555dc33a5)
    at data.c:143
#13 0x000055555559985e in CHECK_TYPE (x=0x555555dc33a5, predicate=0xdb00, ok=0)
    at lisp.h:759
#14 CHECK_SYMBOL (x=0x555555dc33a5) at lisp.h:1028
#15 specbind (symbol=0x555555dc33a5, value=<optimized out>) at eval.c:3542
#16 0x00005555556ffbf5 in signal_or_quit
    (error_symbol=<optimized out>, data=0x5555560799f3, keyboard_quit=<optimized out>) at lisp.h:1002
#17 0x0000555555599594 in Fsignal (error_symbol=<optimized out>, 
    error_symbol <at> entry=0xfc60, data=<optimized out>) at eval.c:1750
#18 0x000055555559974d in xsignal (data=<optimized out>, error_symbol=0xfc60)
    at lisp.h:4152
#19 xsignal2
    (error_symbol=error_symbol <at> entry=0xfc60, arg1=arg1 <at> entry=0xdb00, arg2=arg2 <at> entry=0x555555dc33a5) at eval.c:1913
(More stack frames follow...)
(gdb) 


Helmut


In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2021-10-06 built on caladan
Repository revision: 597b6deb294ace9178c8927f83ec08b92597b347
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)

Configured using:
 'configure --with-xpm=ifavailable --with-jpeg=ifavailable
 --with-gif=ifavailable --with-tiff=ifavailable'

Configured features:
CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ LIBSELINUX
LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG SECCOMP SOUND
THREADS TOOLKIT_SCROLL_BARS X11 XDBE XIM GTK3 ZLIB

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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51131; Package emacs. (Mon, 11 Oct 2021 09:16:02 GMT) Full text and rfc822 format available.

Message #8 received at 51131 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: 51131 <at> debbugs.gnu.org
Subject: Re: bug#51131: 29.0.50; Segfault in ERT test
Date: Mon, 11 Oct 2021 11:14:57 +0200
Helmut Eller <eller.helmut <at> gmail.com> writes:

> Emacs receives a segmentation fault when executing this file:
>
>   (ert-deftest segfault ()
>     (let ((debug-on-error nil))
>       (error "foo")))
>
> with
>
>   emacs -Q -batch -l /tmp/test.el -f ert-run-tests-batch-and-exit

This should now be fixed in emacs-28 (and on the trunk once the fix is
merged).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 51131 <at> debbugs.gnu.org and Helmut Eller <eller.helmut <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 11 Oct 2021 09:16:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51131; Package emacs. (Mon, 11 Oct 2021 12:41:02 GMT) Full text and rfc822 format available.

Message #13 received at 51131 <at> debbugs.gnu.org (full text, mbox):

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 51131 <at> debbugs.gnu.org, Helmut Eller <eller.helmut <at> gmail.com>
Subject: Re: bug#51131: 29.0.50; Segfault in ERT test
Date: Mon, 11 Oct 2021 14:39:41 +0200
Am Mo., 11. Okt. 2021 um 11:16 Uhr schrieb Lars Ingebrigtsen <larsi <at> gnus.org>:
>
> Helmut Eller <eller.helmut <at> gmail.com> writes:
>
> > Emacs receives a segmentation fault when executing this file:
> >
> >   (ert-deftest segfault ()
> >     (let ((debug-on-error nil))
> >       (error "foo")))
> >
> > with
> >
> >   emacs -Q -batch -l /tmp/test.el -f ert-run-tests-batch-and-exit
>
> This should now be fixed in emacs-28 (and on the trunk once the fix is
> merged).

I don't think that's the right fix. I added backtrace support in batch
mode primarily for unit tests running on CI systems; this is exactly
the situation where I want backtrace-on-error-noninteractive to be t.
Can we revert commit 07edc28bdbfeeaeb1008b4fe21bfda586feae562 and find
a better way?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51131; Package emacs. (Mon, 11 Oct 2021 12:58:02 GMT) Full text and rfc822 format available.

Message #16 received at 51131 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: 51131 <at> debbugs.gnu.org, Helmut Eller <eller.helmut <at> gmail.com>
Subject: Re: bug#51131: 29.0.50; Segfault in ERT test
Date: Mon, 11 Oct 2021 14:56:48 +0200
Philipp Stephani <p.stephani2 <at> gmail.com> writes:

> I don't think that's the right fix. I added backtrace support in batch
> mode primarily for unit tests running on CI systems; this is exactly
> the situation where I want backtrace-on-error-noninteractive to be t.
> Can we revert commit 07edc28bdbfeeaeb1008b4fe21bfda586feae562 and find
> a better way?

ert wants to collect the backtrace, but the test itself subverted that
(by setting debug-on-error to nil and then having an error in the test).

I don't see why Emacs should output a backtrace inside a test like that.

But Emacs will still output

Error running tests
  backtrace()
  #f(compiled-function () #<bytecode -0x1fecd686855e18f0>)()
  ert-run-tests-batch-and-exit()
  command-line-1(("-l" "/tmp/test.el" "-f" "ert-run-tests-batch-and-exit"))
  command-line()
  normal-top-level()

at the end.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 09 Nov 2021 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 141 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.