in reply to Re: Re: •Re: the unsafe signals controversy
in thread the unsafe signals controversy
Wanna bet?
Unless $integer has already just been assigned an integer value, it will currently be of type SVt_NULL; the first ++ will upgrade it to SVt_IV, which may cause a malloc. If the signal occured during a call to malloc, then Boom!
Of course you could avoid this by ensuring that there is the initial assignment $integer=0 before the signal handler is called, but even that isn't enough. A Perl-level signal handler calls a *sub* not a statement, and entering a sub involves pushing things onto the context and save stacks, which can again trigger mallocs.
|
|---|