These tests were behaving differently under release mode than debug mode, which is how they were originally tested and evaluated. I'm not entirely sure of the full cause of the issue or why it worked in debug mode but not release. As far as I can tell the functions defined in test_type_support.c and test_type_support.cpp were simple void functions, but after loading their librariestype_support_dispatch called those functions and assigned their result to a pointer which was then returned, and that always returned null on gcc release. Even stranger, printing out the address of sym with std::cout in type_support_dispatch allowed the test to pass. It seems likely to me that the original code was causing undefined behavior and gcc's optimizations caused a different result than debug mode.
These tests were behaving differently under release mode than debug mode, which is how they were originally tested and evaluated. I'm not entirely sure of the full cause of the issue or why it worked in debug mode but not release. As far as I can tell the functions defined in
test_type_support.c
andtest_type_support.cpp
were simple void functions, but after loading their librariestype_support_dispatch
called those functions and assigned their result to a pointer which was then returned, and that always returned null on gcc release. Even stranger, printing out the address of sym with std::cout intype_support_dispatch
allowed the test to pass. It seems likely to me that the original code was causing undefined behavior and gcc's optimizations caused a different result than debug mode.Signed-off-by: Stephen Brawner stephenbrawner@verbsurgical.com