RFR: 8351491: Add info from release file to hserr file [v3]

David Holmes dholmes at openjdk.org
Fri Apr 4 02:03:52 UTC 2025


On Thu, 3 Apr 2025 16:12:38 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   use one time PeriodicTask
>
> Coming to this discussion late.
> 
> IMHO this is overengineered for just a printout to the hs-err file during error dumping. We already read from proc fs. Proc can be worse (depending on what you read, a lot) than reading sequentially from a flat file.
> 
> Remember that we already run the JVM binaries from the same file system. We read debug information from those binaries during error dumping, and that causes a ton of IO; a sequential read of a tiny file is a drop in the bucket.
> 
> Also remember that we have safety fuses: Step timeouts and Step signal handling - so if this read ever turns out to be a problem, e.g by hanging, the Step would be cancelled and error reporting would continue with the next step.
> 
> I would, however, attempt to avoid malloc. Not super important, but if its easy to do I would do it. Best by using a small fixed-sized stack-allocated buffer, and just printing the file line by line.
> 
> Just my 5 cent.

@tstuefe perhap this is over engineered but there are a number of issues to consider:
- reading from the physical filesystem is not the same as reading from /proc and IMO is far more likely to be problematic if done in a signal handling context during error reporting - hence we need to read the file ahead-of-time
- the content of the file is available and known at build time, but there is reluctance to try and handle this via the build system, so we need to read it at runtime
- reading from a small file during VM startup may indeed be lost in the noise but it is "death by a thousand cuts" - can we avoid any impact on startup? Yes we can.

Also no need to avoid malloc when just reading via normal code.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/24244#issuecomment-2777371168


More information about the hotspot-dev mailing list