develooper Front page | perl.perl5.porters | Postings from November 2003

Re: 5.8.2 coredump: tied hashes implemented as XSUB methods

Thread Previous | Thread Next
From:
Marcus Holland-Moritz
Date:
November 15, 2003 03:33
Subject:
Re: 5.8.2 coredump: tied hashes implemented as XSUB methods
Message ID:
02b201c3ab6c$2ceeefe0$8d00a8c0@R2D2
> I have a module (Solaris::Kstat) which implements a tied hash entirely from 
> XSUB code.  This works fine in 5.6.1, but cores in 5.8.2.  I've added some 
> debug code, and whilst all the other XSUB tied hash methods are being called 
> correctly, CLEAR isn't - it looks like Perl_hv_clear() is being called 
> rather than the tied CLEAR method.  The stack trace looks like this:
> 
> Perl_hv_clear
> Perl_pp_aassign
> Perl_runops_standard
> S_run_body
> perl_run
> main
> 
> i.e. no sign of the XSUB CLEAR method.  I haven't had time to nail this down 
> yet, but being lazy I wondered if anyone else had seem the same problem?

I also have a module that implements a tied hash purely in XS,
but I don't see any problems with 5.8.2.

The only changes between major perl releases I can find are
between 5.005_03 and 5.6.0 (which changed the order of calls
to FETCH/STORE when doing 'values %hash') and between 5.8.0
and 5.8.1 (which made DESTROY being correctly called in void
context). I can see no change (from the API point of view)
that affects how CLEAR is being called.

If you'd like to have a look, my module (Tie::Hash::Indexed)
can be built with debugging support by saying

  perl Makefile.PL enable-debug

which allows you to trace each method call by exporting

  THI_DEBUG_OPT=d

in your environment.

Cheers,
Marcus



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About