Hello,

Solaris 2.[89], perl 5.8.[35], net-snmp 5.1.2, 5.2.1.2 etc.

when using async bulkwalk I get bus error in do_clean_named_objs. I've
been chasing this bug for some hours. The problems seems to be that in
__push_cb_args called from _bulkwalk_finish the macro PUSHMARK(sp)
writes the number 3 into an xgv_gp referring to a sub in Exporter.pm.
do_clean_named_objs does not like that at all on exit and core dumps.

do_clean_named_objs get bus error while studying a SV at 0x3fa19c
poining to a sv_any at 0x1f2fd8 with a xgv_gp of value 3.

(gdb) p sv
$207 = (SV *) 0x3fa19c
(gdb) p *$
$208 = {sv_any = 0x1f2fd8, sv_refcnt = 1, sv_flags = 24589}
(gdb) p (((XPVGV*)(sv)->sv_any)->xgv_gp)
$209 = (GP *) 0x3
(gdb) 

I do get that address repeatedly whenever I rerun the program so I when
Ilook at the address before the PUSHMARK(sp) erases the memory:

(gdb) p (((XPVGV*)0x1f2fd8)->xgv_gp)
$210 = (GP *) 0x402538
(gdb) p *(((XPVGV*)0x1f2fd8)->xgv_gp)
$211 = {gp_sv = 0x3fa154, gp_refcnt = 1, gp_io = 0x0, gp_form = 0x0, gp_av = 
0x0, gp_hv = 0x0, gp_egv = 0x3fa19c, gp_cv = 0x3fa184, gp_cvgen = 0, 
  gp_flags = 0, gp_line = 65, gp_file = 0x217ec0 
"/local/net/perl/5.8.5-debug/lib/5.8.5/Exporter.pm"}

It seems like that somehow PL_markstack_ptr overwrites an sub in
Exporter.pm. I try to find our how this happens:

Using gdb to breaking in _bulkwalk_finish and looking at
PL_markstack_ptr, the pointer starts out as 0x1f3034, and then
decreases 4 bytes every _bulkwalk_finish until it PL_markstack_ptr into
the area pointed by the sv_any:

PL_markstack_ptr starts at:

        0x1f3030 start
        0x1f3038 main_loop
        0x1f3034 _bulkwalk_finish (decreases to 0x1f3030 at dXSARGS in 
_bulkwalk_finish)
        0x1f3030 _bulkwalk_finish (decreases to 0x1f302c at dXSARGS in 
_bulkwalk_finish)
        0x1f302c 
        ...
        ..
        decreases until
        ...
        0x1f2ff8 _bulkwalk_finish (where the PUSHMARK(sp) in
                     __push_cb_args set the xgv_gp in the
                     (XPVGV*)0x1f2fd8 to 3.

I must say that I do not understand the dXSARGS, so using the
perlcall(1) manuall, I tried to change the dXSARGS to

             dSP ;
             ENTER ;
             SAVETMPS;

                ...

             FREETMPS ;
             LEAVE ;

and then I get no more bus error and core dumps.

What is going on here? This is the first time for me looking at perl
internal, so I don't know really what is going on here. Does anybody
know how to fix this bus error?

Kind Regards,

Ole Bjørn Hessen.



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to