Skip to content

Commit

Permalink
test: ignore asan new_delete_type_mismatch
Browse files Browse the repository at this point in the history
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: nodejs#35669
  • Loading branch information
danbev committed Oct 20, 2020
1 parent 9e227d5 commit 6e63ce4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/cctest/test_environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6e63ce4

Please sign in to comment.