This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [patch] Close fds before execute a cmd
- From: Martin Hunt <hunt at redhat dot com>
- To: Lai Jiangshan <laijs at cn dot fujitsu dot com>
- Cc: systemtap at sourceware dot org
- Date: Tue, 09 Oct 2007 12:12:28 -0400
- Subject: Re: [patch] Close fds before execute a cmd
- Organization: Red Hat Inc.
- References: <470B0D2A.4070401@cn.fujitsu.com>
On Tue, 2007-10-09 at 14:10 +0900, Lai Jiangshan wrote:
[...]
> I traced this bug and at the last I found the reason: stapio
> did not close some file descriptors before using execl() to run a cmd.
> The processes of this cmd may read or write on the fds inherited from
> stapio. Especially the fd of control_channel, if one of processes of
> this cmd reads and writes on this fd, it communicates with stap_XXXXXX.ko,
> and lots of BUGs occurred. (Does stap_XXXXXX.ko support communicating
> with two or more processes at the same time?)
Thank you for reporting this bug. I have checked in a patch to set the
FD_CLOEXEC flags for all files stapio opens.
Martin