Ok, this bug was fixed but not the actual bug I was after.
But finaly, thanks to libgc's debug message, I got it.
Actually, libgc overwrite pthread_create (and pthread_sigmask,
and a few more) to know when a new thread is started.
But this overloading is done "softly", ie. by a define in a
C heade
I'm using libgc v 7.2alpha4.
Apparently the value of GC_all_interior_pointers is 1 when initializing
the GC (so GC_old_normal_bl is not initialized) and suddenly is set to 1
so that the next call to GC_is_black_listed dereference it and thus
crash.
It's set to 0 by scm_storage_prehistory in ligui
% cat main.c
#include
#include
#include
pthread_t dumper;
static void *call_gc(void *null)
{
scm_gc();
return NULL;
}
void *thread_dumper(void *null)
{
scm_with_guile(call_gc, NULL);
return NULL;
}
int main(void)
{
while (1) {
pthread_create(&dumper, NULL, t