-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
load_library()
panics on errors when err=0
#47343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a4cadda
to
98ddb7a
Compare
Amended for posix, windows was also wrong. I misread the docs initially. |
98ddb7a
to
fcdf914
Compare
a0098b8
to
1cc5003
Compare
load_library with `err=0` now panics on errors, provided that the file exists. It used to never panic on errors, leading to confusion between when cases the libjuliacodegen library had been intentionally removed and when it tried but failed to load. Fixes JuliaLang#47027
1cc5003
to
57f9db2
Compare
Removed extra whitespace that I accidentally added. Added a test, and CI is passing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ julia-1.8.2/bin/julia -q
SYSTEM: caught exception of type ^C^C^C^C^C^C^CWARNING: Force throwing a SIGINT
fatal: error thrown and no exception handler available.
InterruptException()
$ julia-57f9db2279/bin/julia -q
ERROR: Unable to load dependent library /home/dc-gior1/tmp/julia-57f9db2279/bin/../lib/julia/libjulia-codegen.so.1
Message:/usr/local/software/master/gcc/8/lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /home/dc-gior1/tmp/julia-57f9db2279/bin/../lib/julia/libjulia-codegen.so.1)
Much better error, yay!
@giordano maybe this can show what's going on with windows on gcc12? |
I was thinking (and hoping) the same! |
That was the goal |
This PR broke the x86_64-w64-mingw32 tests. |
It looks to me like we might be missing a UTF16 -> UTF8 conversion somewhere. |
return NULL; | ||
#undef PATH_EXISTS | ||
jl_loader_print_stderr3("ERROR: Unable to load dependent library ", path, "\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use wpath
on Windows?
Edit: nevermind, my understanding is that we want to print the utf8 string and wpath
is the utf16 one. So path
somehow is utf16?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be utf8. The function expects it to be utf8. That it isn't is very odd, and this PR made no changes that would break that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but the tests introduced here triggered the error, tests were already failing in this PR, but the fact that Windows tests are allowed to fail means that the failure was overlooked
Lines 27 to 31 in b01fd33
So on windows the default error message we output is in julia/test/compiler/codegen.jl Lines 707 to 710 in b01fd33
|
According to my research, windows can display ascii or utf16 output in terminals, and as long as a single write call is used, it shouldn't matter which. It seems like the test should detect if it's on Windows and read as utf16 instead? |
Should this be reverted since causing CI errors elsewhere? |
Fails on windows due to utf-16 conversion. Test was introduced on PR JuliaLang#47343
Fails on windows due to utf-16 conversion. Test was introduced on PR JuliaLang#47343
We use loader_fputs to write error messages, and when we write them to files we want those files to be utf8. This should fix a broken test introduced in JuliaLang#47343.
We use loader_fputs to write error messages, and when we write them to files we want those files to be utf8. This should fix a broken test introduced in JuliaLang#47343.
We use loader_fputs to write error messages, and when we write them to files we want those files to be utf8. This should fix a broken test introduced in #47343.
load_library with
err=0
now panics on errors, provided that the file is openable. It used to never panic on errors, leading to confusion between when cases the libjuliacodegen library had been intentionally removed and when it tried but failed to load.Fixes #47027