JuliaLinearAlgebra / libblastrampoline

Using PLT trampolines to provide a BLAS and LAPACK demuxing library.
MIT License
66 stars 17 forks source link

RPMLint: Shared-Lib-Calls-Exit #100

Closed uncomfyhalomacro closed 1 year ago

uncomfyhalomacro commented 1 year ago

Hello. I maintain this package in openSUSE - https://build.opensuse.org/package/show/devel:libraries:c_c++/libblastrampoline

The RPMLint error is showing shared-lib-calls-exit which is discouraged. Here is full description and solution of the error:

This library package calls exit() or _exit(), probably in a non-fork() context. Doing so from a library is strongly discouraged - when a library function calls exit(), it prevents the calling program from handling the error, reporting it to the user, closing files properly, and cleaning up any state that the program has. It is preferred for the library to return an actual error code and let the calling program decide how to handle the situation.

uncomfyhalomacro commented 1 year ago

It seems to only show in openSUSE Leap image so I wonder if this got already fixed. If so, you can close this issue.

staticfloat commented 1 year ago

I agree! I've opened a PR to eliminate these (even though it was extremely rare/impossible in some cases to trigger those exit() calls): https://github.com/JuliaLinearAlgebra/libblastrampoline/pull/104

Note that there is one case in which the exit(1) call remains, but that is to have a default violent behavior when LBT_STRICT=1 is set, so you must opt into that behavior.