Last Comment Bug 749588 - address space limiting is incompatible to AddressSanitizer
: address space limiting is incompatible to AddressSanitizer
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All Linux
-- normal (vote)
: mozilla15
Assigned To: Christian Holler (:decoder)
: Jason Orendorff [:jorendorff]
Depends on:
Blocks: 664901
  Show dependency treegraph
Reported: 2012-04-27 05:52 PDT by Christian Holler (:decoder)
Modified: 2012-05-08 11:19 PDT (History)
6 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch (1.23 KB, patch)
2012-04-30 05:45 PDT, Christian Holler (:decoder)
dmandelin: review+
terrence.d.cole: feedback+
gary: checkin+
Details | Diff | Splinter Review

Description User image Christian Holler (:decoder) 2012-04-27 05:52:58 PDT
The 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 The option should then be passed by the js/src/Makefile if MOZ_ASAN is set.
Comment 1 User image Terrence Cole [:terrence] 2012-04-27 11:28:49 PDT
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.
Comment 2 User image Christian Holler (:decoder) 2012-04-27 12:58:04 PDT
(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?
Comment 3 User image Christian Holler (:decoder) 2012-04-30 05:45:36 PDT
Created attachment 619533 [details] [diff] [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 :)
Comment 4 User image Luke Wagner [:luke] 2012-04-30 10:11:59 PDT
Comment on attachment 619533 [details] [diff] [review]

I'm not a great reviewer for; forwarding to Dave.

Note You need to log in before you can comment on or make changes to this bug.