[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: [ID 19991229.003] perl 5.005_03 core dumps -- singal interrupt related

<nads@bleh.org> writes:
>This is a bug report for perl from nads@bleh.org,
>generated with the help of perlbug 1.26 running under perl 5.00503.
>[Please enter your report here]
>Perl core dumps shortly after I send an interrupt signal to my program.

Signals can do that to any perl. Only the most trivial of signal handlers
are safe. They must not allocate any memory at all (very hard to be sure
of in perl code) as the signal may have occured in the memory allocator
and that is probably not re-entrant.

There are various approaches to making signals usable which 
may be in the development track. 

Both Tk and the Event modules have 'synchronous' signals implemented 
at the C level, but delayed until the next "event despatch" occurs.

>#0  chunk_alloc (ar_ptr=0x4013d040, nb=16) at malloc.c:2804
>2804    malloc.c: No such file or directory.
>(gdb) bt
>#0  chunk_alloc (ar_ptr=0x4013d040, nb=16) at malloc.c:2804
>#1  0x400a840a in __libc_malloc (bytes=4) at malloc.c:2643

Pretty typical ...

>$SIG{"INT"} = \&do_exit;
>sub do_exit {
>	if ( $connected ) {
>		close_host();
>	}
>	#ReadMode 0;
>	unlink("$hdir/pass");	
>	# On interrupts ReadLine might mangle the term, thus we 
>	# call reset to fix us up
>	system("reset -Q");
>	exit;	

Far, far too complex.

Nick Ing-Simmons

Follow-Ups from:
Ilya Zakharevich <ilya@math.ohio-state.edu>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]