summaryrefslogtreecommitdiff
path: root/perldtrace.d
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-03-19 21:29:16 +0000
committerDavid Mitchell <davem@iabyn.com>2011-03-19 22:03:40 +0000
commit9a7f166c9e80e6dce5b942cb7af5fc213e0466d4 (patch)
treec614aac028847948e8ea2e13cef9c3ee4df49727 /perldtrace.d
parent55fa63f5f326538bec794ff6b165abff1ea07579 (diff)
downloadperl-9a7f166c9e80e6dce5b942cb7af5fc213e0466d4.tar.gz
In signal handler, don't inc stack pointers
In Perl_sighandler, we currently increment PL_markstack_ptr and PL_scopestack_ix. This was added back in 1997 in the era of unsafe signals, to make them slightly less unsafe. The idea presumably was to stop signal handlers inadvertently corrupting the top element of each stack. However, given that the normal method of pushing something onto those stacks is to increment the pointer before pushing the value, I don't see how that can happen. The downside of this is that an uninitialised or stale value can be left in the 'hole' left on these stacks. When exiting from a signal handler via exit(), these holes can be read and corruption occur, while stack unwinding is taking place. The ordering of things means we can't use SAVEDESTRUCTOR_X to undo the damage. This commit leaves the 'PL_savestack_ix += 5', because in this case, with unsafe signals, it *is* possible to interrupt halfway through a new set of save data being pushed onto the stack, and it *is* possible for this to be undone via SAVEDESTRUCTOR_X. (But it's still unsafe and half-baked.) This fixes [perl #85206].
Diffstat (limited to 'perldtrace.d')
0 files changed, 0 insertions, 0 deletions