From: Dennis Noordsij <dennis.noordsij@wiral.com>
To: linux-kernel@vger.kernel.org
Subject: pthreads & fork & execve
Date: Fri, 30 Mar 2001 16:22:57 +0300 [thread overview]
Message-ID: <01033016225700.00409@dennis> (raw)
Hi,
I have question regarding use of pthreads, forks and execve's which appears
to not work very well :-) First let me explain the reasoning though
We have an app that launches a few other apps and keeps track of their
status, resource consumption etc. If one of the apps crashes, it is restarted
according to certain parameters.
The app uses pthreads, and it's method of (re)starting an application is
forking and calling execve.
It works fine for all-but-one other app, which core dumps when started this
way (from the commandline it works fine) and the core only traces back to
int main(int argc, char **argv). It uses both pthreads and -ldl for plugin
handling.
We have tried changing the linking order (i.e. -ldl -lpthread, -lpthread,
-ldl, etc), and even execv'ing a shell script that starts a shell script that
starts the app - result is the same, instant core without even running.
I can see who forks together with threads and execve's are a messy
combination, and a better solution altogether to our approach is appreciated
just as much as a way to make the current solution work :-)
We have tested both kernels 2.4.2 and 2.2.18.
We have tried on different systems, different hardware and slightly different
distributions (debian potato, unstable, etc).
To sum up: using a pthreaded app to launch another pthreaded app by means of
forking and exec(ve)'ng makes the second app core immediately, (at entering
main). What to do?
Kind regards, and thanks for any help
Dennis Noordsij
next reply other threads:[~2001-04-01 17:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-30 13:22 Dennis Noordsij [this message]
2001-04-02 11:42 ` pthreads & fork & execve Richard Guenther
2001-04-02 12:54 ` Gustavo Niemeyer
2001-04-02 13:00 ` Jakub Jelinek
2001-04-02 14:25 ` Gustavo Niemeyer
2001-04-02 13:33 ` Adam Dickmeiss
2001-04-02 14:32 ` Gustavo Niemeyer
2001-04-03 10:09 ` Richard Guenther
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=01033016225700.00409@dennis \
--to=dennis.noordsij@wiral.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox