Bug 140932 - fork+exec from threaded FreeBSD 7.2 application
Summary: fork+exec from threaded FreeBSD 7.2 application
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 1.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-27 10:10 UTC by Welch, Brent
Modified: 2018-01-03 05:15 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Welch, Brent 2009-11-27 10:10:00 UTC
 Regarding bug 101323, we're seeing either crashes or hangs,
 on occasion, when our multi-threaded process nanny does a
 fork+exec sequence.  We are using FreeBSD 7.2 and libthr
 
 We are super careful with signal masks,
 and do the bare minimum between fork and exec.  However, due
 to various libraries that we use, we have a bunch of threads
 running in the main process.  We've been using this code 
 on 4.6.2 and uniprocessors for years w/out issue.
 We are using 7.2 on 64-bit multi-core platforms. We do:
 
         m_pid = fork();
         if (m_pid == 0 {
            /* pseudo code */
            fstat() and close() file descriptors 3 and above
            setuid() if necessary
            restore signal masks
            setpgid()
            creat() a log file and dup to stdout and stderr
            execve()
         }
 
 Is this approach doomed to failure, or should we be able to get
 this working?  It doesn't look like Daniel's patch is in our
 libthr/thread/thr_fork.c
 So, I can do the obvious and try that.  I'm curious about just
 running __sys_fork() instead, however, as the process is
 going to obliterate itself with execve() anyway.
 
 --
 Brent Welch
 Director, Software Architecture, Panasas Inc
 The Leader in Parallel Storage
 
 www.panasas.com
 welch@panasas.com
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-11-27 10:15:00 UTC
Responsible Changed
From-To: gnats-admin->freebsd-bugs

Rescue from 'pending'. 

To submitter: did you intend to have this tracked as a followup 
to kern/101323, or do you want it as a separate PR?
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2009-12-22 09:28:47 UTC
State Changed
From-To: open->feedback

Note that submitter was asked for feedback.
Comment 3 Welch, Brent 2010-01-04 20:12:45 UTC
Let's leave this as its own case.  I still need to confirm the
effectiveness of the other patch.  I may also choose to use an
unwrapped sysfork().
 
--
Brent Welch
Director, Software Architecture, Panasas Inc
The Leader in Parallel Storage

www.panasas.com
welch@panasas.com
Comment 4 Jilles Tjoelker freebsd_committer freebsd_triage 2010-05-15 22:02:52 UTC
State Changed
From-To: feedback->open

Feedback was received. 

To the submitter: also consider vfork() or posix_spawn(). 
More information about the crashes will also be helpful.
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:24 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped