Component: benchtests Overview: Tests are crashing while printing CLI help Steps to reproduce: make bench-build && benchtests/bench-bzero --help Code: Options list is on two locations 1. support/support_test_main.c:42 static const struct option default_options[] = { TEST_DEFAULT_OPTIONS { NULL, 0, NULL, 0 } }; 2. support/test-driver.c:153 #ifdef CMDLINE_OPTIONS struct option options[] = { CMDLINE_OPTIONS TEST_DEFAULT_OPTIONS }; test_config.options = &options; #endif The first one is properly terminated, whereas the later one is not. Suggested fix: Add terminator in support/test-driver.c:153, after this change the CLI help is printed out without segfault. #ifdef CMDLINE_OPTIONS struct option options[] = { CMDLINE_OPTIONS TEST_DEFAULT_OPTIONS { NULL, 0, NULL, 0 } }; test_config.options = &options; #endif
Sorry, didn't notice this bug before. Fixed for glibc 2.41 via: commit c2a474f4617ede7a8bf56b7257acb37dc757b2d1 Author: Florian Weimer <fweimer@redhat.com> Date: Fri Aug 9 17:01:17 2024 +0200 support: Add options list terminator to the test driver This avoids crashes if a test is passed unknown options. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>