unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Question about dumping and initialization
@ 2013-03-14 11:13 Jérémie Courrèges-Anglas
  2013-03-14 21:16 ` Paul Eggert
  0 siblings, 1 reply; 4+ messages in thread
From: Jérémie Courrèges-Anglas @ 2013-03-14 11:13 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1567 bytes --]

Hi folks,

I'm currently trying to make Emacs use my system's malloc to build 24.3
(my system is OpenBSD).  In order to achieve this, I force
system_malloc=yes in the configure script; the build fails right at
./temacs startup time.

Suspecting a problem with malloc randomization (which is on for all
executables on OpenBSD), I #define USE_LSB_TAG 1, hoping to avoid
pointer mangling.  This works rather well and leads to temacs dumping
successfully.

Sadly the produced bootstrap-emacs isn't usable and fails with segfaults
in alloc.c.  I'm 99% sure that those segfaults are due to file-global
variables that either:
- aren't reset by temacs at dump time or
- aren't properly re-initialized the dumped bootstrap-emacs executable
(I've used a hack to make emacs reset some of those variables at
startup; each time I re-initialized a new variable, the dumped
executable could run a bit longer.  The first variable that needed this
treatment was src/alloc.c:float_free_list).

I don't know much about Emacs internals but I'd rather go with the
second reason.  I've tested a bit temacs (CANNOT_DUMP=yes in
src/Makefile) and even though it is of course very slow at startup
time, it seems rather stable so far.  Thus I think I'm on the right
road.

So, has any of you already met this problem, and if so, could you please
give me hints about where I should look next?

Thank you for your attention,
-- 
Jérémie Courrèges-Anglas - Emacs OpenBSD port maintainer
GPG Key fingerprint: 61DB D9A0 00A4 67CF 2A90  8961 6191 8FBF 06A1 1494

[-- Attachment #2: Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-15  1:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-14 11:13 Question about dumping and initialization Jérémie Courrèges-Anglas
2013-03-14 21:16 ` Paul Eggert
2013-03-14 22:36   ` Jérémie Courrèges-Anglas
2013-03-15  1:35     ` Paul Eggert

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).