Bug 142547 - ASAN_OPTIONS=allocator_may_return_null=1 needs to be set
Summary: ASAN_OPTIONS=allocator_may_return_null=1 needs to be set
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dana Burkart
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-03-10 15:34 PDT by Dana Burkart
Modified: 2015-03-18 17:03 PDT (History)
6 users (show)

See Also:


Attachments
Set allocator_may_return_null=1 (987 bytes, patch)
2015-03-10 15:41 PDT, Dana Burkart
ap: review-
Details | Formatted Diff | Diff
Set ASAN_OPTIONS in run-webkit-tests (4.67 KB, patch)
2015-03-18 16:31 PDT, Dana Burkart
ap: commit-queue-
Details | Formatted Diff | Diff
Fix style (4.60 KB, patch)
2015-03-18 16:37 PDT, Dana Burkart
no flags Details | Formatted Diff | Diff
Really fix style.... (4.60 KB, patch)
2015-03-18 16:39 PDT, Dana Burkart
no flags Details | Formatted Diff | Diff
Address Alexey's concerns (4.01 KB, patch)
2015-03-18 16:50 PDT, Dana Burkart
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dana Burkart 2015-03-10 15:34:51 PDT
Alexey says:

We have a test crash with ASan, because it tries to allocate too much, and ASan doesn't allow that.

We need to change the default behavior:

==45420==WARNING: AddressSanitizer failed to allocate 0xffffffffaffff6a0 bytes
==45420==AddressSanitizer's allocator is terminating the process instead of returning 0
==45420==If you don't like this behavior set allocator_may_return_null=1
==45420==AddressSanitizer CHECK failed: /SourceCache/clang/clang-603.0.12/src/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:149 "((0)) != (0)" (0x0, 0x0)
Comment 1 Dana Burkart 2015-03-10 15:35:25 PDT
<rdar://problem/20111863>
Comment 2 Dana Burkart 2015-03-10 15:41:01 PDT
Created attachment 248365 [details]
Set allocator_may_return_null=1
Comment 3 Geoffrey Garen 2015-03-10 15:44:29 PDT
Comment on attachment 248365 [details]
Set allocator_may_return_null=1

r=me
Comment 4 Geoffrey Garen 2015-03-10 15:44:42 PDT
Does this fix the plugin testcase?
Comment 5 Alexey Proskuryakov 2015-03-10 16:21:06 PDT
Comment on attachment 248365 [details]
Set allocator_may_return_null=1

Sadly, I don't think that this is going to work - ASAN_OPTIONS is a runtime variable, not a build time one AFAIK.
Comment 6 Dana Burkart 2015-03-10 16:23:45 PDT
(In reply to comment #5)
> Comment on attachment 248365 [details]
> Set allocator_may_return_null=1
> 
> Sadly, I don't think that this is going to work - ASAN_OPTIONS is a runtime
> variable, not a build time one AFAIK.

Yeah, I misunderstood this. This is going to be more difficult since we don't actually set any ASan-specific settings at runtime, and will have to come up with some way to do this.
Comment 7 Dana Burkart 2015-03-18 16:31:09 PDT
Created attachment 248981 [details]
Set ASAN_OPTIONS in run-webkit-tests
Comment 8 WebKit Commit Bot 2015-03-18 16:33:27 PDT
Attachment 248981 [details] did not pass style-queue:


ERROR: Tools/Scripts/webkitpy/common/asan/utils.py:32:  expected 2 blank lines, found 1  [pep8/E302] [5]
ERROR: Tools/Scripts/webkitpy/common/asan/utils.py:36:  whitespace before '}'  [pep8/E202] [5]
ERROR: Tools/Scripts/webkitpy/common/asan/__init__.py:1:  no newline at end of file  [pep8/W292] [5]
Total errors found: 3 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Dana Burkart 2015-03-18 16:37:49 PDT
Created attachment 248984 [details]
Fix style
Comment 10 Alexey Proskuryakov 2015-03-18 16:39:46 PDT
Comment on attachment 248981 [details]
Set ASAN_OPTIONS in run-webkit-tests

View in context: https://bugs.webkit.org/attachment.cgi?id=248981&action=review

> Tools/Scripts/webkitpy/common/asan/__init__.py:2
>  \ No newline at end of file

Should one be added?

> Tools/Scripts/webkitpy/common/asan/utils.py:13
> +#     * Neither the name of Google Inc. nor the names of its

Is this the right license?

The preferred WebKit license text is at <http://www.webkit.org/coding/bsd-license.html>.

> Tools/Scripts/webkitpy/common/asan/utils.py:34
> +        "abort_on_error" : 1,

I don't think that we want this.

> Tools/Scripts/webkitpy/common/asan/utils.py:36
> +        "handle_segv" : 0

Not sure about this, it should probably be in a separate fix if it's needed at all.

> Tools/Scripts/webkitpy/port/driver.py:320
> +        if ASanUtility.compiled_with_asan(self._port._path_to_driver()):

I just thought... We do we care, can we just always set the environment variable?
Comment 11 Dana Burkart 2015-03-18 16:39:51 PDT
Created attachment 248986 [details]
Really fix style....
Comment 12 WebKit Commit Bot 2015-03-18 16:42:16 PDT
Attachment 248986 [details] did not pass style-queue:


ERROR: Tools/Scripts/webkitpy/common/asan/utils.py:36:  whitespace before '}'  [pep8/E202] [5]
ERROR: Tools/Scripts/webkitpy/common/asan/utils.py:50:  blank line at end of file  [pep8/W391] [5]
Total errors found: 2 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 Alexey Proskuryakov 2015-03-18 16:42:42 PDT
Comment on attachment 248986 [details]
Really fix style....

View in context: https://bugs.webkit.org/attachment.cgi?id=248986&action=review

> Tools/Scripts/webkitpy/port/driver.py:320
> +        if ASanUtility.compiled_with_asan(self._port._path_to_driver()):

In addition to the above comments: this looks like code that is shared across all platforms, and we probably cannot run otool everywhere.
Comment 14 Dana Burkart 2015-03-18 16:45:14 PDT
(In reply to comment #10)
> Comment on attachment 248981 [details]
> Set ASAN_OPTIONS in run-webkit-tests
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=248981&action=review
> 
> > Tools/Scripts/webkitpy/common/asan/__init__.py:2
> >  \ No newline at end of file
> 
> Should one be added?
> 
> > Tools/Scripts/webkitpy/common/asan/utils.py:13
> > +#     * Neither the name of Google Inc. nor the names of its
> 
> Is this the right license?
> 
> The preferred WebKit license text is at
> <http://www.webkit.org/coding/bsd-license.html>.
> 
> > Tools/Scripts/webkitpy/common/asan/utils.py:34
> > +        "abort_on_error" : 1,
> 
> I don't think that we want this.
> 
> > Tools/Scripts/webkitpy/common/asan/utils.py:36
> > +        "handle_segv" : 0
> 
> Not sure about this, it should probably be in a separate fix if it's needed
> at all.
> 

I added "abort_on_error" and "handle_segv", as David Kilzer had added them to his patch. If we don't need them I will take them out.

> > Tools/Scripts/webkitpy/port/driver.py:320
> > +        if ASanUtility.compiled_with_asan(self._port._path_to_driver()):
> 
> I just thought... We do we care, can we just always set the environment
> variable?

I guess we don't care. I'll remove it.
Comment 15 Dana Burkart 2015-03-18 16:50:18 PDT
Created attachment 248987 [details]
Address Alexey's concerns
Comment 16 Alexey Proskuryakov 2015-03-18 16:52:09 PDT
Comment on attachment 248987 [details]
Address Alexey's concerns

View in context: https://bugs.webkit.org/attachment.cgi?id=248987&action=review

> Tools/Scripts/webkitpy/port/driver.py:320
> +        environment['ASAN_OPTIONS'] = ASanUtility.environment_options()

At this point, I think that it would be better to just say 

environment['ASAN_OPTIONS'] = "allocator_may_return_null=1"
Comment 17 WebKit Commit Bot 2015-03-18 16:53:35 PDT
Attachment 248987 [details] did not pass style-queue:


ERROR: Tools/Scripts/webkitpy/common/asan/utils.py:25:  whitespace before '}'  [pep8/E202] [5]
Total errors found: 1 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 18 Dana Burkart 2015-03-18 16:56:36 PDT
(In reply to comment #16)
> Comment on attachment 248987 [details]
> Address Alexey's concerns
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=248987&action=review
> 
> > Tools/Scripts/webkitpy/port/driver.py:320
> > +        environment['ASAN_OPTIONS'] = ASanUtility.environment_options()
> 
> At this point, I think that it would be better to just say 
> 
> environment['ASAN_OPTIONS'] = "allocator_may_return_null=1"

I agree, but I think that is going to get clunky soon, as I am sure we will be setting more environment variables soon.
Comment 19 Dana Burkart 2015-03-18 17:02:27 PDT
Merged r181714.