[Openmcl-devel] Loading dumped image fails - Shared library problem?

Gary Byers gb at clozure.com
Tue Jul 1 12:18:16 UTC 2008

It's a bug (it should generally work.)

You're apparently running FreeBSD; the shared-library code for FreeBSD
and Linux is mostly shared (both platforms use ELF), but there are
some subtle differences in the way that the dynamic linker works on
FreeBSD that aren't accounted for in the function
CCL::%REOPEN-USER-LIBRARIES.  I just checked in what appears to
be a fix for that (r9858 and r9859).

There has been another problem in 1.2 that can affect this (and other
things): pointers to foreign memory are generally invalidated when an
image is saved (their type is changed to "DEAD-MACPTR") and those that
the runtime system uses are "revived" on startup.  The invalidation
wasn't happening correctly in the code in the 1.2 branch (I checked
in some fixes for that yesterday), and that could lead to cases where
a saved image would use stale pointers to foreign objects whose addresss
changed between sessions.  I'm not entirely sure how or why, but that
seems to have caused the segfault you report below.

It's generally good advice, but doing:

? (rebuild-ccl :full t)


shell> svn update

is strongly advised in this case.

On Mon, 30 Jun 2008, Hans Hübner wrote:

> Hi,
> I am trying to use an image dumped from a running application that has
> a number of shared libraries loaded (see below).  When starting the
> dumped image, I end up in the OpenMCL kernel debugger.  No backtrace
> is available.  Am I doing something wrong?  Do I need to unload shared
> libraries before dumping?
> Thanks,
> Hans
> ? ccl::*shared-libraries*
> (#<SHLIB libcrypto.so.4 #x300041892F5D> #<SHLIB libssl.so.4 #x30004189308D> #<SH
> LIB libiconv.so.3 #x30004118482D> #<SHLIB libfreetype.so.9 #x30004118497D> #<SHL
> IB libjpeg.so.9 #x300041184AED> #<SHLIB libpng.so.5 #x300041184C3D> #<SHLIB libz
> .so.3 #x300041184D7D> #<SHLIB libgd.so.4 #x300041184E7D> #<SHLIB /usr/home/hans/
> bknr-svn/thirdparty/cl-gd-0.5.6/cl-gd-glue.so #x300041184FAD> #<SHLIB /libexec/l
> d-elf.so.1 #x3000400CDE7D> #<SHLIB libc.so.6 #x3000400CDECD> #<SHLIB libthr.so.2
> #x3000400CDF1D> #<SHLIB libm.so.4 #x3000400CDF6D>)
> ? (ccl:save-application "test.core")
> alka-seltzer 56_> ccl -n -I test.core
> exception in foreign context
> Exception occurred while executing foreign code
> ? for help
> [67678] OpenMCL kernel debugger: b
> Framepointer [#x7FFFFFFFDC70] in unknown area.
> [67678] OpenMCL kernel debugger: r
> rax = 0x0000000000000000      r8  = 0x0000000000000001
> rcx = 0x0000000000000000      r9  = 0x0000000000000000
> rdx = 0x000000000000000A      r10 = 0x00000008005A7FE0
> rbx = 0x000030004003C88E      r11 = 0x0000000000000246
> rsp = 0x00007FFFFFFFDC18      r12 = 0x00003000414B9FB3
> rbp = 0x00007FFFFFFFDC70      r13 = 0x000030004007C81F
> rsi = 0x0000000800CDEEF8      r14 = 0x0000300041B1723D
> rdi = 0x00007FFFFFFFE1B0      r15 = 0x0000000000000000
> rip = 0x00000008005A7FE0   rflags = 0x0000000000010286
> [67678] OpenMCL kernel debugger:
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel

More information about the Openmcl-devel mailing list