From 55980446c3a1e684bab04ce82ca5f209adbd813e Mon Sep 17 00:00:00 2001 From: Federico Giovanardi Date: Fri, 15 Nov 2024 16:55:24 +0100 Subject: [PATCH 1/2] test: fix generate-sym-test using the wrong array The second check was searching the symbols into the same array, but using the size of the other. This generated a SIGSEV when they occassionally mismatched. --- src/test/generate-sym-test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/generate-sym-test.py b/src/test/generate-sym-test.py index 028d108bb5e..914120b0bca 100755 --- a/src/test/generate-sym-test.py +++ b/src/test/generate-sym-test.py @@ -105,9 +105,9 @@ int main(void) { } for (j = 0; symbols_from_source[j].name; j++) { - struct symbol*n = bsearch(symbols_from_source+j, symbols_from_source, sizeof(symbols_from_sym)/sizeof(symbols_from_sym[0])-1, sizeof(symbols_from_sym[0]), sort_callback); + struct symbol*n = bsearch(symbols_from_source+j, symbols_from_sym, sizeof(symbols_from_sym)/sizeof(symbols_from_sym[0])-1, sizeof(symbols_from_sym[0]), sort_callback); if (!n) - printf("Found in sources, but not in symbol file: %s\\n", symbols_from_source[i].name); + printf("Found in sources, but not in symbol file: %s\\n", symbols_from_source[j].name); } return i == j ? EXIT_SUCCESS : EXIT_FAILURE; From 0c851a58f7204c11183efb6bc22f7c01ccb907eb Mon Sep 17 00:00:00 2001 From: Federico Giovanardi Date: Tue, 19 Nov 2024 09:55:07 +0100 Subject: [PATCH 2/2] style: Fix formatting --- src/test/generate-sym-test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/generate-sym-test.py b/src/test/generate-sym-test.py index 914120b0bca..2e5177c9340 100755 --- a/src/test/generate-sym-test.py +++ b/src/test/generate-sym-test.py @@ -99,13 +99,13 @@ int main(void) { printf("Found %zu symbols from source files.\\n", j); for (i = 0; symbols_from_sym[i].name; i++) { - struct symbol*n = bsearch(symbols_from_sym+i, symbols_from_source, sizeof(symbols_from_source)/sizeof(symbols_from_source[0])-1, sizeof(symbols_from_source[0]), sort_callback); + struct symbol *n = bsearch(symbols_from_sym+i, symbols_from_source, sizeof(symbols_from_source)/sizeof(symbols_from_source[0])-1, sizeof(symbols_from_source[0]), sort_callback); if (!n) printf("Found in symbol file, but not in sources: %s\\n", symbols_from_sym[i].name); } for (j = 0; symbols_from_source[j].name; j++) { - struct symbol*n = bsearch(symbols_from_source+j, symbols_from_sym, sizeof(symbols_from_sym)/sizeof(symbols_from_sym[0])-1, sizeof(symbols_from_sym[0]), sort_callback); + struct symbol *n = bsearch(symbols_from_source+j, symbols_from_sym, sizeof(symbols_from_sym)/sizeof(symbols_from_sym[0])-1, sizeof(symbols_from_sym[0]), sort_callback); if (!n) printf("Found in sources, but not in symbol file: %s\\n", symbols_from_source[j].name); }