Thread (25 messages) 25 messages, 8 authors, 2020-05-04

Re: [PATCH 1/4] fs: Implement close-on-fork

From: Bernd Petrovitsch <hidden>
Date: 2020-04-22 17:03:29
Also in: linux-alpha, linux-arch, linux-fsdevel, lkml, sparclinux

On 22/04/2020 16:02, Karstens, Nate wrote:
quoted
It's not safe to call system() from a threaded app.  That's all.  It's right there in the DESCRIPTION:
That is true, but that description is missing from both the Linux man page and the glibc documentation (https://www.gnu.org/software/libc/manual/html_mono/libc.html#Running-a-Command). It seems like a minor point that won't be noticed until it causes a problem, and problems are rare enough they might go unnoticed for a while. We have removed system() from our application, but we're also concerned that libraries we integrate will use system() without our knowledge.
Reimplementing system() is trivial.
LD_LIBRARY_PRELOAD should take care of all system(3) calls.

I wonder it it has some value to add runtime checking for
"multi-threaded" to such lib functions and error out if
yes.

Apart from that, system() is a PITA even on
single/non-threaded apps.

MfG,
	Bernd
-- 
There is no cloud, just other people computers.
-- https://static.fsf.org/nosvn/stickers/thereisnocloud.svg

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help