Repository navigation
[mono] Include filename in Invalid image error messages - #32560
Conversation
CoffeeFlux
left a comment
There was a problem hiding this comment.
I think we should use mono_error_set_simple_file_not_found for some of these FileNotFoundExceptions. It seems to already include the file name in its error message and includes a nicer error message.
Additionally, we should make the change to include the filename with the error message in more than just the function calls failing the tests. There are some cases where it doesn't make sense to do so because we have an in-memory assembly (e.g. mono_error_set_bad_image_by_name (error, "In memory assembly", "0x%p", assembly_data);) but otherwise we should try and include it across the board. For FileNotFound, the main candidates are the two calls in icall.c, but we have a bunch of invalid image calls in metadata.c and aot-runtime.c that seem like they would benefit from this.
|
Please add exactly one area label if the bot doesn't. It trains the bot |
CoffeeFlux
left a comment
There was a problem hiding this comment.
Mostly looks good, just a few little things to fix up.
5357328 to
f15a4a5
Compare
CoffeeFlux
left a comment
There was a problem hiding this comment.
So close! Watch out for whitespace changes.
f15a4a5 to
f57ff48
Compare
…)" This reverts commit 5371ef4.
Fixes #31649
Fixes #31650
Testing:
Reproduced Error via
<Runtime Repo Root>/build.sh /p:RuntimeFlavor=monoRemoving
[ActiveIssue("https://github.com/dotnet/runtime/issues/31650", TestRuntimes.Mono)]in AssemblyTests.csRunning
dotnet msbuild /t:RebuildAndTest /p:XunitMethodName=System.Reflection.Tests.AssemblyTests.LoadFile_NoSuchPath_ThrowsFileNotFoundExceptionFixing issue resulted in no errors.