From: <postmaster@yuristudio.net>
To: linux-c-programming@vger.kernel.org
Subject: Issue with fcntl FD_CLOEXEC and execve
Date: Fri, 19 Jun 2020 22:40:10 +0200 [thread overview]
Message-ID: <000801d64679$d347bf10$79d73d30$@yuristudio.net> (raw)
[ Please keep me in CC as I'm not subscribed to the mailing list ]
Hello,
Sorry for using this weird email address, but my personal email is
apparently blocked ("your address is not liked source for email").
I recently experimented with fork/exeve and wanted to make an error
reporting from worker process back to master process. To create the link I
used pipe syscall.
The pipe works fine and the process can correctly transmit data back to the
master. The only issue appears when trying to run input pump based
applications like cat, grep, etc. When running these applications the pipe
write end which is marked FC_CLOEXEC should be closed when execve is
triggered, however it is not, but execve still succeeded.
When the target process to execve is not an input pump (uname, ls, .) no
issue occurs and the pipe is correctly closed when execve is triggered and
succeeds.
That is a problem as my master process expects the blocking read to return
with either cause of pipe file descriptor closed or some data written. In
this case when the target process is an input pump the master process never
gets notified of file descriptor closed and by extension locks forever.
Thank you,
Yuri Edward
next reply other threads:[~2020-06-19 20:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-19 20:40 postmaster [this message]
2020-06-20 6:53 ` Issue with fcntl FD_CLOEXEC and execve Florian Weimer
2020-06-21 18:46 ` Yuri Edward
[not found] ` <fadc7cda-a84b-33ed-e15a-8203673f9d61@yuristudio.net>
2020-06-21 19:57 ` Florian Weimer
2020-06-22 17:09 ` Yuri Edward
-- strict thread matches above, loose matches on Subject: below --
2020-06-21 19:03 Yuri Edward
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000801d64679$d347bf10$79d73d30$@yuristudio.net' \
--to=postmaster@yuristudio.net \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).