[Webkit-unassigned] [Bug 146440] Crash on xLarge memory allocation using bmalloc on 32bit systems

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 2 10:23:34 PDT 2015


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

--- Comment #11 from Mario Sanchez Prada <mario at webkit.org> ---
(In reply to comment #10)
> (In reply to comment #6)
> > (In reply to comment #4)
> > > [...]
> > > What about setting this flag only for the bmalloc source files at
> > > Source/bmalloc/CMakeLists.txt . Would it be enough?
> > 
> > Not sure, but I will try that out just in case, I'd rather keep compiler
> > optimizations enabled whenever/wherever possible. Thanks for the suggestion.
> 
> I did this test right now but, unfortunately, that did not seem to be enough
> to get rid of the crash. That suggests the optimization must be disabled
> from somewhere else, I think I will try disabling it in some other places...

Indeed, just disabling it in bmalloc did not work, but disabling it for WebCore **only** did get rid of the crash too, so I think that's the one I'm proposing.

More specifically, this patch fixed the issue as well as the previous one I proposed, but without removing the optimization from gcc when building bmalloc, WTF, JSC and the WebKit API layers: "only" from WebCore, which is better.

See the proposed diff below:

diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index 564a239..794caeb 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -3574,6 +3574,14 @@ add_library(WebCore ${WebCore_LIBRARY_TYPE} ${WebCore_SOURCES})
 set_target_properties(WebCore PROPERTIES COMPILE_DEFINITIONS "BUILDING_WebCore")
 set_target_properties(WebCore PROPERTIES FOLDER "WebCore")

+# The -ftree-sra optimization (implicit with -O2) causes crashes when
+# allocating large chunks of memory using bmalloc on Intel 32bit.
+# See https://bugs.webkit.org/show_bug.cgi?id=146440
+string(TOLOWER ${CMAKE_HOST_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_HOST_SYSTEM_PROCESSOR)
+if (CMAKE_COMPILER_IS_GNUCXX AND "${LOWERCASE_CMAKE_HOST_SYSTEM_PROCESSOR}" MATCHES "(i[3-6]86|x86)")
+    ADD_TARGET_PROPERTIES(WebCore COMPILE_FLAGS "-fno-tree-sra")
+endif ()
+
 if (WebCore_OUTPUT_NAME)
     set_target_properties(WebCore PROPERTIES OUTPUT_NAME ${WebCore_OUTPUT_NAME})
 endif ()

What do you think? Is this worth proposing upstream?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150702/142572cd/attachment.html>


More information about the webkit-unassigned mailing list