RFR: 8292016: Rework JLI_ReportErrorMessageSys [v10]

Julian Waters jwaters at openjdk.org
Thu Aug 18 11:25:19 UTC 2022


On Thu, 18 Aug 2022 09:55:59 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> 8291917 was simply about making error messages more informative on Windows when loading the C Runtime or Java Virtual Machine dlls failed (Right now it just prints an unhelpful "Error: loading: ...") - It consequently depended on this RFE for the functionality. Although it _can_ use the other error reporting utilities the JDK has elsewhere, this one happens to be the most convenient, but a more important reason is that the other utilities provided by the JDK all also use the same flawed logic as this one, if we can decide how to fix this function here and now, we'd be able to extrapolate the solution to those other areas as well with very little fuss, so I think fixing this would be better than simply opting to remove it
>
> Okay, this is for future use. We don't usually add complexity as a preparation for the future. We usually include usage and functionality in one RFE. That way reviewers can see how the feature is supposed to be used, and whether its worth to keep it.
> 
> You may hear other opinions, but what I would do:
> 
> - make an RFE that actually enriches failing Win32 API calls with GetLastError, using the non-sys variant (JLI_ReportErrorMessage) and just manually adding the error code at the call sites.
> - If that turns out to be many call sites, we can think about adding a windows specific JLI_ReportErrorMessageSysWin32.  
> - If that's just 2-5 sites or so, leave it and just scrap JLI_ReportErrorMessageSys for windows.
> 
> Just my 5 cent.

The (rather incomplete) fix for this was indeed initially part of the original RFE, and only split into another bug afterwards when it was realized there was too much to fit into one PR for an easy review, but I thought it'd be less of a clutter to focus on this one first since the issue already exists in the tracker

> make an RFE that actually enriches failing Win32 API calls with GetLastError, using the non-sys variant (JLI_ReportErrorMessage) and just manually adding the error code at the call sites.

I don't quite get what you mean?

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

PR: https://git.openjdk.org/jdk/pull/9870


More information about the core-libs-dev mailing list