This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug stdio/22834] Subprocess forked by popen may crash in Linux when multithreads call popen


https://sourceware.org/bugzilla/show_bug.cgi?id=22834

--- Comment #3 from huanjiajia <huanjiajia1983 at gmail dot com> ---
(In reply to Florian Weimer from comment #2)
> So the strangeness here is that the O_CLOEXEC is optional in the parent
> process.  The implementation assumes that other popen descriptors always
> closed by popen in its subprocess, but for execve, the closing is optional.
> 
> I'm not sure what POSIX intends here.

I think you are right. The list proc_file_chain only handle the fds of pipes
created by popen, and these fds have been carefully handled by popen if
O_CLOEXEC has been defined. But it is tricky that the define of O_CLOEXEC
depends on parent process. :(

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]