xicodomingues/francinette

Fails to prepare tests for Minitalk

Closed this issue · 5 comments

flx25 commented

Hey, i have the following error when trying to test my minitalk, i am not sure how to solve this:

✖ Preparing tests: fsoares (my own tests) Undefined symbols for architecture x86_64: "___asan_handle_no_return", referenced from: _show_signal_msg in server.o _handle_termination in server.o "___asan_init", referenced from: _asan.module_ctor in server.o _asan.module_ctor in libftprintf.a(libftprintf.o) _asan.module_ctor in libftprintf.a(printhex.o) _asan.module_ctor in libftprintf.a(printint.o) _asan.module_ctor in libftprintf.a(printpointer.o) _asan.module_ctor in libftprintf.a(printunsignedint.o) "___asan_memcpy", referenced from: __add_malloc in server.o __mark_as_free in server.o _get_malloc_size in server.o _print_mallocs in server.o _check_leaks in server.o _get_all_allocs in server.o _show_malloc_stack in server.o ... "___asan_memset", referenced from: _malloc in server.o "___asan_option_detect_stack_use_after_return", referenced from: _show_signal_msg in server.o _setup_framework in server.o _set_signature in server.o _error in server.o __add_malloc in server.o __mark_as_free in server.o _get_malloc_size in server.o ... "___asan_register_image_globals", referenced from: _asan.module_ctor in server.o _asan.module_ctor in libftprintf.a(libftprintf.o) _asan.module_ctor in libftprintf.a(printhex.o) _asan.module_ctor in libftprintf.a(printint.o) _asan.module_ctor in libftprintf.a(printpointer.o) _asan.module_ctor in libftprintf.a(printunsignedint.o) "___asan_report_load1", referenced from: __mark_as_free in server.o _get_malloc_size in server.o _print_mallocs in server.o _check_leaks in server.o _get_all_allocs in server.o _show_malloc_stack in server.o _ft_strlen in libftprintf.a(libftprintf.o) ... "___asan_report_load4", referenced from: _set_signature in server.o _check_leaks in server.o _get_all_allocs in server.o _add_trace_to_signature in server.o _show_malloc_stack in server.o _ft_putchar in libftprintf.a(libftprintf.o) _printstring in libftprintf.a(libftprintf.o) ... "___asan_report_load8", referenced from: _show_signal_msg in server.o _save_traces in server.o _setup_framework in server.o _error in server.o _malloc in server.o __mark_as_free in server.o _reset_malloc_mock in server.o ... "___asan_report_store1", referenced from: __add_malloc in server.o __mark_as_free in server.o _get_all_allocs in server.o _ft_putchar in libftprintf.a(libftprintf.o) _writedigitsupc in libftprintf.a(printhex.o) _writedigitslowc in libftprintf.a(printhex.o) _printint in libftprintf.a(printint.o) ... "___asan_report_store4", referenced from: _set_signature in server.o __add_malloc in server.o _get_all_allocs in server.o _printstring in libftprintf.a(libftprintf.o) _format in libftprintf.a(libftprintf.o) _ft_printf in libftprintf.a(libftprintf.o) "___asan_report_store8", referenced from: _setup_framework in server.o __add_malloc in server.o _get_all_allocs in server.o _show_malloc_stack in server.o "___asan_set_shadow_00", referenced from: _setup_framework in server.o "___asan_set_shadow_f5", referenced from: __add_malloc in server.o "___asan_set_shadow_f8", referenced from: _setup_framework in server.o "___asan_stack_free_5", referenced from: _setup_framework in server.o "___asan_stack_malloc_0", referenced from: _ft_putchar in libftprintf.a(libftprintf.o) _writedigitsupc in libftprintf.a(printhex.o) _writedigitslowc in libftprintf.a(printhex.o) _printint in libftprintf.a(printint.o) _writedigits in libftprintf.a(printint.o) _writedigits in libftprintf.a(printpointer.o) _writedigits in libftprintf.a(printunsignedint.o) ... "___asan_stack_malloc_1", referenced from: _set_signature in server.o _error in server.o __mark_as_free in server.o _get_malloc_size in server.o _print_mallocs in server.o _check_leaks in server.o _get_all_allocs in server.o ... "___asan_stack_malloc_2", referenced from: _show_signal_msg in server.o _show_malloc_stack in server.o "___asan_stack_malloc_3", referenced from: __add_malloc in server.o "___asan_stack_malloc_5", referenced from: _setup_framework in server.o "___asan_unregister_image_globals", referenced from: _asan.module_dtor in server.o _asan.module_dtor in libftprintf.a(libftprintf.o) _asan.module_dtor in libftprintf.a(printhex.o) _asan.module_dtor in libftprintf.a(printint.o) _asan.module_dtor in libftprintf.a(printpointer.o) _asan.module_dtor in libftprintf.a(printunsignedint.o) "___asan_version_mismatch_check_apple_clang_1200", referenced from: _asan.module_ctor in server.o _asan.module_ctor in libftprintf.a(libftprintf.o) _asan.module_ctor in libftprintf.a(printhex.o) _asan.module_ctor in libftprintf.a(printint.o) _asan.module_ctor in libftprintf.a(printpointer.o) _asan.module_ctor in libftprintf.a(printunsignedint.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [server] Error 1 make: *** [all] Error 2 Problem preprating the testes, please contact me at fsoares- in slack or open an issue on github

When preparing tests I add an option to the Makefile file:

new_make = re.sub(r"-\bWall\b", f"-g -fsanitize=address -Wall -Wno-deprecated-declarations", filedata)

If for some reason your Makefile does not have a -Wall so I can do a find and replace, it will fail to add the
-fsanitize=address to the Makefile and so it will fail the compiling with the error above.

There are two ways to fix it:

  1. Make sure that the Makefile contains the -Wall and is used when linking the executable
  2. Add -fsanitize=address yourself to the Makefile when creating the executables.
flx25 commented

Thank you very much, i added the flags at 2 additional points of the makefile and now the tests compile :)

flx25 commented

Now that it compiles the tests, it still does not seem to work correctly:

the tester looks like this:
Screen Shot 2023-02-02 at 11 53 56 AM

It does not show me any more info for the leaks or runs other test than the one for the client which is shown.

I've contacted you in slack, but just in case I'll reply here too.

Could you send me your project (in zip, or a repo link) so I can try and figure out what is wrong, because this should not be happening and it is really weird behavior.

The issue seemed to disappear after doing the bonus part. I'll keep an eye out for other problems like this.