After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 81076 - fork() is not handled
fork() is not handled
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: Other
cvs (head)
Other other
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2002-05-07 19:10 UTC by Damon Chaplin
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.0



Description Damon Chaplin 2002-05-07 19:10:14 UTC
gnome-vfs doesn't seem to handle fork().

It needs to use pthread_atfork() so that the mutexes are OK in the child
process (i.e. not locked forever). The glibc info docs contain a section
about this.


It also probably needs to do something about the job table and the state of
any operations underway. Maybe just clear them in the child process.


The other alternative is to say 'gnome-vfs will not work across a fork()',
which is OK, as long as it is documented somewhere.

(Nautilus thumbnailing code seems to assume it does work across fork() at
present. Bug #78542 may be related to this.)
Comment 1 Damon Chaplin 2002-05-16 17:29:24 UTC
I just discovered that POSIX says a forked child of a multi-thread
app is only supposed to use asynchronous safe functions.

From glibc info docs, POSIX threads/Streams and fork:

   "Also note that these provisions are a GNU extension; other systems
might not provide any way for streams to be used in the child of a
multithreaded process.  POSIX requires that such a child process
confines itself to calling only asynchronous safe functions, which
excludes much of the library, including standard I/O."

So it looks to me like gnome-vfs can't reliably be used across a fork
anyway.
Comment 2 Ian McKellar 2002-09-05 06:26:35 UTC
I'm documenting this limitation.