Posting again, didn't see it show up on the list.

..I've seen the strlen() seg fault problem by searching, 
just no solutions.  The string returned in RETVAL is null terminated, 
so I don't understand.  


On Thu, 2006-07-13 at 14:56 -0500, Scott T. Hildreth wrote:
> ...we are installing 64bit Suse boxes.  I normally compile our own Perl,
> leaving the vendor Perl alone.  I don't think this will help with this 
> problem though (unless I compile as 32 bit).  The following XS code
> fails in libc - strlen(),
> 
> =============================================================================
> 
> 1180    {
> (gdb) n
> 1181        dXSARGS;
> (gdb) n
> 1182        if (items != 2)
> (gdb) n
> 1188            dXSTARG;
> (gdb) n
> 1190            if (sv_derived_from(ST(0), "FMTPtr")) {
> (gdb) n
> 1191                IV tmp = SvIV((SV*)SvRV(ST(0)));
> (gdb) n
> 1197            if (sv_derived_from(ST(1), "FMT_FLDPtr")) {
> (gdb) n
> 1198                IV tmp = SvIV((SV*)SvRV(ST(1)));
> (gdb) n
> 419             RETVAL = (char *)fmt_get_fld_location(fmt, fld);
> (gdb) p tmp
> $4 = 11516288
> (gdb) n 
> 1206            sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
> (gdb) p RETVAL
> No symbol "RETVAL" in current context.
> (gdb) s
> 419             RETVAL = (char *)fmt_get_fld_location(fmt, fld);
> (gdb) s
> 1206            sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
> (gdb) s
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x00002ad1795286d0 in strlen () from /lib64/libc.so.6
> 
> =================================================================================
> 
> ...at first I thought it was the threaded-64 bit Perls, but it seg
> faults  on a non-threaded version as well.  It runs fine on a 32 bit 
> server.  
> 
> I am really hopping someone has run into this, any help would be much
> appreciated.
> 
> 
>                                       STH
> 
> 
> 
>  
-- 
Scott T. Hildreth <[EMAIL PROTECTED]>

Reply via email to