Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NNG fails in child process created using fork() #1635

Closed
dilipatgit opened this issue Dec 19, 2022 · 2 comments
Closed

NNG fails in child process created using fork() #1635

dilipatgit opened this issue Dec 19, 2022 · 2 comments

Comments

@dilipatgit
Copy link

Error:
panic: nng is not fork-reentrant safe
This message is indicative of a BUG.
Report this at https://github.com/nanomsg/nng/issues

@gdamore
Copy link
Contributor

gdamore commented Dec 19, 2022

Yep. If you have a program that tries to fork() and then tries to use NNG in the child (without calling exec) then it fails. There are a lot of problems with fork() and threads - too many for NNG to attempt to solve. (Fork and pthreads are basically inherently incompatible.)

@gdamore
Copy link
Contributor

gdamore commented Dec 19, 2022

I'm going to close this, because it's a well known - and documented - issue. You can't use fork() (unless you are going to exec immediately afterwards in the child) with NNG.

@gdamore gdamore closed this as completed Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants