This is an archive of the discontinued LLVM Phabricator instance.

Add FreeBSD support to the address sanitizer's deep_call_stack.cc test case
ClosedPublic

Authored by kutuzov.viktor.84 on Jul 17 2014, 7:43 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

kutuzov.viktor.84 retitled this revision from to Add FreeBSD support to the address sanitizer's deep_call_stack.cc test case.
kutuzov.viktor.84 updated this object.
kutuzov.viktor.84 edited the test plan for this revision. (Show Details)
kutuzov.viktor.84 added reviewers: kcc, samsonov.
kutuzov.viktor.84 added subscribers: Unknown Object (MLST), emaste.
samsonov edited edge metadata.Jul 17 2014, 11:49 AM

Kostya, do you think we'd better relax the test a bit and use 15K on all platforms? I'd vote for that.

Kostya, do you think we'd better relax the test a bit and use 15K on all platforms? I'd vote for that.

I agree.

In addition, if we find defaults in FreeBSD that are at odds with all other contemporary platforms the FreeBSD team should give consideration to changing those defaults.

test/asan/TestCases/deep_call_stack.cc
34 ↗(On Diff #11579)

Should we have a "middle" value for FreeBSD too?

kcc edited edge metadata.Jul 25 2014, 4:55 AM

maybe we can do 'ulimit -s' to ensure 8M stack on all platforms for this test?

Further investigation indicates that the problem is the main thread stack size and not the system stack size.

According to the discussion at:

http://freebsd.1045724.n5.nabble.com/libthr-and-main-thread-stack-size-td5935621.html

the main thread stack size is set to 4M on x86-64 and cannot be changed. For i386 it is half of that value.

What if we reduce the depth of the recursion for all platforms and add 'ulimit -s 4096' to the run lines?

kutuzov.viktor.84 edited edge metadata.

Updated.

I'm slightly concerned about portability, but it looks like we can use "ulimit -s" on Mac OS. I'll defer to Kostya to decide if we need even less deep recursion, or fine with making this test Posix-only.

kcc added inline comments.Aug 14 2014, 8:52 AM
test/asan/TestCases/deep_call_stack.cc
4 ↗(On Diff #12301)

please don't modify limits for the other lines.
What you need is (ulimit -s 4096; %run %t)

Updated as specified.

kcc accepted this revision.Sep 9 2014, 8:27 PM
kcc edited edge metadata.

LGTM, sorry for delay

This revision is now accepted and ready to land.Sep 9 2014, 8:27 PM
Diffusion closed this revision.Sep 17 2014, 12:41 AM
Diffusion updated this revision to Diff 13771.

Closed by commit rL217943 (authored by vkutuzov).