Skip to content
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

Inconsistent error for file not found #106

Closed
tgalery opened this issue Sep 20, 2023 · 0 comments · Fixed by #108
Closed

Inconsistent error for file not found #106

tgalery opened this issue Sep 20, 2023 · 0 comments · Fixed by #108

Comments

@tgalery
Copy link

tgalery commented Sep 20, 2023

Heya 👋🏽 thanks for making the lib available. This is more of a question, but it took some time in the afternoon.
Due to some relative path mistakes, I had some tests (that required the decompression of a gzip file passing locally), but failing on CI, which returned this message:

could not load library "libc"
  /usr/lib/x86_64-linux-gnu/libc.so: invalid ELF header

which seems to be coming from this line

Digging deeper, it seems that there is a slight difference from Oses (below tests in ubuntu 22.04 in WSL2):

julia> unsafe_load(cglobal((:errno, :libc), Cint))
ERROR: could not load library "libc"
libc.so: cannot open shared object file: No such file or directory
Stacktrace:
 [1] top-level scope
   @ REPL[1]:1

julia> cglobal((:errno, "libc.so.6"), Cint)
Ptr{Int32} @0x00007f4cbe436038

A colleague using pop os and arch reported an error similar to the ELF header above.

Instead, shouldn't we use:

using Base.Libc
errno()

to report the error number in that block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant