Closed Bug 749588 Opened 12 years ago Closed 12 years ago

jit_test.py address space limiting is incompatible to AddressSanitizer

Categories

(Core :: JavaScript Engine, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: decoder, Assigned: decoder)

References

Details

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

Attachments

(1 file)

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.
(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?
Attached patch PatchSplinter Review
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)
Whiteboard: [sg:want][asan] → [sg:want][asan][asan-test-blocker]
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+
Attachment #619533 - Flags: checkin?(gary)
Target Milestone: --- → mozilla15
https://hg.mozilla.org/mozilla-central/rev/f031b89c104e
Status: ASSIGNED → RESOLVED
Closed: 12 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.

Attachment

General

Created:
Updated:
Size: