GNU bug report logs - #62504
30.0.50; SEGFAULT On M-x

Previous Next

Package: emacs;

Reported by: Jacob Faibussowitsch <jacob.fai <at> gmail.com>

Date: Tue, 28 Mar 2023 15:27:01 UTC

Severity: normal

Found in version 30.0.50

Done: Stefan Kangas <stefankangas <at> gmail.com>

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 62504 in the body.
You can then email your comments to 62504 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#62504; Package emacs. (Tue, 28 Mar 2023 15:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jacob Faibussowitsch <jacob.fai <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 28 Mar 2023 15:27:02 GMT) Full text and rfc822 format available.

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

From: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; SEGFAULT On M-x
Date: Tue, 28 Mar 2023 11:25:49 -0400
[Message part 1 (text/plain, inline)]
Hello,

This bug is twofold and appears to be related to bug#62446 and bug#61917. I produce a much smaller reproducer that generates the same kind of error as bug#61917, namely `(wrong-number-of-arguments #<subr signal> 2)`. Segfaults only occur after the following commit:

commit 52b67740d10df8ca539fdc2c7d50283997683141
Author: Mattias Engdegård <mattiase <at> acm.org>
Date:   Sat Mar 25 15:38:00 2023 +0100

    Generalise a LAP optimisation rule

    * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
    Accept (stack-set 1) as equivalent to (discardN-preserve-tos 1) in a
    rule previously overlooked.  This is usually beneficial in code size
    and almost always shortens dynamic paths.


Common setup:

1. mkdir repro
2. Put attached init.el and main.c inside (technically, main.c need not be in repro)

———

To reproduce bug#61917:

1. git checkout master
2. configure --with-native-compilation \
  --without-x \
  --without-ns \
  --without-compress-install \
  --with-native-compilation \
  --with-json \
  --with-tree-sitter
3. make bootstrap
4. emacs  --init-directory ../repro
5. Check messages, and ye shall find the bug message.

——— 

To reproduce segfault:

1. git checkout 52b67740d10df8ca539fdc2c7d50283997683141
2. Perform same configure and build commands as above.
3. emacs --init-directory ../repro ../repro/main.c (loading main.c is *required*, the segfault does not fire otherwise)
4. (In emacs) M-x
5. Fatal error 11: Segmentation fault

Best regards,

Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)
[main.c (application/octet-stream, attachment)]
[init.el (application/octet-stream, attachment)]
[config.log (application/octet-stream, attachment)]
[Message part 5 (text/plain, inline)]



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62504; Package emacs. (Tue, 28 Mar 2023 17:02:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jacob Faibussowitsch <jacob.fai <at> gmail.com>, Andrea Corallo <akrl <at> sdf.org>
Cc: 62504 <at> debbugs.gnu.org
Subject: Re: bug#62504: 30.0.50; SEGFAULT On M-x
Date: Tue, 28 Mar 2023 20:01:01 +0300
> From: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
> Date: Tue, 28 Mar 2023 11:25:49 -0400
> 
> This bug is twofold and appears to be related to bug#62446 and bug#61917. I produce a much smaller reproducer that generates the same kind of error as bug#61917, namely `(wrong-number-of-arguments #<subr signal> 2)`. Segfaults only occur after the following commit:
> 
> commit 52b67740d10df8ca539fdc2c7d50283997683141
> Author: Mattias Engdegård <mattiase <at> acm.org>
> Date:   Sat Mar 25 15:38:00 2023 +0100
> 
>     Generalise a LAP optimisation rule
> 
>     * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
>     Accept (stack-set 1) as equivalent to (discardN-preserve-tos 1) in a
>     rule previously overlooked.  This is usually beneficial in code size
>     and almost always shortens dynamic paths.
> 
> 
> Common setup:
> 
> 1. mkdir repro
> 2. Put attached init.el and main.c inside (technically, main.c need not be in repro)
> 
> ———
> 
> To reproduce bug#61917:
> 
> 1. git checkout master
> 2. configure --with-native-compilation \
>   --without-x \
>   --without-ns \
>   --without-compress-install \
>   --with-native-compilation \
>   --with-json \
>   --with-tree-sitter
> 3. make bootstrap
> 4. emacs  --init-directory ../repro
> 5. Check messages, and ye shall find the bug message.
> 
> ——— 
> 
> To reproduce segfault:
> 
> 1. git checkout 52b67740d10df8ca539fdc2c7d50283997683141
> 2. Perform same configure and build commands as above.
> 3. emacs --init-directory ../repro ../repro/main.c (loading main.c is *required*, the segfault does not fire otherwise)
> 4. (In emacs) M-x
> 5. Fatal error 11: Segmentation fault

Thanks.

Andrea, maybe this will help you investigate the issue.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62504; Package emacs. (Wed, 29 Mar 2023 08:50:01 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 62504 <at> debbugs.gnu.org, Jacob Faibussowitsch <jacob.fai <at> gmail.com>
Subject: Re: bug#62504: 30.0.50; SEGFAULT On M-x
Date: Wed, 29 Mar 2023 08:49:52 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
>> Date: Tue, 28 Mar 2023 11:25:49 -0400
>> 
>> This bug is twofold and appears to be related to bug#62446 and bug#61917. I produce a much smaller reproducer that generates the same kind of error as bug#61917, namely `(wrong-number-of-arguments #<subr signal> 2)`. Segfaults only occur after the following commit:
>> 
>> commit 52b67740d10df8ca539fdc2c7d50283997683141
>> Author: Mattias Engdegård <mattiase <at> acm.org>
>> Date:   Sat Mar 25 15:38:00 2023 +0100
>> 
>>     Generalise a LAP optimisation rule
>> 
>>     * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
>>     Accept (stack-set 1) as equivalent to (discardN-preserve-tos 1) in a
>>     rule previously overlooked.  This is usually beneficial in code size
>>     and almost always shortens dynamic paths.
>> 
>> 
>> Common setup:
>> 
>> 1. mkdir repro
>> 2. Put attached init.el and main.c inside (technically, main.c need not be in repro)
>> 
>> ———
>> 
>> To reproduce bug#61917:
>> 
>> 1. git checkout master
>> 2. configure --with-native-compilation \
>>   --without-x \
>>   --without-ns \
>>   --without-compress-install \
>>   --with-native-compilation \
>>   --with-json \
>>   --with-tree-sitter
>> 3. make bootstrap
>> 4. emacs  --init-directory ../repro
>> 5. Check messages, and ye shall find the bug message.
>> 
>> ——— 
>> 
>> To reproduce segfault:
>> 
>> 1. git checkout 52b67740d10df8ca539fdc2c7d50283997683141
>> 2. Perform same configure and build commands as above.
>> 3. emacs --init-directory ../repro ../repro/main.c (loading main.c is *required*, the segfault does not fire otherwise)
>> 4. (In emacs) M-x
>> 5. Fatal error 11: Segmentation fault
>
> Thanks.
>
> Andrea, maybe this will help you investigate the issue.

Yep, noted thanks.

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62504; Package emacs. (Wed, 29 Mar 2023 12:30:02 GMT) Full text and rfc822 format available.

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

From: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 62504 <at> debbugs.gnu.org
Subject: Re: bug#62504: 30.0.50; SEGFAULT On M-x
Date: Wed, 29 Mar 2023 08:29:06 -0400
Looks like I jumped the gun on blaming the segfaults on 52b67740d10df8ca539fdc2c7d50283997683141. They still happen before it. Interestingly they only appear to happen if the `(wrong-number-of-arguments #<subr signal> 2)` error has not fired.

For example, my setup lazy-loads many packages (among them yasnippet and auto-complete) on an idle timer or eagerly if I invoke/reference an auto-loaded symbol. If I wait for the idle timer to lazy load e.g. yasnippet then I get `(wrong-number-of-arguments #<subr signal> 2)`. But if I try to eagerly load yasnippet via auto-load then I get a segfault instead.

I don’t know how to reliably reproduce this unfortunately...

Best regards,

Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)

> On Mar 29, 2023, at 04:49, Andrea Corallo <akrl <at> sdf.org> wrote:
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
>>> From: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
>>> Date: Tue, 28 Mar 2023 11:25:49 -0400
>>> 
>>> This bug is twofold and appears to be related to bug#62446 and bug#61917. I produce a much smaller reproducer that generates the same kind of error as bug#61917, namely `(wrong-number-of-arguments #<subr signal> 2)`. Segfaults only occur after the following commit:
>>> 
>>> commit 52b67740d10df8ca539fdc2c7d50283997683141
>>> Author: Mattias Engdegård <mattiase <at> acm.org>
>>> Date:   Sat Mar 25 15:38:00 2023 +0100
>>> 
>>>    Generalise a LAP optimisation rule
>>> 
>>>    * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
>>>    Accept (stack-set 1) as equivalent to (discardN-preserve-tos 1) in a
>>>    rule previously overlooked.  This is usually beneficial in code size
>>>    and almost always shortens dynamic paths.
>>> 
>>> 
>>> Common setup:
>>> 
>>> 1. mkdir repro
>>> 2. Put attached init.el and main.c inside (technically, main.c need not be in repro)
>>> 
>>> ———
>>> 
>>> To reproduce bug#61917:
>>> 
>>> 1. git checkout master
>>> 2. configure --with-native-compilation \
>>>  --without-x \
>>>  --without-ns \
>>>  --without-compress-install \
>>>  --with-native-compilation \
>>>  --with-json \
>>>  --with-tree-sitter
>>> 3. make bootstrap
>>> 4. emacs  --init-directory ../repro
>>> 5. Check messages, and ye shall find the bug message.
>>> 
>>> ——— 
>>> 
>>> To reproduce segfault:
>>> 
>>> 1. git checkout 52b67740d10df8ca539fdc2c7d50283997683141
>>> 2. Perform same configure and build commands as above.
>>> 3. emacs --init-directory ../repro ../repro/main.c (loading main.c is *required*, the segfault does not fire otherwise)
>>> 4. (In emacs) M-x
>>> 5. Fatal error 11: Segmentation fault
>> 
>> Thanks.
>> 
>> Andrea, maybe this will help you investigate the issue.
> 
> Yep, noted thanks.
> 
>  Andrea





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62504; Package emacs. (Wed, 29 Mar 2023 15:28:02 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 62504 <at> debbugs.gnu.org
Subject: Re: bug#62504: 30.0.50; SEGFAULT On M-x
Date: Wed, 29 Mar 2023 15:27:35 +0000
Jacob Faibussowitsch <jacob.fai <at> gmail.com> writes:

> Looks like I jumped the gun on blaming the segfaults on
> 52b67740d10df8ca539fdc2c7d50283997683141. They still happen before
> it. Interestingly they only appear to happen if the
> `(wrong-number-of-arguments #<subr signal> 2)` error has not fired.
>
> For example, my setup lazy-loads many packages (among them yasnippet
> and auto-complete) on an idle timer or eagerly if I invoke/reference
> an auto-loaded symbol. If I wait for the idle timer to lazy load
> e.g. yasnippet then I get `(wrong-number-of-arguments #<subr signal>
> 2)`. But if I try to eagerly load yasnippet via auto-load then I get a
> segfault instead.
>
> I don’t know how to reliably reproduce this unfortunately...
>
> Best regards,

Please try now after I reverted 4a7a0c9a9f5 263d6c38539.

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62504; Package emacs. (Wed, 29 Mar 2023 15:32:02 GMT) Full text and rfc822 format available.

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

From: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 62504 <at> debbugs.gnu.org
Subject: Re: bug#62504: 30.0.50; SEGFAULT On M-x
Date: Wed, 29 Mar 2023 11:31:36 -0400
Segfaults and errors are gone with this change.

Best regards,

Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)

> On Mar 29, 2023, at 11:27, Andrea Corallo <akrl <at> sdf.org> wrote:
> 
> Jacob Faibussowitsch <jacob.fai <at> gmail.com> writes:
> 
>> Looks like I jumped the gun on blaming the segfaults on
>> 52b67740d10df8ca539fdc2c7d50283997683141. They still happen before
>> it. Interestingly they only appear to happen if the
>> `(wrong-number-of-arguments #<subr signal> 2)` error has not fired.
>> 
>> For example, my setup lazy-loads many packages (among them yasnippet
>> and auto-complete) on an idle timer or eagerly if I invoke/reference
>> an auto-loaded symbol. If I wait for the idle timer to lazy load
>> e.g. yasnippet then I get `(wrong-number-of-arguments #<subr signal>
>> 2)`. But if I try to eagerly load yasnippet via auto-load then I get a
>> segfault instead.
>> 
>> I don’t know how to reliably reproduce this unfortunately...
>> 
>> Best regards,
> 
> Please try now after I reverted 4a7a0c9a9f5 263d6c38539.
> 
>  Andrea





Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Mon, 11 Sep 2023 23:58:02 GMT) Full text and rfc822 format available.

Notification sent to Jacob Faibussowitsch <jacob.fai <at> gmail.com>:
bug acknowledged by developer. (Mon, 11 Sep 2023 23:58:02 GMT) Full text and rfc822 format available.

Message #25 received at 62504-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Jacob Faibussowitsch <jacob.fai <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 62504-done <at> debbugs.gnu.org,
 Andrea Corallo <akrl <at> sdf.org>
Subject: Re: bug#62504: 30.0.50; SEGFAULT On M-x
Date: Mon, 11 Sep 2023 16:56:55 -0700
Jacob Faibussowitsch <jacob.fai <at> gmail.com> writes:

> Segfaults and errors are gone with this change.

It seems like this issue was fixed, but it was left open in the bug
tracker.  I'm therefore closing it now.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 10 Oct 2023 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 198 days ago.

Previous Next


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