unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@gmail.com>
To: Aaron Jensen <aaronjensen@gmail.com>
Cc: 46824@debbugs.gnu.org, Andrea Corallo <akrl@sdf.org>
Subject: bug#46824: 28.0.50; nativecomp crash with cl-block/cl-defun
Date: Sun, 28 Feb 2021 06:13:59 +0000	[thread overview]
Message-ID: <CAOqdjBeA6M5OZ7cXkv+g3yRZJ0qFZxEyEhSd84Fmim+FdpMbWQ@mail.gmail.com> (raw)
In-Reply-To: <m1o8g53u8x.fsf@gmail.com>

On Sun, Feb 28, 2021 at 12:35 AM Aaron Jensen <aaronjensen@gmail.com> wrote:
> This originally came from straight.el. It exhibited by attempting to
> invoke something as a function that was not a function, causing an
> error. In narrowing the repro down, it started to crash. It can probably
> get more narrow than this, but pretty much everything I try to
> change/tweak causes it to no longer crash.
>

First, I can reproduce it, so if further debug information is
required, I can probably help.

At first glance, it looks like we're calling _setjmp through a
function pointer without telling gcc that it is a function that may
return twice. This causes gcc to generate code which assumes the stack
frame is unchanged between the two returns of _setjmp, when it
actually isn't, leading to a segfault after the second return.

It used to be the case that all (well, most ...) variables in a
function that calls _setjmp had to be marked volatile to avoid this.
The current way of avoiding the problem is to use gcc's __attribute__
to tell gcc a function may return twice. We're not doing either, so we
run into the stack corruption problem.

Andrea, is it possible to modify the code so _setjmp is called
directly rather than through a function pointer?

Pip





  reply	other threads:[~2021-02-28  6:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-28  0:34 bug#46824: 28.0.50; nativecomp crash with cl-block/cl-defun Aaron Jensen
2021-02-28  6:13 ` Pip Cet [this message]
2021-02-28  6:36   ` Pip Cet
2021-02-28 23:31     ` Aaron Jensen
2021-03-01  9:02     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-01 13:02       ` Pip Cet
2021-03-01 17:04         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-02  9:16           ` Pip Cet
2021-03-02 13:27             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-02 13:27             ` Eli Zaretskii
2021-03-02 14:02               ` Pip Cet
2021-03-02 15:22                 ` Eli Zaretskii
2021-03-02 15:42                   ` Eli Zaretskii
2021-03-03 19:39                 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-04  7:22                   ` Pip Cet
2021-03-04  7:38                     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOqdjBeA6M5OZ7cXkv+g3yRZJ0qFZxEyEhSd84Fmim+FdpMbWQ@mail.gmail.com \
    --to=pipcet@gmail.com \
    --cc=46824@debbugs.gnu.org \
    --cc=aaronjensen@gmail.com \
    --cc=akrl@sdf.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).