From 6e63ce438814e2e26293620fae26c2af1bc5e1a4 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 20 Oct 2020 14:40:26 +0200 Subject: [PATCH] test: ignore asan new_delete_type_mismatch This commit adds ignore for new_delete_type_mismatch in EnvironmentTest as this is currently generating an error when address sanitizer is enabled and gcc is used as the compiler. This might be a little risky as we run the risk of missing other errors of this same type but I'm still looking into if this could be solved in some other way in V8 and perhaps this could be a short term fix. Fixes: https://github.com/nodejs/node/issues/35669 --- test/cctest/test_environment.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/cctest/test_environment.cc b/test/cctest/test_environment.cc index 27706044b800f6..14cb0330f6eacc 100644 --- a/test/cctest/test_environment.cc +++ b/test/cctest/test_environment.cc @@ -344,6 +344,17 @@ TEST_F(EnvironmentTest, SetImmediateCleanup) { EXPECT_EQ(called_unref, 0); } +/* + * When Address Sanitizer (asan) is enabled (--enable-asan) and gcc is used as + * the compiler, asan will generate an error about a type/size mismatch of + * v8::BackingStore and v8::internal::BackingStore when deleting. The following + * function is used to ignore this error. + * Ref: https://github.com/nodejs/node/issues/35669 + */ +extern "C" const char* __asan_default_options() { + return "new_delete_type_mismatch=0"; +} + static char hello[] = "hello"; TEST_F(EnvironmentTest, BufferWithFreeCallbackIsDetached) {