[opensuse-packaging] Need help finding "shared-lib-calls-exit" problem
Hi, one more problem with ffado that I need help with. How do I track down the offending exit() in the source, I've searched and can only find exit(0) or exit(-1) what do I have to look for? In fact I've one or two other packages that cause this rpmlint warning. Thanks Dave P -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Sat, 01 May 2010 16:32:44 +0200, Dave Plater
I've searched and can only find exit(0) or exit(-1)
And that are the culprits! But only one who is intimately familiar with a library should try to change that. If you'd change the library you'd also have to check all users of the library and make them cope with the changed behaviour. So I'd recommend asking upstreams for changes and in the meantime either ignore the warning or use a rpmlintrc file to suppress te warning. Philipp -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 05/02/2010 04:05 AM, Philipp Thomas wrote:
On Sat, 01 May 2010 16:32:44 +0200, Dave Plater
wrote: I've searched and can only find exit(0) or exit(-1)
And that are the culprits! But only one who is intimately familiar with a library should try to change that. If you'd change the library you'd also have to check all users of the library and make them cope with the changed behaviour.
This library is only used by jack for firewire music equipment support.
So I'd recommend asking upstreams for changes and in the meantime either ignore the warning or use a rpmlintrc file to suppress te warning.
Philipp
I'm a bit confused about what the rpmlint message actually means, there is one "exit@@GLIBC_2.2.5" in libffado.so.2.0.0 but what I don't quite grasp is exit(0) returns success and exit(-1) returns error so what is the problem with that over return? Please excuse me, I have extensive experience with assemblers, test equipment scripts and hardware but I'm a novice with c and c++. The rpmlint message:- libffado2.x86_64: W: shared-lib-calls-exit /usr/lib64/libffado.so.2.0.0 exit@GLIBC_2.2.5 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. Thanks Dave P -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Sun, May 02, 2010 at 11:05:48AM +0200, Dave Plater wrote:
On 05/02/2010 04:05 AM, Philipp Thomas wrote:
On Sat, 01 May 2010 16:32:44 +0200, Dave Plater
wrote: I've searched and can only find exit(0) or exit(-1)
And that are the culprits! But only one who is intimately familiar with a library should try to change that. If you'd change the library you'd also have to check all users of the library and make them cope with the changed behaviour.
This library is only used by jack for firewire music equipment support.
So I'd recommend asking upstreams for changes and in the meantime either ignore the warning or use a rpmlintrc file to suppress te warning.
Philipp
I'm a bit confused about what the rpmlint message actually means, there is one "exit@@GLIBC_2.2.5" in libffado.so.2.0.0 but what I don't quite grasp is exit(0) returns success and exit(-1) returns error so what is the problem with that over return? Please excuse me, I have extensive experience with assemblers, test equipment scripts and hardware but I'm a novice with c and c++. The rpmlint message:- libffado2.x86_64: W: shared-lib-calls-exit /usr/lib64/libffado.so.2.0.0 exit@GLIBC_2.2.5 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.
The text actually says what is the issue. The library cannot know what clean ups to do in the rest of the program, so it should not call exit() itself, but let the program do it. (However you can just read over this warning, its mostly harmless.) Ciao, Marcus -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Sun, 02 May 2010 11:05:48 +0200
Dave Plater
I'm a bit confused about what the rpmlint message actually means, there is one "exit@@GLIBC_2.2.5" in libffado.so.2.0.0 but what I don't quite grasp is exit(0) returns success and exit(-1) returns error so what is the problem with that over return?
exit() does not return from the library to the program but does exit the program. Suppose your program has initialized the hardware on start and is supposed to properly deinitialize the hardware before exiting. Now it calls a library function to do data processing, and the library just calls "exit(-1)" instead of returning an error to the app. Your application has no chance of returning the hardware into proper state before that exit(). It's a matter of bad programming style in library programming ;) -- Stefan Seyfried "Any ideas, John?" "Well, surrounding them's out." -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Am 02.05.2010 11:48, schrieb Stefan Seyfried:
It's a matter of bad programming style in library programming ;)
But the distribution should not decide about programming style. The problem I see is: Only library upstream can change the behaviour. It wouldn't be even sufficient to change all programs in the distribution that use that library to the new behaviour (probably returning an error instead of exiting the application). Users of the distribution could also use that library to develop own applications, without using RPM and without using build(1). And that users would be very confused if the library in openSUSE would behave completely different. That rpmlint warning is in my opinion only useful to the library authors itself and to packagers which are in contact with upstream. All others shouldn't touch exit() calls in the library. And, BTW, you can always register deinitialisation calls with atexit() that are also called when the library calls exit(). No, again, I don't consider it as good programming style to call exit() in libraries, but I'm also again that distribution should decide too many aspects of the contents of the packages they ship and create. Just my 0.02 €. Regards, Bernhard -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hello, On Sun, 02 May 2010, Bernhard Walle wrote:
Am 02.05.2010 11:48, schrieb Stefan Seyfried:
It's a matter of bad programming style in library programming ;)
But the distribution should not decide about programming style.
==== $ strace /lib/libc.so.6 write(1, "GNU C Library stable release ver"..., 742GNU C Library stable release version 2.10.1 (20090918), by Roland McGrath et al. Copyright (C) 2009 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Configured for i686-suse-linux. Compiled by GNU CC version 4.4.1 [gcc-4_4-branch revision 150839]. Compiled on a Linux 2.6.31 system on 2010-01-27. Available extensions: crypt add-on version 2.1 by Michael Glad and others GNU Libidn by Simon Josefsson NoVersion patch for broken glibc 2.0 binaries Native POSIX Threads Library by Ulrich Drepper et al BIND-8.2.3-T5B For bug reporting instructions, please see: http://www.gnu.org/software/libc/bugs.html. ) = 742 exit_group(0) = ? ==== With glibc <= 2.3 it's still ==== _exit(0) = ? ==== at the end. Go figure. -dnh -- New, from IKEA: DARCKENSE, the chair. Available in white only. All-natural materials! -- Niklas Karlsson -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 05/02/2010 11:48 AM, Stefan Seyfried wrote:
On Sun, 02 May 2010 11:05:48 +0200 Dave Plater
wrote: I'm a bit confused about what the rpmlint message actually means, there is one "exit@@GLIBC_2.2.5" in libffado.so.2.0.0 but what I don't quite grasp is exit(0) returns success and exit(-1) returns error so what is the problem with that over return?
exit() does not return from the library to the program but does exit the program.
Suppose your program has initialized the hardware on start and is supposed to properly deinitialize the hardware before exiting. Now it calls a library function to do data processing, and the library just calls "exit(-1)" instead of returning an error to the app. Your application has no chance of returning the hardware into proper state before that exit().
It's a matter of bad programming style in library programming ;)
I understand from these replies that if a libraries function is to provide an API such as alsa and is like an integral part of the calling program the exit is a no no but if a library is more like a fully functional package that simply provides a means of transferring data then exit is ok and in fact in this case, I could simply include this package in jack and build static libs to link against. Regards Dave P -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
* Dave Plater (davejplater@gmail.com) [20100502 11:06]:
I'm a bit confused about what the rpmlint message actually means, there is one "exit@@GLIBC_2.2.5" in libffado.so.2.0.0
This only shows that the implementation of exit is in glibc and has symbol version GLIBC_2.2.5. Every symbol (variables and functions) in glibc has a version attached to it. 'objdump -p' will show you the versions supported by the library. Philipp -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (7)
-
Bernhard Walle
-
Dave Plater
-
David Haller
-
Marcus Meissner
-
Philipp Thomas
-
Philipp Thomas
-
Stefan Seyfried