Bug 23483 – add profile-gc hook function user can call early to dump partial report file.

Status
NEW
Severity
blocker
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-11-13T21:47:27Z
Last change time
2024-12-07T13:42:17Z
Assigned to
No Owner
Creator
mw
Moved to GitHub: dmd#17453 →

Comments

Comment #0 by mingwu — 2022-11-13T21:47:27Z
Hi, https://forum.dlang.org/post/[email protected] Right now my program is facing a out-of-memory problem, there is no way the program can run to finish to get the complete full profilegc.log report. However, there is also no easy way to exit early from a multi-threaded program: https://forum.dlang.org/thread/[email protected] So, I think we need to add profile-gc hook function that the user can call early to dump partial report file. Then at least the programmer has some control and view the partial report file. This is really a *blocker* for my project. Thanks.
Comment #1 by mingwu — 2022-11-13T22:38:51Z
Also, currently in the report profilegc.log only the call stack top allocation site is reported, this is not very useful for things like containers from the common library, e.g. array: void[] std.array.Appender!(char[][]).Appender.ensureAddable.__lambda9 It's much informative to give the full (or top 20 stack traces) to see where the allocation happened in the user code, as what valgrind does.
Comment #2 by mingwu — 2022-11-14T00:11:58Z
The nice thing about valgrind is that even if the program segfaults, it can still generate the report file. profile-gc should have this behavior, instead of insisting on program exit normally. To debug a out-of-memory problem, you have to terminate the program early, often abnormally.
Comment #3 by bugzilla — 2023-01-19T03:34:47Z
Calling the function: extern (C) int rt_term(); should do the trick.
Comment #4 by robert.schadek — 2024-12-07T13:42:17Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17453 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB