iboB / dynamix

:fish_cake: A new take on polymorphism
MIT License
673 stars 45 forks source link

Strange address sanitizer complaints by Apple clang #44

Open iboB opened 1 year ago

iboB commented 1 year ago

This happens when running the plugin demo with asan on mac:

It does not happen with clang15 on Linux and it seems that it shouldn't happen on mac as well.

/Users/runner/work/dynamix/dynamix/code/./dynamix/mutate.hpp:13:10: runtime error: member call on address 0x7ff7b95e7ca0 which does not point to an object of type 'dynamix::common_mixin_init<tap::person>'
Errors while running CTest
0x7ff7b95e7ca0: note: object is of type 'tap::mixin_person'
 01 00 00 00  f0 34 ec 06 01 00 00 00  b0 79 ec 06 01 00 00 00  ff ff ff ff f7 7f 00 00  80 ea aa 06
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'tap::mixin_person'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/runner/work/dynamix/dynamix/code/./dynamix/mutate.hpp:13:10 in 
/Users/runner/work/dynamix/dynamix/code/dynamix/object_mutation.cpp:236:20: runtime error: call to function int dynamix::util::call_mixin_default_ctor<tap::teacher>(dnmx_mixin_info const*, void*) through pointer to incorrect function type 'int (*)(const dnmx_mixin_info *, void *)'
mixin_info_util.hpp:16: note: int dynamix::util::call_mixin_default_ctor<tap::teacher>(dnmx_mixin_info const*, void*) defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/runner/work/dynamix/dynamix/code/dynamix/object_mutation.cpp:236:20 in 
/Users/runner/work/dynamix/dynamix/code/dynamix/object_mutation.cpp:167:9: runtime error: call to function void dynamix::util::call_mixin_dtor<tap::teacher>(dnmx_mixin_info const*, void*) through pointer to incorrect function type 'void (*)(const dnmx_mixin_info *, void *) noexcept'
mixin_info_util.hpp:21: note: void dynamix::util::call_mixin_dtor<tap::teacher>(dnmx_mixin_info const*, void*) defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/runner/work/dynamix/dynamix/code/dynamix/object_mutation.cpp:167:9 in 
/Users/runner/work/dynamix/dynamix/code/./dynamix/mutate.hpp:13:10: runtime error: member call on address 0x7ff7b95e75a0 which does not point to an object of type 'dynamix::common_mixin_init<tap::person>'
0x7ff7b95e75a0: note: object is of type 'tap::mixin_person'
 b0 [60](https://github.com/iboB/dynamix/actions/runs/4453732770/jobs/7822459107#step:6:61) 00 00  f0 34 ec 06 01 00 00 00  b0 79 ec 06 01 00 00 00  ff ff ff ff f7 7f 00 00  c0 eb aa 06
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'tap::mixin_person'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/runner/work/dynamix/dynamix/code/./dynamix/mutate.hpp:13:10 in 
[doctest] doctest version is "2.4.9"
[doctest] run with "--help" for options

More time needs to be invested here.

iboB commented 1 year ago

It seems that this is either a clang-14 issue or an apple-clang issue. I cannot reproduce this with clang 15 on Linux

iboB commented 1 year ago

Lowering the priority on this one. Will be done post v2.0.0

iboB commented 1 month ago

yep. It does not happen on apple clang 16