<update>
Changing your script to
#!/usr/bin/perl use strict; use warnings; use lib "$ENV{PWD}"; use myConfig; # create the objecto for write the db our $c_config = myConfig->new(); # add default to the configuration db $c_config->add_default ( default => 'aa' ); $c_config->_write_configuration();
produces the following output:
### _write_configuration - store start ### _write_configuration - return ### DESTROY - start ### _write_configuration - store start Segmentation fault
The segfault is triggered only if store() is called in the DESTROY during global destruction. It occurs in Storable.xs in do_store()
in the macro dSTCXT which resolves tostatic int do_store( pTHX_ PerlIO *f, SV *sv, int optype, int network_order, SV **res) { dSTCXT; <--- here int status; ...
SV *perinterp_sv = *hv_fetch(PL_modglobal, MY_VERSION, sizeof(MY_VERSION)-1, TRUE); stcxt_t * cxt = ((perinterp_sv && SvIOK(perinterp_sv) && SvIVX(perinte +rp_sv) ? (stcxt_t *)SvPVX(SvRV(INT2PTR(SV*,SvIVX(perinterp_sv)))) : (stcx +t_t *) 0));
It doesn't occur with the following script:
#!/usr/bin/perl use strict; use warnings; use lib "$ENV{PWD}"; use myConfig; # create the objecto for write the db our $c_config = myConfig->new(); # add default to the configuration db $c_config->add_default ( default => 'aa' ); undef $c_config;
Seems like during global destruction some things needed are already gone.
</update>
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re: perl Segmentation fault (with Storable?)
by shmem
in thread perl Segmentation fault (with Storable?)
by glide
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |