Re: [Maria-developers] 665402a: MDEV-14265 - RPMLint warning: shared-lib-calls-exit
Hi, Sergey! On Dec 18, Sergey Vojtovich wrote:
revision-id: 665402aa9b83565c1cef3caa06cd998d3808f0d7 (mariadb-10.1.29-31-g665402a) parent(s): ef9e78c9d41a5ac644f08068e3dabad948b0e30a committer: Sergey Vojtovich timestamp: 2017-12-18 20:23:36 +0400 message:
MDEV-14265 - RPMLint warning: shared-lib-calls-exit
find_type_with_warning() client helper did exit(1) on error, exit(1) moved to clients.
It was find_type_or_exit(), and you could've had less changes if you'd replaced it with an inline function. Basically, copied the function into the header and made it static inline.
mysql_read_default_options() did exit(1) on error, error is passed through and handled now.
ok
my_str_malloc_default() did exit(1) on error, replaced my_str_ allocator functions with normal my_malloc()/my_realloc()/my_free().
I think you need to replace my_str_malloc_default() with my_malloc(..., MYF(MY_FAE)), not my_malloc(..., MYF(0))
sql_connect.cc did many exit(1) on hash initialisation failure. Removed error check since my_hash_init() never fails.
my_malloc() did exit(1) on error. Replaced with abort().
my_load_defaults() did exit(1) on error, replaced with abort().
I'd say, return 2 instead of exit/abort. my_load_defaults already does it, because my_search_option_files returns 2 for OOM.
my_load_defaults() still does exit(0) when invoked with --print-defaults.
dunno, return -1, for example, and exit in the caller? Regards, Sergei Chief Architect MariaDB and security@mariadb.org
Hi Sergei, Thanks for looking into this patch! On Mon, Dec 18, 2017 at 09:34:30PM +0100, Sergei Golubchik wrote:
Hi, Sergey!
On Dec 18, Sergey Vojtovich wrote:
revision-id: 665402aa9b83565c1cef3caa06cd998d3808f0d7 (mariadb-10.1.29-31-g665402a) parent(s): ef9e78c9d41a5ac644f08068e3dabad948b0e30a committer: Sergey Vojtovich timestamp: 2017-12-18 20:23:36 +0400 message:
MDEV-14265 - RPMLint warning: shared-lib-calls-exit
find_type_with_warning() client helper did exit(1) on error, exit(1) moved to clients.
It was find_type_or_exit(), and you could've had less changes if you'd replaced it with an inline function. Basically, copied the function into the header and made it static inline. That's what I did initially. Then I got undeclared exit(), then I included my_global.h, then I got huge mysql.h.pp diff. Or did you have some way to workaround it on your mind?
I'll fix the name, thanks.
mysql_read_default_options() did exit(1) on error, error is passed through and handled now.
ok
my_str_malloc_default() did exit(1) on error, replaced my_str_ allocator functions with normal my_malloc()/my_realloc()/my_free().
I think you need to replace my_str_malloc_default() with my_malloc(..., MYF(MY_FAE)), not my_malloc(..., MYF(0))
I did it this way in ctype-tis620.c and my_vsnprintf.c. But xml.c handles allocation failure, why should we bother then?
sql_connect.cc did many exit(1) on hash initialisation failure. Removed error check since my_hash_init() never fails.
my_malloc() did exit(1) on error. Replaced with abort().
my_load_defaults() did exit(1) on error, replaced with abort().
I'd say, return 2 instead of exit/abort. my_load_defaults already does it, because my_search_option_files returns 2 for OOM.
Ok.
my_load_defaults() still does exit(0) when invoked with --print-defaults.
dunno, return -1, for example, and exit in the caller?
There're ~30 callers to be fixed. :( I'll try to come up with some alternative. Regards, Sergey
participants (2)
-
Sergei Golubchik
-
Sergey Vojtovich