WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
148623
Implement bmalloc::isASanEnabled for generic Unix
https://bugs.webkit.org/show_bug.cgi?id=148623
Summary
Implement bmalloc::isASanEnabled for generic Unix
Michael Catanzaro
Reported
2015-08-30 16:30:09 PDT
If you only care about Clang (not sure), bmalloc::isASanEnabled could be as simple as: static bool isASanEnabled() { #if defined(__has_feature) && __has_feature(address_sanitizer) return true; #else return false; #endif } Unless there is some reason I don't understand for the runtime check. GCC supports asan but not __has_feature. This runtime check works: void *handle = dlopen(nullptr, RTLD_NOW); if (!handle) return false; bool result = !!dlsym(handle, "__asan_poison_memory_region"); dlclose(handle); return result; I expect that would work fine on Darwin too.
Attachments
Patch
(2.35 KB, patch)
2015-08-30 16:34 PDT
,
Michael Catanzaro
no flags
Details
Formatted Diff
Diff
Patch
(2.39 KB, patch)
2015-08-30 16:43 PDT
,
Michael Catanzaro
no flags
Details
Formatted Diff
Diff
Patch
(1.92 KB, patch)
2015-08-31 09:31 PDT
,
Michael Catanzaro
ggaren
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Michael Catanzaro
Comment 1
2015-08-30 16:34:34 PDT
Created
attachment 260254
[details]
Patch
Michael Catanzaro
Comment 2
2015-08-30 16:43:54 PDT
Created
attachment 260255
[details]
Patch
Alexey Proskuryakov
Comment 3
2015-08-30 17:43:05 PDT
The runtime check is needed because we need to disable bmalloc whenever ASan is enabled in the process - even if bmalloc itself is compiled without ASan.
Michael Catanzaro
Comment 4
2015-08-31 09:28:56 PDT
OK, that makes sense.
Michael Catanzaro
Comment 5
2015-08-31 09:31:30 PDT
Created
attachment 260289
[details]
Patch
Geoffrey Garen
Comment 6
2015-08-31 13:16:47 PDT
Comment on
attachment 260289
[details]
Patch r=me
Michael Catanzaro
Comment 7
2015-08-31 13:41:41 PDT
Committed
r189181
: <
http://trac.webkit.org/changeset/189181
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug