Bug 13142 - Stopping script execution on Android (ARM) does not unload kernel module
Summary: Stopping script execution on Android (ARM) does not unload kernel module
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 minor
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-30 13:13 UTC by Frederic Turgis
Modified: 2011-08-30 19:00 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Turgis 2011-08-30 13:13:29 UTC
Testing systemtap v1.3 and v1.5 on android has shown that kernel module is not unloaded after doing Ctrl-C.
Thanks to systemtap verbose traces, this has been root caused to the use of:
execl("/bin/sh", "sh", ...) in runtime/staprun/mainloop.c
Android stores sh in /system/bin so is not found by syscall. However, path is correctly set in PATH env variable.

Therefore Franck Ch. Eigler has proposed execlp("sh", "sh", ...) so that system call looks for right path in PATH.

It has been tested OK. Furthermore, there was potential issue with this (see execvp comments in same file) but it has been found that:
"On second thought ... the place where we were worried about these extra syscalls is the path that fork/exec's the CMD part of "stap -c CMD".  In the case of system_cmd() and cleanup_and_exit(), those don't matter."

Note that there are then 2 places where execl could be replaced by execlp
Comment 1 Frank Ch. Eigler 2011-08-30 19:00:31 UTC
commit aa17e6fd