jit_test.py address space limiting is incompatible to AddressSanitizer

RESOLVED FIXED in mozilla15

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: decoder, Assigned: decoder)

Tracking

Trunk
mozilla15
All
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [sg:want][asan][asan-test-blocker])

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
The jit_test.py script sets a limit on RLIMIT_AS (address space) prior to executing tests, if that limiting feature is available on the platform:

> def set_limits():
>    # resource module not supported on all platforms
>    try:
>        import resource
>        GB = 2**30
>        resource.setrlimit(resource.RLIMIT_AS, (1*GB, 1*GB))
>    except:
>        return

However, AddressSanitizer requires much more virtual memory:

> The ulimit -v command can be used with ASan-ified binaries. However, you should remember that ASan consumes 16 terabytes of virtual memory for shadow state and the ulimit -v value should be set accordingly.

This behavior causes make check to fail on all jit-tests. I'm working on a patch that adds a "--no-limit" option that disables the address space limit in jit_test.py. The option should then be passed by the js/src/Makefile if MOZ_ASAN is set.
I think the better option here is to just remove the setrlimit call.  This wasn't working reliably for me and when it did work, it reported the tests killed by rlimits under FAIL, with other unrelated failures.  Since it isn't available on all platforms anyway, the value of having it is dubious at best.

What I plan to do for jstests in the nearish future is to add a mode that prints stats out for every test, including memory usage.  This should be a much more reliable way to spot tests that use too much memory.
(Assignee)

Comment 2

5 years ago
(In reply to Terrence Cole [:terrence] from comment #1)
> I think the better option here is to just remove the setrlimit call.

Sounds like even less work for me ;) Want to make a patch or should I do so?
(Assignee)

Comment 3

5 years ago
Created attachment 619533 [details] [diff] [review]
Patch

This patch removes set_limits entirely as suggested by terrence.

Luke, if this is not ok with you, we can also go for an ASan specific solution :)
Assignee: general → choller
Status: NEW → ASSIGNED
Attachment #619533 - Flags: review?(luke)
Attachment #619533 - Flags: feedback?(terrence)
(Assignee)

Updated

5 years ago
Whiteboard: [sg:want][asan] → [sg:want][asan][asan-test-blocker]

Comment 4

5 years ago
Comment on attachment 619533 [details] [diff] [review]
Patch

I'm not a great reviewer for jit_tests.py; forwarding to Dave.
Attachment #619533 - Flags: review?(luke) → review?(dmandelin)
Attachment #619533 - Flags: review?(dmandelin) → review+
(Assignee)

Updated

5 years ago
Attachment #619533 - Flags: checkin?(gary)
Comment on attachment 619533 [details] [diff] [review]
Patch

http://hg.mozilla.org/integration/mozilla-inbound/rev/f031b89c104e
Attachment #619533 - Flags: checkin?(gary) → checkin+
Target Milestone: --- → mozilla15
https://hg.mozilla.org/mozilla-central/rev/f031b89c104e
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Attachment #619533 - Flags: feedback?(terrence) → feedback+
You need to log in before you can comment on or make changes to this bug.