[patch] Close fds before execute a cmd
Lai Jiangshan
laijs@cn.fujitsu.com
Fri Oct 12 00:46:00 GMT 2007
Sorry to make a mistake about the title, it should be
"[patch] Restore signals before execute a cmd".
Lai Jiangshan wrote:
> Hi, all
>
> case 1:
> stap -c 'sleep 100' -e 'probe begin{}'
> # killing SIGUSR1 to "sleep 100" does not work as expected
>
> case 2:
> trap "" SIGSEGV # set SIGSEGV's handler as SIG_IGN
> stap -c 'sleep 100' -e 'probe begin{}'
> # killing SIGSEGV still works.
>
> The bug reasons of case1 and case2 are same: the signal
> handlers are not restored before exec().
> It's not a serious bug, but it's not friendly to users.
> This bug can be fixed by the patch below(Restore signals except
> SIGINT).
> There is also another good way: unblock all signals and
> set signals' handlers as SIG_DFL **EXPLICITLY** before exec().
>
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
>
More information about the Systemtap
mailing list