HexHive / HexType

HexType: Efficient Detection of Type Confusion Errors for C++
100 stars 21 forks source link

ChakraCore build error #2

Open mcgov opened 6 years ago

mcgov commented 6 years ago

Built ChakraCore with the hextype enabled version of clang from this repo on Ubuntu 16.04 LTS. I actually suspect that this could be a problem with Chakra's build makefiles, but I'd like help diagnosing what is going wrong.

Build succeeds, on attempting to run anything there is a fatal dllopen error.

dlopen() failed; dlerror says '/mnt/f/ChakraHex/ChakraCore/out/Debug/libChakraCore.so: undefined symbol: __update_phantom_info'
FATAL ERROR: Unable to load /mnt/f/ChakraHex/ChakraCore/out/Debug/libChakraCore.so GetLastError=0x7e

This looks like some symbol that should have been compiled in when I included -fsanitize=hextype. Any ideas? I'm digging around trying to find a missing -fsanitize line at the moment. I'd be very happy to get any advice. I guess I'll attempt building the library statically and report back.

mcgov commented 6 years ago

Building the library with --static fixes the issue. I can also confirm hextype will catch some type confusions when compiled into the executable ch (though not in JIT compiled code since it lacks instrumentation) when it's compiled with ChakraCore embedded statically.

Pretty neat! Have you experienced issues using hextype sanitization in dynamic libraries? Is this maybe something smart people just know to avoid?

jys0710 commented 6 years ago

We did not test this case. Thanks for the report and I will try to test it and check the result.