xicodomingues / francinette

An easy to use testing framework for the 42 projects
MIT License
448 stars 43 forks source link

crash during fsoares gnl tests - osx 10.13.6 (17G66) #33

Open deceliere opened 1 year ago

deceliere commented 1 year ago

when encountering issues on gnl (malloc / free issues), tests on my osx machine (10.13.6 (17G66)) will crash/freeze. no problem from 42 school (catalina). is there anything I can do (except writing my code right TT)

message from terminal >

Running tests: fsoares (my own tests) BUFFER_SIZE: 1 Invalid fd : 1.OK 2.OK 3.OK 4_LEAKS.OK empty.txt : 1.OK 2.OK 3_LEAKS.KO ==3723==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clang_compiler_rt/clang-900.0.39.2/src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:259 "((h->type == CommonInterceptorMetadata::CIMT_FILE)) != (0)" (0x0, 0x0)

0 0x10d3eef5f in __asan::AsanCheckFailed(char const, int, char const, unsigned long long, unsigned long long) (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x60f5f)

#1 0x10d4061f7 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x781f7)
#2 0x10d3dc158 in wrap_fclose (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x4e158)
#3 0x109dd80f0 in add_to_error_file utils.c:316
#4 0x109dcf19c in main tester.c:111
#5 0x7fff6eac3014 in start (libdyld.dylib:x86_64+0x1014)

/bin/sh: line 1: 3723 Killed: 9 ./test1.out < lines_around_10.txt make: [mandatory] Error 137 (ignored) BUFFER_SIZE: 10 Invalid fd : 1.OK 2.OK 3.OK 4_LEAKS.OK empty.txt : 1.OK 2.OK 3_LEAKS.KO ==3739==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clang_compiler_rt/clang-900.0.39.2/src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:259 "((h->type == CommonInterceptorMetadata::CIMT_FILE)) != (0)" (0x0, 0x0)

0 0x106628f5f in __asan::AsanCheckFailed(char const, int, char const, unsigned long long, unsigned long long) (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x60f5f)

#1 0x1066401f7 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x781f7)
#2 0x106616158 in wrap_fclose (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x4e158)
#3 0x103015f50 in add_to_error_file utils.c:316
#4 0x10300bc80 in main tester.c:111
#5 0x7fff6eac3014 in start (libdyld.dylib:x86_64+0x1014)

/bin/sh: line 1: 3739 Killed: 9 ./test2.out < lines_around_10.txt make: [mandatory] Error 137 (ignored) BUFFER_SIZE: 1000000 Invalid fd : 1.OK 2.OK 3.OK 4_LEAKS.OK empty.txt : 1.OK 2.OK 3_LEAKS.KO ==3757==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clang_compiler_rt/clang-900.0.39.2/src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:259 "((h->type == CommonInterceptorMetadata::CIMT_FILE)) != (0)" (0x0, 0x0)

0 0x10517df5f in __asan::AsanCheckFailed(char const, int, char const, unsigned long long, unsigned long long) (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x60f5f)

#1 0x1051951f7 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x781f7)
#2 0x10516b158 in wrap_fclose (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x4e158)
#3 0x101b6afb0 in add_to_error_file utils.c:316
#4 0x101b6125c in main tester.c:111
#5 0x7fff6eac3014 in start (libdyld.dylib:x86_64+0x1014)

/bin/sh: line 1: 3757 Killed: 9 ./test3.out < lines_around_10.txt make: [mandatory] Error 137 (ignored)

execution.log >

2022-12-02 02:48:24,153 [base][INFO]: copying /Rud/projets/42/42_memory_git/42memory/gnl to /Users/r/francinette/temp/get_next_line/__my_srcs 2022-12-02 02:48:24,165 [base][INFO]: To execute: [] 2022-12-02 02:48:24,165 [base][INFO]: Missing: [] 2022-12-02 02:48:24,165 [base][INFO]: Copying from /Users/r/francinette/tests/get_next_line/gnlTester to /Users/r/francinette/temp/get_next_line/gnlTester 2022-12-02 02:48:24,193 [base_exec][INFO]: on dir /Users/r/francinette/temp/get_next_line/gnlTester 2022-12-02 02:48:24,194 [base_exec][INFO]: on dir /Users/r/francinette/temp/get_next_line/gnlTester 2022-12-02 02:48:38,276 [base][INFO]: Copying from /Users/r/francinette/tests/get_next_line/fsoares to /Users/r/francinette/temp/get_next_line/fsoares 2022-12-02 02:48:38,298 [base_exec][INFO]: on dir /Users/r/francinette/temp/get_next_line/fsoares 2022-12-02 02:48:38,298 [base_exec][INFO]: executing: make TIMEOUT=10 mandatory 2022-12-02 02:48:38,299 [base_exec][INFO]: on dir /Users/r/francinette/temp/get_next_line/fsoares 2022-12-02 02:49:13,871 [base_exec][INFO]: BUFFER_SIZE: 1 Invalid fd : 1.OK 2.OK 3.OK 4_LEAKS.OK empty.txt : 1.OK 2.OK 3_LEAKS.KO ==3723==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clang_compiler_rt/clang-900.0.39.2/src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:259 "((h->type == CommonInterceptorMetadata::CIMT_FILE)) != (0)" (0x0, 0x0)

0 0x10d3eef5f in __asan::AsanCheckFailed(char const, int, char const, unsigned long long, unsigned long long) (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x60f5f)

#1 0x10d4061f7 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x781f7)
#2 0x10d3dc158 in wrap_fclose (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x4e158)
#3 0x109dd80f0 in add_to_error_file utils.c:316
#4 0x109dcf19c in main tester.c:111
#5 0x7fff6eac3014 in start (libdyld.dylib:x86_64+0x1014)

/bin/sh: line 1: 3723 Killed: 9 ./test1.out < lines_around_10.txt make: [mandatory] Error 137 (ignored) BUFFER_SIZE: 10 Invalid fd : 1.OK 2.OK 3.OK 4_LEAKS.OK empty.txt : 1.OK 2.OK 3_LEAKS.KO ==3739==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clang_compiler_rt/clang-900.0.39.2/src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:259 "((h->type == CommonInterceptorMetadata::CIMT_FILE)) != (0)" (0x0, 0x0)

0 0x106628f5f in __asan::AsanCheckFailed(char const, int, char const, unsigned long long, unsigned long long) (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x60f5f)

#1 0x1066401f7 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x781f7)
#2 0x106616158 in wrap_fclose (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x4e158)
#3 0x103015f50 in add_to_error_file utils.c:316
#4 0x10300bc80 in main tester.c:111
#5 0x7fff6eac3014 in start (libdyld.dylib:x86_64+0x1014)

/bin/sh: line 1: 3739 Killed: 9 ./test2.out < lines_around_10.txt make: [mandatory] Error 137 (ignored) BUFFER_SIZE: 1000000 Invalid fd : 1.OK 2.OK 3.OK 4_LEAKS.OK empty.txt : 1.OK 2.OK 3_LEAKS.KO ==3757==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clang_compiler_rt/clang-900.0.39.2/src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:259 "((h->type == CommonInterceptorMetadata::CIMT_FILE)) != (0)" (0x0, 0x0)

0 0x10517df5f in __asan::AsanCheckFailed(char const, int, char const, unsigned long long, unsigned long long) (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x60f5f)

#1 0x1051951f7 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x781f7)
#2 0x10516b158 in wrap_fclose (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x4e158)
#3 0x101b6afb0 in add_to_error_file utils.c:316
#4 0x101b6125c in main tester.c:111
#5 0x7fff6eac3014 in start (libdyld.dylib:x86_64+0x1014)

/bin/sh: line 1: 3757 Killed: 9 ./test3.out < lines_around_10.txt make: [mandatory] Error 137 (ignored)

2022-12-02 02:49:13,878 [gnl-fsoares][INFO]: errors: ['empty.txt', '==3723==AddressSanitizer CHECK failed', '/bin/sh', 'empty.txt', '==3739==AddressSanitizer CHECK failed', '/bin/sh', 'empty.txt', '==3757==AddressSanitizer CHECK failed', '/bin/sh'] 2022-12-02 02:49:13,967 [base][WARNING]: norminette errors: ['get_next_line_utils.c', 'get_next_line.c', 'main.c', 'get_next_line.h'] 2022-12-02 02:49:13,968 [base][WARNING]: missing functions: [] 2022-12-02 02:49:13,968 [base][WARNING]: errors in functions: [('gnlTester', ['gnlTester']), ('fsoares', ['fsoares'])]

xicodomingues commented 1 year ago

Hey,

Address Sanitizer is an analyzer that checks that the program is not writing or reading memory that it should not (after arrays, or more than you allocated with malloc), or other general errors involving accessing information that you should not.

From what I gather from the logs it's complaining about my tests. I think I know what it is. I call fclose on a file that maybe it is not open yet, so that can generate a problem, and I think it is just this problem.

I'll add it to the things to fix list.

Thank you for the report!