emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stack allocation of Lisp objects


From: Paul Eggert
Subject: Re: Stack allocation of Lisp objects
Date: Thu, 09 Oct 2014 00:09:37 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2

Stefan Monnier wrote:

Apparently there's an AUTO_STRING somewhere which we stick into a heap
allocated cons cell.

A plausible scenario is that you got bitten by a GCC bug, where GCC ignores ___attribute__ ((aligned (8))) on your platform. At least, that's how I reproduced the problem on x86. I filed a GCC bug report <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63495>.

If I'm right, the GCC bug cascaded into an Emacs portability bug: Emacs should use stack-based strings only if stack-base cons also works, as otherwise STACK_CONS could create a heap-based cons cell that points to a stack-based string, the symptom you observed. I fixed that bug in Emacs trunk bzr 118080.

Because of this fix, Emacs no longer uses stack-based allocation on x86 + recent GCC, which is a bit of a downer. It should still work with older GCC though, and I expect the GCC folks will fix the bug in newer GCC at some point.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]