[plt-scheme] 3m problems on FreeBSD-7

From: Shu-yu Guo (arc at cs.uchicago.edu)
Date: Sat Nov 3 23:20:03 EDT 2007

Hello,

Having recently upgraded my machine to the FreeBSD-7 beta, I'm trying
to compile PLT Scheme from svn.

mzscheme3m gets compiled, but segfaults immediately at startup. At
first I thought it might be gcc 4.2, so I recompiled it with gcc 3.4,
and it segfaults nonetheless. It's possible that this is due to the
updated libc on FreeBSD-7, but I don't know how to make it link
against the old one to check.

Note that this does not happen with mzschemecgc, that runs fine.

After some fiddling with instrumenting printf's and gdb, it turns out
that things get screwed up after a garbage collection. The
garbage_collect function seems long and complicated, so I didn't
investigate further.

I would provide a gdb backtrace, but it doesn't really help to
illustrate the problem. So I'm going to explain in English instead:
the problem occurs on my machine at

src/mzscheme/src/hash.c:631 : table->buckets = ba;

It just happens that that's the piece of code that gets executed
immediately after the first garbage collection. I instrumented the
code to print the address of table->buckets before and after the
GC_malloc in the xsrc, and when GC_malloc calls garbage_collect, the
address gets changed. Here's a sample output:

table->buckets before = 0x2845e858
**************** collecting
table->buckets after = 0x28485888

I have no idea if that is valid behavior or not (maybe garbage
collection could move pages around), but something goes wrong during
collection since I get a segfault afterwards.

Anybody compiler hackers (Matthew?) knowledgeable around able to shed
some light on this?

Thanks,
-- 
                shu


Posted on the users mailing list.