This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/55517] [ASAN] ASAN doesn't work with (soft) ulimit on virtual memory


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55517

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-28 13:00:27 UTC ---
I think raising soft limit is a standard approach done in multiple places, even
gcc itself does that, and is far better than just crashing.  Unlike
RLIMIT_STACK, it doesn't cause significant problems if you enlarge RLIMIT_AS
during the runtime of a program as opposed to making sure it is big enough
already at process start.

You don't need to call getrlimit unconditionally, all you can do is upon mmap
MAP_FAILED on these 3 large mmap calls you try to do getrlimit and if hard
limit is bigger than what is needed and soft limit smaller, increase, setrlimit
and retry the mmap.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]