FAQ
Hi here is a bug report from a strange segfault in per58.dll

context :
use test.pm in apache startup file causes a segfault
test.pm is simply a plain parse string of a skinny xml doc.

perl wants to croak something but it does not get out
and there is a segfault

here is a copy of the message already sent to modperl list
where nobody could find an answer


besides the fact that the segfault happens with XML::LibXML
in apache modperl context
it seems that segfaults perl58.dll itself

thanks
pascal
---------------------------------------------

De : pascal.barbedor@laposte.net
A : stas
Cc : modperl
Date : 31/01/2003 12:31
Objet : Re: [MP2] bug report startup and XML::LibXML


perl 58 from cpan compiled debug with vc6 on win32
apache 2.0.44
mod_perl 1.99_08
and as suggested :
LIBXML2.DLL VERSION 2.4.26
XML::LibXML version 1.52
I've tested with libxml2-2.4.23 and XML::LibXML 1.53 on linux
and it works
just fine.

I tested it with libxml2-2.4.23 and XML::LibXML 1.52
and it still segfaults.


this looks suspicious as address: 0xabababab, as you have
traced it. So it
could be a bug in the ActiveState's perl or is it a standard
one?
it is perl 58 cpan source I have rebuilt all myself debug
but the bug also happens with asperl 58

here is more precision, I have followed the trace starting at
perl_croak :

segfault
Perl_sv_setpvn(interpreter * 0x00e7f024, sv * 0xabababab,
Perl_sv_vsetpvfn(interpreter * 0x00e7f024, sv * 0xabababab,
Perl_vmess(interpreter * 0x00e7f024, const char * 0x2818fac0
Perl_vcroak(interpreter * 0x00e7f024, const char * 0x2818fac
Perl_croak(interpreter * 0x00e7f024, const char * 0x2818fac0
`string')
[...]

----------------------------------------------------------------
-----------
in perl_croak
Perl_croak(interpreter * 0x00e1a024, const char * 0x2818fac0
`string') line 1350 + 17 bytes

[...]
void
Perl_croak(pTHX_ const char *pat, ...)
{
va_list args;
va_start(args, pat);
vcroak(pat, &args); <<<< LINE CALLED
/* NOTREACHED */
va_end(args);
}

[...]

variable state:

+ &args 0x0006efe4
+ args 0x0006eff8 "p"
+ pat 0x2818fac0 "Bizarre SvTYPE [%ld]"



----------------------------------------------------------------
----

in perl_vcroak

Perl_vcroak(interpreter * 0x00e1a024, const char * 0x2818fac0
`string', char * * 0x0006efe4) line 1241 + 17 bytes


void
Perl_vcroak(pTHX_ const char* pat, va_list *args)
{
char *message;
HV *stash;
GV *gv;
CV *cv;
SV *msv;
STRLEN msglen;

if (pat) {
msv = vmess(pat, args); <<<<<<LINE CALLED pat and
args unchanged
if (PL_errors && SvCUR(PL_errors)) {
sv_catsv(PL_errors, msv);
message = SvPV(PL_errors, msglen);
SvCUR_set(PL_errors, 0);
}
else



in perl_vmess
Perl_vmess(interpreter * 0x00e7f024, const char * 0x2818fac0
`string', char * * 0x0006efe4) line 1096


[...]
Perl_vmess(pTHX_ const char *pat, va_list *args)
{
(***) SV *sv = mess_alloc();
static char dgd[] = " during global destruction.\n";
COP *cop;

sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null
(bool*));
if (!SvCUR(sv) || *(SvEND(sv) - 1) != '\n') {

/*
[...]


( *** )sv is set to point to 0xabababab at this point of
program
so maybe the mess_alloc() function has failed in some way



inside mess_alloc():

STATIC SV *
S_mess_alloc(pTHX)
{
1 SV *sv;
2 XPVMG *any;

3 if (!PL_dirty)
return sv_2mortal(newSVpvn("",0));

4 if (PL_mess_sv)
return PL_mess_sv;

/* Create as PVMG now, to avoid any upgrading later */
New(905, sv, 1, SV);
Newz(905, any, 1, XPVMG);
SvFLAGS(sv) = SVt_PVMG;
SvANY(sv) = (void*)any;
SvREFCNT(sv) = 1 << 30; /* practically infinite */
PL_mess_sv = sv;
return sv;
}


at line 1 sv gets the following value :
- sv 0x00e7f470
sv_any 0xabababab
sv_refcnt 2880154539
sv_flags 2880154539


function is exited by line 4 PL_mess_sv but I dont see its
value anywhere


hope this is clear
thanks

pascal

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedFeb 3, '03 at 12:25p
activeFeb 3, '03 at 12:25p
posts1
users1
websiteperl.org

1 user in discussion

Pascalbarbedor: 1 post

People

Translate

site design / logo © 2022 Grokbase