GNU bug report logs -
#46824
28.0.50; nativecomp crash with cl-block/cl-defun
Previous Next
Reported by: Aaron Jensen <aaronjensen <at> gmail.com>
Date: Sun, 28 Feb 2021 00:35:01 UTC
Severity: normal
Found in version 28.0.50
Done: Andrea Corallo <akrl <at> sdf.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Sun, Feb 28, 2021 at 12:35 AM Aaron Jensen <aaronjensen <at> 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
This bug report was last modified 4 years and 83 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.