Mailing List Archive

More on 5b6 VERSION
Some more information about the VERSION segfault:

STACK TRACE:

0 sv_clean_objs () [sv.c: 200]
1 perl_destruct (sv_interp = 0x40015008) [perl.c: 170]
2 main (argc = 2, argv = 0x7b033c14, env = 0x7b033c20) [perlmain.c: 66]

OFFENDING STATEMENT:

if (SvROK(sv) && SvOBJECT(rv = SvRV(sv))) {

VALUE OF sv: 0x40018510

With -DDDEBUGGING, and -DPD flags, no output is emitted.

Where should I be looking next to find out what's being screwed up and why?

Jeff
Re: More on 5b6 VERSION [ In reply to ]
On Fri, 29 Dec 1995 09:38:24 PST, Jeff Okamoto wrote:
>
>OFFENDING STATEMENT:
>
>if (SvROK(sv) && SvOBJECT(rv = SvRV(sv))) {
>

Hmm, try changing that to:

if (SvROK(sv) && (rv = SvRV(sv)) && SvOBJECT(rv)) {

- Sarathy.
gsar@engin.umich.edu
Re: More on 5b6 VERSION [ In reply to ]
> Hmm, try changing that to:
>
> if (SvROK(sv) && (rv = SvRV(sv)) && SvOBJECT(rv)) {

Nope, no good. However, with some extra debugging, I find that in the
for loop, it runs 122 times just fine, then on the 123rd time, the reference
count has the rather ridiculous value of 1073825224. However, in hex, this
is 400145c8, which looks like a valid address.

My suspicion is that someone's storing an address where a refcount really
belongs.

If anyone's interested, I have some very verbose debugging output.
Alternately, you can change sv.c as follows:

sv = sva + 1;
DEBUG_D((fprintf(stderr, "Refcount of sva (%x) is %d\n", sva, SvREFCNT(sva)));)
svend = &sva[SvREFCNT(sva)];
while (sv < svend) {
DEBUG_D((fprintf(stderr, "Inside while loop: %x %x\n", sv, svend),
sv_dump(sv));)
if (SvROK(sv) && (rv = SvRV(sv)) && SvOBJECT(rv)) {
DEBUG_D((fprintf(stderr, "Cleaning object ref:\n "),

Jeff