mapbox / node-cpp-skel

Skeleton for bindings to C++ libraries for Node.js using node-addon-api
Creative Commons Zero v1.0 Universal
72 stars 10 forks source link

fix travis build issue #157

Open zmofei opened 5 years ago

zmofei commented 5 years ago

This morning, I found that all the c++ build job related to "TOOLSET=asan" returns an error, even we try to rebuild the old jobs which already passed:

image

image

Debug w/ @springmeyer, we thought this is a new Travis error due to a new leak in node.js.

To fix this issue we need to add echo "leak:node::Start" >> ${SUPPRESSION_FILE} in scripts/sanitize.sh

diff --git a/scripts/sanitize.sh b/scripts/sanitize.sh
index 4168cca..28c9344 100755
--- a/scripts/sanitize.sh
+++ b/scripts/sanitize.sh
@@ -24,6 +24,7 @@ SUPPRESSION_FILE="/tmp/leak_suppressions.txt"
 echo "leak:__strdup" > ${SUPPRESSION_FILE}
 echo "leak:v8::internal" >> ${SUPPRESSION_FILE}
 echo "leak:node::CreateEnvironment" >> ${SUPPRESSION_FILE}
+echo "leak:node::Start" >> ${SUPPRESSION_FILE}
 echo "leak:node::Init" >> ${SUPPRESSION_FILE}
 export ASAN_SYMBOLIZER_PATH=$(pwd)/mason_packages/.link/bin/llvm-symbolizer
 export MSAN_SYMBOLIZER_PATH=$(pwd)/mason_packages/.link/bin/llvm-symbolizer

OR see this PR https://github.com/mapbox/node-cpp-skel/pull/156/files.

This will fix the issue.

cc w/ @mapbox/maps-api @flippmoke @mapsam @millzpaugh

mapsam commented 5 years ago

Good find @zmofei - thanks for putting together a PR!

springmeyer commented 5 years ago

Thanks @zmofei 👍 This adjustment will keep things passing and will avoid builds erroring on what we don't have control over. For the record I think what is happening is that:

There may be value in reporting the leaks to the node.js project, but so far I've not felt like this is actionable because its not clear from the message exactly where they are coming from:

=================================================================
==5708==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x2b7243330af2 in operator new(unsigned long) /home/travis/build/mapbox/mason/mason_packages/.build/llvm-6.0.1/build/../projects/compiler-rt/lib/asan/asan_new_delete.cc:92:3
    #1 0x8e4100 in node::Start(int, char**) (/home/travis/.nvm/versions/node/v10.14.2/bin/node+0x8e4100)
    #2 0x2b7244ea6f44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21f44)

But perhaps @flippmoke or @ericfischer might have ideas on where this leak is coming from in node? The diff between v10.14.1 and v10.14.2 is pretty large so its not immediately obvious to me where to look:

git diff v10.14.1 v10.14.2 src/ > d.diff

https://gist.github.com/springmeyer/a925043ab79dee2b98054111bbd3e0b6