You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Those gave us some hint to finally be able to reproduce it.
Indeed, the crash happens only when proxysql is executed in background, as a daemon.
If proxysql is running in foreground, the crash doesn't happen.
If we do not call daemon_close_all() , proxysql doesn't crash also when running in background.
These are the file-descriptors that the parent process has after the fork():
Therefore, the same FDs are present on the child process.
if daemon_close_all() is called, the child process will lose a file-descriptor to /dev/urandom , and apparently never opens it again.
That brings me back to this comment: charybdis-ircd/charybdis#71 (comment)
Probably gnutls isn't able to pass a good random function because /dev/urandom is closed!
Although the backtrace in #2607 is different, and at today I am still unable to reproduce it, I won't be surprised if the root cause is the same: file descriptor to /dev/urandom being closed.
The text was updated successfully, but these errors were encountered:
renecannao
changed the title
Do not close all file descriptors on parent processes
Do not close all file descriptors on parent process
Mar 31, 2020
We got a report about proxysql crashing with the following backtrace:
After a long investigation, we found some clue in these two issues:
--daemon
nzbget/nzbget#271Those gave us some hint to finally be able to reproduce it.
Indeed, the crash happens only when proxysql is executed in background, as a daemon.
If proxysql is running in foreground, the crash doesn't happen.
If we do not call
daemon_close_all()
, proxysql doesn't crash also when running in background.These are the file-descriptors that the parent process has after the
fork()
:Therefore, the same FDs are present on the child process.
if
daemon_close_all()
is called, the child process will lose a file-descriptor to/dev/urandom
, and apparently never opens it again.That brings me back to this comment: charybdis-ircd/charybdis#71 (comment)
Probably gnutls isn't able to pass a good random function because
/dev/urandom
is closed!Although the backtrace in #2607 is different, and at today I am still unable to reproduce it, I won't be surprised if the root cause is the same: file descriptor to
/dev/urandom
being closed.The text was updated successfully, but these errors were encountered: