Project

General

Profile

Actions

Bug #1235

open

shared-lib-calls-exit

Added by Lafage Vincent almost 14 years ago. Updated almost 14 years ago.

Status:
Assigned
Priority:
Low
Assigned To:
Target version:
-
Start date:
09/13/2010
Due date:
% Done:

0%

Estimated time:

Description

2010-09-13T04:23:04+0200

/opt/daq-MCH/LC2/lib/libLC2config.so
/opt/daq-MCH/LC2/lib/libLC2version.so

These library packages 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.

The concerned classes are:

LC2/source/version/src/CError.cxx
LC2/source/config/src/FrtCrtConfig.cxx
LC2/source/config/src/utilities.cxx

Actions #1

Updated by Lafage Vincent almost 14 years ago

2010-10-09T12:02:00+0200
Throw exception instead of exit in Shared Libraries

rpmlint reports

W: shared-lib-calls-exit /opt/daq-MCH/LC2/lib/libLC2version.so exit@GLIBC_2.0
W: shared-lib-calls-exit /opt/daq-MCH/LC2/lib/libLC2config.so exit@GLIBC_2.0
daq-MCH-LC2-1.3.2/LC2/source/version/src/CError.cxx
CError::ReleaseResourcesAndExit
daq-MCH-LC2-1.3.2/LC2/source/config/src/FrtCrtConfig.cxx
Crocus::FrtCrtConfig::ScanFromCommand
daq-MCH-LC2-1.3.2/LC2/source/config/src/utilities.cxx
Crocus::Exception

called in

daq-MCH-LC2-1.3.2/LC2/source/gui/src/ErrorDialog.cxx:      Exception(strFrom, strMessage);
daq-MCH-LC2-1.3.2/LC2/source/config/src/utilities.cxx:    Exception("TestBit", "Index outside limits.");
daq-MCH-LC2-1.3.2/LC2/source/config/src/utilities.cxx:    Exception("ExtractBits", "Index outside limits.");

Actions

Also available in: Atom PDF