-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
forcing heap snapshot via signal does not allow specifying custom directory #47842
Comments
Pull request welcome. The relevant code is here: node/lib/internal/process/pre_execution.js Lines 366 to 387 in 76ae7be
|
I am on it. |
I was actually in the process of creating a PR. Can I go ahead with it? I saw that it was labeled as a good first issue and I wanted to make a contribution. |
Sorry. Next time, you can comment on the issue and take the work. So that, we can avoid the duplicate work. |
PR-URL: nodejs#47854 Refs: nodejs#47842 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
It looks like this issue hasn't been responded to in a while, so I created the PR: #49496 |
Completed in #47854 |
PR-URL: nodejs#47854 Refs: nodejs#47842 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
Version
18
Platform
mac
Subsystem
No response
What steps will reproduce the bug?
node --heapsnapshot-signal=SIGUSR2 --diagnostic-dir=/opt/crashes test.js
kill -USR2 [pid]
Why is this important? --diagnostics-dir is currently being used to write files for heap profiling, but not ad-hoc heap dumps. When running in a production environment, the application cwd is often read only. Application developers must be able to specify where heap dumps will be saved.
Note, no parameters are being passed into this function execution: https://github.com/nodejs/node/blob/c24a61b3f6815b9d12b491ac869335feff86a24b/lib/internal/process/pre_execution.js#LL376C17-L376C17. A path should be passed to this function, such that the full filename can be constructed.
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
Note, no parameters are being passed into this function execution: https://github.com/nodejs/node/blob/c24a61b3f6815b9d12b491ac869335feff86a24b/lib/internal/process/pre_execution.js#LL376C17-L376C17. A path should be passed to this function, such that the full filename can be constructed.
What do you see instead?
writeHeapSnapshot(); attempts to write to the cwd. The code path for writing to a provided path is never utilized.
Additional information
No response
The text was updated successfully, but these errors were encountered: