Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
11.8.7, 11.8.8, 12.3.2, 13.0.1
-
Can result in hang or crash
-
When failing to invoke MariaDB Server, the program generate_option_list could crash instead of exiting with a failure status.
Description
I found the following warning while compiling MariaDB:
.../extra/generate_option_list.cc: In function 'std::string call_mariadbd(const char*, const char*, const char*)':
|
.../include/my_sys.h:1096:28: warning: argument 1 null where non-null expected [-Wnonnull]
|
1096 | #define my_pclose(A) pclose(A)
|
| ~~~~~~^~~
|
.../extra/generate_option_list.cc:95:5: note: in expansion of macro 'my_pclose'
|
95 | my_pclose(f);
|
| ^~~~~~~~~
|
In file included from .../include/my_global.h:285,
|
from .../extra/generate_option_list.cc:18:
|
/usr/include/stdio.h:887:12: note: in a call to function 'int pclose(FILE*)' declared 'nonnull'
|
887 | extern int pclose (FILE *__stream) __nonnull ((1));
|
| ^~~~~~
|
The call is clearly redundant:
|
mariadb-11.8.7:extra/generate_option_list.cc |
|
91
|
FILE *f= my_popen(command.str().c_str(), "r"); |
92
|
if (!f) |
93
|
{
|
94
|
perror("failed to read mariadbd output"); |
95
|
my_pclose(f);
|
While man 3 pclose on my system does not say that the parameter is supposed to be a non-null return value of popen, it is kind of implied by the fact that the two functions are documented together.
This regression could have been avoided if we enabled -Werror on CMAKE_BUILD_TYPE=RelWithDebInfo targets. Currently we only enable the equivalent /WX when targeting Microsoft Windows.
Attachments
Issue Links
- is caused by
-
MDEV-32745 config upgrade helper tool
-
- Closed
-