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

Better error messages when libjulia-codegen fails to load #47027

Closed
staticfloat opened this issue Oct 3, 2022 · 0 comments · Fixed by #47343
Closed

Better error messages when libjulia-codegen fails to load #47027

staticfloat opened this issue Oct 3, 2022 · 0 comments · Fixed by #47343
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@staticfloat
Copy link
Member

In #41936 we added the ability to run Julia without codegen linked in to the process, to make it easier to separate codegen from the rest of the runtime, for use in situations where we actually don't want the ability to generate new code. Unfortunately, our loader mechanism can currently get confused between the case where libjulia-codegen is missing (and therefore should not be linked in), and the case where libjulia-codegen fails to load due to some error. We need to disambiguate these two cases, and only optimistically continue execution if libjulia-codegen is actually missing from the lib/julia folder.

The current behavior is that cli/loader_lib.c attempts to load libjulia-codegen, and if it fails, it always tries to continue in codegen-less mode (which apparently doesn't work that well on 1.8.X).

I suggest we try to access() our libjulia-codegen path before trying to dlopen() it, and only enter codegen-less mode if access() fails. Otherwise, dlopen() errors should be fatal just like for libjulia-internal.

@staticfloat staticfloat added the bug Indicates an unexpected problem or unintended behavior label Oct 3, 2022
apaz-cli added a commit to apaz-cli/julia that referenced this issue Oct 25, 2022
load_library with `err=0` now panics on errors, provided that the
file is openable. It used to never panic on failures.

Fixes JuliaLang#47027
apaz-cli added a commit to apaz-cli/julia that referenced this issue Oct 26, 2022
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 JuliaLang#47027
apaz-cli added a commit to apaz-cli/julia that referenced this issue Oct 27, 2022
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 JuliaLang#47027
apaz-cli added a commit to apaz-cli/julia that referenced this issue Oct 27, 2022
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 JuliaLang#47027
apaz-cli added a commit to apaz-cli/julia that referenced this issue Oct 27, 2022
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
apaz-cli added a commit to apaz-cli/julia that referenced this issue Oct 27, 2022
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
apaz-cli added a commit to apaz-cli/julia that referenced this issue Oct 27, 2022
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
apaz-cli added a commit to apaz-cli/julia that referenced this issue Oct 27, 2022
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
apaz-cli added a commit to apaz-cli/julia that referenced this issue Oct 28, 2022
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
vtjnash pushed a commit that referenced this issue Oct 28, 2022
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 it.

Fixes #47027
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant