Closed Bug 747322 Opened 9 years ago Closed 9 years ago
jemalloc crashes during malloc
_init _hard on s390x
S390 syscall interface doesn't support passing more than 5 arguments, so instead of giving the 6 arguments required for SYS_mmap, it gives one that is a pointer to a struct containing the arguments. The implementation I dif for s390 works fine on s390, but doesn't work on s390x because of expected padding: the arguments in the struct are all expected by the kernel to be 64-bits. So what happens next is that the syscall returns us a NULL pointer, and jemalloc initialization uses that pointer assuming it's not NULL, and dereferences it. Kaboom. The patch solves the issue by using the "long" type instead of int, which happens to be the right size on both s390 and s390x. As a matter of fact, that's the type used in the kernel source itself (even for pointer members). The kernel actually uses unsigned long, but sign doesn't matter here.
Attachment #616908 - Flags: review?(justin.lebar+bug)
Attachment #616908 - Flags: review?(justin.lebar+bug) → review+
Had forgotten to update this bug: http://hg.mozilla.org/mozilla-central/rev/bd9cdcd353e6
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in before you can comment on or make changes to this bug.