lestrrat has asked for the wisdom of the Perl Monks concerning the following question:
So I was sending hash back and forth over the network with Storable, and then I started getting these weird segfaults when I tried to read from a socket. So I thought, why not, I'll just trap SIGSEGV and force a dump():
(gdb) where #0 0xff082ce0 in clean_store_context () from /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/auto/Storabl +e/Storable.so #1 0xff082f04 in clean_context () from /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/auto/Storabl +e/Storable.so #2 0xff08bb98 in do_retrieve () from /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/auto/Storabl +e/Storable.so #3 0xff08bf7c in pretrieve () from /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/auto/Storabl +e/Storable.so #4 0xff08c548 in XS_Storable_pretrieve () from /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/auto/Storabl +e/Storable.so #5 0x9db30 in Perl_pp_entersub () at pp_hot.c:2255 #6 0x91e64 in Perl_runops_debug () at run.c:66 #7 0x23734 in perl_run (sv_interp=0x13c00c) at perl.c:1095 #8 0x1f230 in main (argc=2, argv=0xffbefd0c, env=0xffbefd18) at perlm +ain.c:51 (gdb)
....And so it seems like this is a Storable issue while reading from the socket. I call fd_retrieve like so:
sub read { my $socket = shift; my $timeout = shift || 60; return undef unless( _is_valid( $socket ) ); my $hash; local $@ = ''; eval{ local $SIG{ ALRM } = sub{ die "ALRM:Read Time Out\n" } +; alarm( $timeout ); $hash = fd_retrieve( $socket ); alarm( 0 ); }; if( $@ ) { return undef; } return $hash; }
At the point of the call to retrieve_fd, I believe there's nothing in the socket, so the alarm() should go off.
Do you guys see anything wrong here? Am I doing something really stupid? This is with 5.005_03 on a solaris.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 1: Segfault with Storable
by tilly (Archbishop) on Sep 28, 2001 at 06:19 UTC | |
by lestrrat (Deacon) on Sep 28, 2001 at 06:31 UTC | |
by tilly (Archbishop) on Sep 28, 2001 at 07:12 UTC | |
|
Re: Segfault with Storable ( fixed )
by lestrrat (Deacon) on Sep 29, 2001 at 02:08 UTC | |
by tilly (Archbishop) on Sep 29, 2001 at 04:20 UTC | |
by lestrrat (Deacon) on Sep 29, 2001 at 05:32 UTC |