Closed mbutrovich closed 6 years ago
Looks like a similar issue to what was discussed in #995.
Also, if I disable the prior test (IntegerOverflow) and run the failing test (IntegerDivideByZero) in isolation, it passes.
I am not sure why commenting out the QueryCache::Instance().Clear()
line from the destructor of PelotonCodeGenTest
fixes the issue. The QueryCache
is used to bootstrap the catalog instance but that doesn't seem to cause the issue. The segfault occurs while throwing theRuntimeFunctions::ThrowDivideByZeroException()
exception.
Interestingly, it wasn't triggered in #1335. Here is the snippet of the log:
100% tests passed, 0 tests failed out of 177
My suspicion is this is manifesting a bug inside of LLVM's internal use of libunwind (they use it for their C++ ABI for exception handling), since Peloton never uses the library explicitly. A similar bug has been reported recently to LLVM, and it visible all the way back to LLVM 3.7:
https://www.mail-archive.com/llvm-bugs@lists.llvm.org/msg20647.html
Even with AddressSanitizer enabled, we wouldn't catch this if it was built with gcc since gcc doesn't use libunwind for its exception implementation.
But #1335 used clang to build on macOS. I don't think you can build peloton with gcc on macOS.
If it is really the bug @mbutrovich mentioned, we can't do much about it. We can try to change the order or the executed test cases so that the bug is not triggered... 😬
I tried that and it just causes the (now second) IntegerOverflow test to generate the segfault. :(
Current master branch no longer manifests this issue, and I don't believe this is a bug in our control anyway.
As of #1302 the master branch generates a segfault in value_integrity_test when compiling with Clang on macOS. When run with AddressSanitizer enabled, it implies that a bad memory access is generated within libunwind afte a DivideByZeroException is thrown.
I haven't verified if this is unique to Apple's custom Clang release or manifests on normal Clang as well. My clang version is:
Details on the segfault from AddressSanitizer are below: