[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Question about dumping and initialization
From: |
Jérémie Courrèges-Ang las |
Subject: |
Question about dumping and initialization |
Date: |
Thu, 14 Mar 2013 12:13:27 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) |
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
pgpTvQUj_be_y.pgp
Description: PGP signature
- Question about dumping and initialization,
Jérémie Courrèges-Ang las <=