[Webkit-unassigned] [Bug 209236] REGRESSION(r249808): [GTK] Crash in JSC Config::permanentlyFreeze() on architectures ppc64el/s390x

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 18 16:37:36 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=209236

--- Comment #20 from Michael Catanzaro <mcatanzaro at gnome.org> ---
Sebastien, you told me there was no crash. :( A crash makes everything way easier!

(In reply to Carlos Alberto Lopez Perez from comment #18)
> Do you mean it lacks support for mprotect() with PROT_READ ?

errno is set on failure, so WebKit should check errno and print a proper error using strerror(errno) to give us an idea of what's going wrong. But I'm pretty sure it's going to be EINVAL. Look:

EINVAL addr is not a valid pointer, or not a  multiple  of  the  system
              page size.

And I see we have in JSCConfig.h:

#if !OS(WINDOWS)
constexpr size_t ConfigSizeToProtect = 16 * KB;
#else
constexpr size_t ConfigSizeToProtect = 4 * KB;
#endif

which is definitely incorrect. This is reminiscent of bug #182923, fixed in r232909. Note that in that revision, the task was to find a block size that was *at least as big* as the actual page size, so it was not a precise fix: we just guessed 64 KB was big enough for strange architectures without attempting to be precise about it. Hopefully the same approach would work here?

I'm not sure where to find correct pages sizes to assume. Looking at an internal email that doesn't cite any sources, it looks like s390x uses 4 KB pages, ppc64le uses 64 KB pages on RHEL but 4 KB on various other distros (would be too easy otherwise!), aarch64 uses 64 KB pages... though aarch64 is getting 16 KB block sizes in MarkedBlock.h without crashing, because we have CPU(ARM64) so it shouldn't be CPU(UNKNOWN). And afaik all of the above can be changed at kernel compile time, so we just hope by convention that it's the same on all distros, except ppc64le where we know it isn't. So conclusion: ?????????

The best solution is to get page size at runtime using sysconf(_SC_PAGESIZE), but it looks like the code really wants a compile-time solution. So maybe just hardcode 64 KB for these CPUs and for CPU(UNKNOWN)? Ideally we would share the value with MarkedBlock.h? clopez, what do you think?

Anyway, Sebastien, try changing ConfigSizeToProtect to 64 * KB and see if that works. My guess is that will fix ppc64le, but something somewhere else will be broken for s390x.

P.S. You know if Debian and Red Hat can't agree on whether to spell ppc64le or ppc64el, we definitely won't be able to agree on page size. :P It looks like Debian distros are saying ppc64el while Red Hat and SUSE say ppc64le. Whatever....

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200318/5c34603a/attachment-0001.htm>


More information about the webkit-unassigned mailing list