lang/perl5.12 segfault (amd64 - 8-STABLE)

Janne Snabb snabb at epipe.com
Sat Jul 17 09:23:21 UTC 2010


On Sat, 17 Jul 2010, Janne Snabb wrote:

> It is somehow related to the "Perl_debug_log" which is the first
> argument of PerlIO_printf. But I can not figure out why, too many
> layers of #defines and calls within calls.

The problem seems to go away when threads are disabled.

The problematic line 311 in util.c expands to quite a horrible mess
(found this out by doing make util.i):

(void)( { if ((PL_curinterp)) { PerlInterpreter* my_perl __attribute__((unused)) = ((PerlInterpreter *)pthread_getspecific(PL_thr_key)); if (((my_perl->Idebug) & 0x00000080)) {(my_perl->Idebug)&=~0x00000080; PerlIO_printf(Perl_PerlIO_stderr(my_perl), "0x%""lx"": (%05ld) calloc %ld x %ld bytes\n",(UV)(ptr),(long)(my_perl->Ian)++,(long)count,(long)total_size); (my_perl->Idebug)|=0x00000080;} } } );

The problem is that my_perl here is NULL pointer. PL_thr_key which
is given to pthread_getspecific() to get my_perl is zero.

(gdb) p my_perl
$1 = (PerlInterpreter *) 0x0
(gdb) p PL_thr_key
$2 = 0
(gdb)

Someone who understands the perl threading internals needs to figure
this out.

--
Janne Snabb / EPIPE Communications
snabb at epipe.com - http://epipe.com/


More information about the freebsd-ports mailing list