If the only code is $integer++, it doesn't take an "internals specialist" to realize that there is about 0 chance of memory corruption or segfaults.
| [reply] [d/l] |
If the only code is $integer++, it doesn't take an "internals specialist" to realize that there is about 0 chance of memory corruption or segfaults.
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.
| [reply] |