On Thu, Apr 23, 2009 at 02:09:15PM +0100, Richard Mawson wrote: > The caller is bin/mozilla/io.pl:1733 - and I see the corruption occurs during > the call to IS->invoice_details > at io.pl:1530 by doing a binary chop. > > This is not corrupt at the end of the invoice_details() sub, but is corrupt > as soon as we return to io.pl.
in io.pl, SL::IS is used to update $form with amongst other things $form->{'taxrates'} and $form->{'runningnumber'} here: 1529 if ($form->{vc} eq 'customer') { 1530 IS->invoice_details(\%myconfig, \%$form); 1531 } else { Jumping into SL::IS::invoice_details() and looking at these structures just before returning from the sub, $form->{'runningnumber'} is fine: $VAR1 = [ 1, 2, 3, 4 ]; but $form->{'taxrates'} is corrupt: $VAR1 = [ 2, 3, 4, undef ]; (expecting this to be [15,15,15,15] ) and when we return from invoice_details(), both are corrupt - one having refs to the first!: 'runningnumber' => [ 1, '$VAR1->{\'runningnumber\'}', undef, \$VAR1->{'taxbaseinclusive'}[0] ], 'taxrates' => [ ${\$VAR1->{'runningnumber'}[1]}, ${\$VAR1->{'runningnumber'}[2]}, \$VAR1->{'taxbaseinclusive'}[0], \$VAR1->{'runningnumber'}[2] ], I can't explain this.. and the corruption is not the same every time.. but while investigating I have seen errors such as: Attempt to free unreferenced scalar: SV 0x88440c0, Perl interpreter: 0x817b008 at SL/IS.pm line 336. Attempt to free unreferenced scalar: SV 0x8859378, Perl interpreter: 0x817b008 at SL/IS.pm line 336. Attempt to free unreferenced scalar: SV 0x884a878, Perl interpreter: 0x817b008 at SL/IS.pm line 336. Attempt to free unreferenced scalar: SV 0x8856350, Perl interpreter: 0x817b008 at SL/IS.pm line 388. (IS.pm was modified for debug, so these are really lines 325 and 377 respectively in the unmodified code.) Do we have a perl bug here? -- Richard Mawson Mawson IT Services
signature.asc
Description: Digital signature