Mailinglist Archive: opensuse-bugs (4644 mails)

< Previous Next >
[Bug 1045340] regression: java segfaults on latest kernels caused by the stack gap fix
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Thu, 22 Jun 2017 09:34:55 +0000
  • Message-id: <bug-1045340-21960-sJThIt9UQA@http.bugzilla.suse.com/>
http://bugzilla.suse.com/show_bug.cgi?id=1045340
http://bugzilla.suse.com/show_bug.cgi?id=1045340#c18

--- Comment #18 from Michal Hocko <mhocko@xxxxxxxx> ---
(In reply to Vlastimil Babka from comment #10)
(In reply to Vlastimil Babka from comment #9)
Catchpoint 1 (call to syscall mmap2), 0xf7fd9f89 in __kernel_vsyscall ()

(gdb) bt
#0 0xf7fd9f89 in __kernel_vsyscall ()
#1 0xf7454508 in mmap () from /lib/libc.so.6
#2 0xf7a51cdb in os::commit_memory(char*, unsigned int, bool) () from
/opt/novell/groupwise/client/java/lib/i386/client/libjvm.so

OK, this is what I found in jdk source
// NOTE: Linux kernel does not really reserve the pages for us.
// All it does is to check if there are enough free pages
// left at the time of mmap(). This could be a potential
// problem.
bool os::commit_memory(char* addr, size_t size, bool exec) {
int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
uintptr_t res = (uintptr_t) ::mmap(addr, size, prot,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0);
return res != (uintptr_t) MAP_FAILED;

}

which explains it I am afraid. We simply smash a new mapping in the middle of
the stack. And so the stack expansion cannot possibly work. :/

--
You are receiving this mail because:
You are on the CC list for the bug.
< Previous Next >
References