all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: Stack allocation of Lisp objects
Date: Thu, 09 Oct 2014 00:09:37 -0700	[thread overview]
Message-ID: <543634B1.7000601@cs.ucla.edu> (raw)
In-Reply-To: <jwvzjd6eyco.fsf-monnier+emacs@gnu.org>

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	other threads:[~2014-10-09  7:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-09  3:11 Stack allocation of Lisp objects Stefan Monnier
2014-10-09  7:09 ` Paul Eggert [this message]

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

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

  git send-email \
    --in-reply-to=543634B1.7000601@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.