tpaviot/oce — Issue #161: Shared library calls exit
Author: hobbes1069
Created: 2011-11-09 14:34:18+00:00
State: open

In packaging OCE for Fedora I ran into the following issue. I've got the packages building successfully now so I ran rpmlint on them, which if you're not familiar with it, checks a bunch of common packaging issues.

The following libraries appear to call exit which is a no-no for shared libraries:
$ rpmlint *.rpm | grep shared-lib-calls-exit
OCE-foundation.x86_64: W: shared-lib-calls-exit /usr/lib64/libTKAdvTools.so.1.0.0 exit@GLIBC_2.2.5
OCE-foundation.x86_64: W: shared-lib-calls-exit /usr/lib64/libTKernel.so.1.0.0 exit@GLIBC_2.2.5
OCE-visualization.x86_64: W: shared-lib-calls-exit /usr/lib64/libTKService.so.1.0.0 exit@GLIBC_2.2.5
OCE-visualization.x86_64: W: shared-lib-calls-exit /usr/lib64/libTKOpenGl.so.1.0.0 exit@GLIBC_2.2.5

rpmlint provides the following explination:
$ rpmlint -I shared-lib-calls-exit
shared-lib-calls-exit:
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.