Review request 6985422: flush the output streams before OnError commands
Chuck Rasbold
rasbold at google.com
Fri Sep 17 10:07:57 PDT 2010
On Thu, Sep 16, 2010 at 4:57 PM, David Holmes <David.Holmes at oracle.com>wrote:
> Vladimir Kozlov said the following on 09/17/10 03:12:
>
> http://cr.openjdk.java.net/~rasbold/OnError/webrev.00
>>
>> When the VM aborts, flush the output streams before
>> OnError commands are processed. Log files will not be
>> flushed if SuppressFatalErrorMessage is used to avoid
>> all post fatal error processing.
>>
>
> Why was the ostream_abort() removed from the os::shutdown() path?
>
> In the existing code we have:
>
> VMError::report_and_die()
> -> os::abort()
> -> os::shutdown()
> -> ostream_abort()
>
It seems backward to me the the os-specific abort() calls ostream_abort().
Ostream_init() and ostream_init_log() are called from create_vm(), I think
it would be preferable to clean-up the ostreams at a similar level.
> and you've moved ostream_abort() into report_and_die(), but there are other
> exit paths that also call os::shutdown() and will no longer call
> ostream_abort():
>
> vm_shutdown_during_initialization()
> -> vm_shutdown()
> -> os::shutdown()
>
>
Agreed that I missed vm_shutdown() in java.cpp. I'd be happy to add a call
to ostream_abort() there.
Are there other call sites to os:shutdown() that I've missed? If so,
perhaps it is safer to leave the originals calls in os::abort() as I've
underestimated the complexity of the shutdown code.
Also with this move you need to fix this comment in ostream.cpp:
>
> // ostream_abort() is called by os::abort() when VM is about to die.
> void ostream_abort() {
>
>
True.
> Why not just add explicit flush() calls where needed?
>
Flushing is pretty much what ostream_abort() does. The compilation log
flushing code is short but non-trivial. I think it is best not duplicate
the it.
-- Chuck
> David Holmes
>
>
> Contributed-by: rasbold at google.com
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-dev/attachments/20100917/4fb311aa/attachment.html
More information about the hotspot-dev
mailing list