|
|
Message-Id: <1656161421.nztip0vma0.none@localhost>
Date: Sat, 25 Jun 2022 08:56:46 -0400
From: "Alex Xu (Hello71)" <alex_y_xu@...oo.ca>
To: musl@...ts.openwall.com
Subject: Re: BUG: Calling readdir/dirfd after vfork will cause
deadlock.
Excerpts from Nick Peng's message of June 24, 2022 11:40 pm:
> Description: After vfork, calling functions such as readdir/dirfd may
> cause deadlock. GNU C is OK.
This is not a bug. TFM:
DESCRIPTION
Standard description
(From POSIX.1) The vfork() function has the same effect as
fork(2), except that the behavior is undefined if the process
created by vfork() either modifies any data other than a variable
of type pid_t used to store the return value from vfork(), or
returns from the function in which vfork() was called, or calls
any other function before successfully calling _exit(2) or one of
the exec(3) family of functions.
It may happen to appear to work in some cases on some libcs, or kernels,
or architectures, or it may deadlock, corrupt data, or cause demons to
fly out your nose. Do not use vfork in this manner. Avoid using fork in
this manner either; that may work in musl 1.2.2+, and appear to work in
glibc (but sometimes randomly corrupt data), but is not portable to
other libcs.
Alex.
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.