Mailing List Archive

Known OVERLOAD bugs?
Are there any known bugs with OVERLOAD? I am hunting
a very ugly problem since a couple of days now.
It looks like some memory gets overwritten, but I
can not find anything wrong with my code.

The symptoms: Somewhere during the execution of the
perl section, I get a Memory access exception.
This exception always happens in hv_fetch (hv.c),
and usually xhv->xhv_array is corrupt.

Depending on the size of the perl code, this
happens earlier or later...

It seems to somehow be connected with OVERLOAD
(I am using tiehash AND overload on some of my
objects), but this is 'just a feeling'.

If that rings a bell, please please please drop me
a line!

gerti
Re: Known OVERLOAD bugs? [ In reply to ]
Re: Known OVERLOAD bugs? [ In reply to ]
Re: Known OVERLOAD bugs? [ In reply to ]
On Thu, 14 Sep 1995 03:14:20 CDT, Gerd Knops wrote:
>Are there any known bugs with OVERLOAD? I am hunting
>a very ugly problem since a couple of days now.
>It looks like some memory gets overwritten, but I
>can not find anything wrong with my code.
>
[...]
>
>If that rings a bell, please please please drop me
>a line!
>
>gerti
>

Yes, it does ring a bell :-)

The following is not really about any bugs in OVERLOAD, but might very well
be one in base perl that shows up as bugs in OVERLOAD+mysterious memory
corruption. I have found that the following conditional compilation of
free_tmps() in scope.c:

#ifdef DEBUGGING
SvTEMP_off(sv);
#endif
SvREFCNT_dec(sv); /* note, can modify tmps_ix!!! */

might really be rather wrong (given that the SVf_TEMP flag is not exclusive
to -DDEBUGGING). This means that there's a possibility to get different
behavior in debugging-perl when SvREFCNT(sv) > 1.

So my suggestion to you would be to test your program again with a perl
compiled with -DDEBUGGING and see if it changes anything.

[.Aside: I ran into this when Chip Salzenberg reported that my first release
consolidated patches were blowing on OVERLOAD tests in mysterious ways. I
couldn't replicate the problem because I was compiling with -DDEBUGGING and
he wasn't. The problem shows up in OVERLOAD tests when you do an
sv_2mortal() on an SV that has a REFCNT > 1. I decided at that time to avoid
this problematic code in my patches by only doing sv_2mortal(sv) after first
checking for SvREFCNT(sv) == 1 (because I wasn't sure why this conditional
existed). I now think I should have fixed above code instead in my
patches...]


- Sarathy.
gsar@engin.umich.edu