-
Notifications
You must be signed in to change notification settings - Fork 232
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
handling open file descriptor limits with early initialisation #77
Comments
The fix is to call any backtrace function early in your program execution. Once you've done that, libbacktrace shouldn't need to open any more files. You can just discard the results. |
My use case was generating stack traces for exceptions in Nim programs: nim-lang/Nim#12922 |
OK, but I'm not sure what you are saying. I think that my comment still applies. |
No, of course not. With exceptions, I collect program counters during stack traversal and use them to generate a stack trace (using libbacktrace) when printing an exception: https://github.com/status-im/nim-libbacktrace/blob/master/libbacktrace.nim That usually happens at the end of a program, for fatal errors, or in the middle of it, for recoverable ones where we want to log exceptions (and associated stack traces). |
I think that we are somehow failing to communicate. In the original issue report you said "What we need is to replace that on-demand file opening with an early one - either by making fileline_initialize() public, so we can call it after backtrace_create_state(), or by including a call to it in the latter function." I am saying that such a function already exists: call |
Got it. Thanks. |
When you reach your process' open file descriptor limit, you can no longer produce a backtrace, because libbacktrace tries and fails to open the executable:
What we need is to replace that on-demand file opening with an early one - either by making
fileline_initialize()
public, so we can call it afterbacktrace_create_state()
, or by including a call to it in the latter function.The text was updated successfully, but these errors were encountered: