segfault in builtins-thread.c

Kenny MacDermid <[email protected]> Thu, 20 May 2004 11:10:17 -0300
Newsgroups gmane.comp.lang.prothon.devel
Message-ID <[email protected]>
Hey'a Mark,

I was wondering what version of the APR are you compiling
against? I've tried 0.9.4 and 0.9.5 (from svn), against your
0.0.6 and current and I still seem to get segfaults pretty
much every other time I run it against Bind.pr, Threads.pr and
others.

They are kinda a pain to debug, as gdb causes other problems
when you try to run apr stuff inside it. On the other hand,
the core files seem to pretty consistently point towards:

builtins-thread.c line 98:

#0  register_thread (this_thread=0x809cf10) at builtins-thread.c:98
98              pr_thread_p thread_ptr    = res->data.ptr;

now a 'print res' at this point gives:
$1 = 0x0

So it appears that res is coming back null from:
obj_p res = new_thread_object;
and then trying to be accessed.

Just a heads up, I'll try adding some debugging around
new_thread_object and see if it's being changed or overwritten
tonight. Or I might just electric-fence it and see what
happens.

Kenny

(PS: pls reply to list only)

System Setup:

Linux:    2.4.25-gentoo-r1
APR:      0.9.5
bison:    1.875
gcc:      3.3.3
gnu make: 3.80

Configure:
configure --prefix=/tmp/prothon

Make:
make all install

Run:
/tmp/prothon/bin/prothon pr/test/Bind.pr