On 08/11/2016 02:56 AM, Jonathan M Davis via Digitalmars-d wrote:
> On Thursday, August 11, 2016 02:17:06 Ali Çehreli via Digitalmars-d wrote:
>> I've noticed that GC profiling[1] is not provided if the application
>> exit()s as opposed to returns. Is that intended? Would it be possible to
>> print it still?
>>
>> Related, stdout may not be the best place for that information: ;)
>>
>>    https://issues.dlang.org/show_bug.cgi?id=15602
>>
>> Ali
>>
>> [1] https://dlang.org/spec/garbage.html#gc_config
>
> Well, you could register stuff with atexit() so that it runs when exit() is > called, but calling exit() isn't much better than hitting assert(0) or using
> ctrl-c. exit() doesn't shut things down even vaguely cleanly.

Agreed that assert(0) is fatal but Ctrl-C is just a signal that can be handled cleanly. exit() is not necessarily an error return. It just means that the application does not care about regular cleanup.

> So, you
> _might_ be able to get something thanks to atexit(), but I'm not sure how
> much you can really do given that your program has basically just been shot
> in the head.

The good thing is that the application may be calling exit() itself, where it could have made a call to get the profile information. The main issue here is that the output of GC profile information is hardwired to GC destruction (and stdout).

I've opened this enhancement request:

  https://issues.dlang.org/show_bug.cgi?id=16377

Ali

Reply via email to