NEW 288024
ENABLE_MALLOC_HEAP_BREAKDOWN=1 causes new build errors in JSC after 290626@main
https://bugs.webkit.org/show_bug.cgi?id=288024
Summary ENABLE_MALLOC_HEAP_BREAKDOWN=1 causes new build errors in JSC after 290626@main
benjamin.j.grant
Reported 2025-02-19 16:15:42 PST
Created attachment 474302 [details] Patch fixing errors in MallocCommon.h with ENABLE_MALLOC_HEAP_BREAKDOWN=1 Commit 290626@main introduces build errors when malloc heap breakdown is used. After changing PlatformEnable.h and BPlatform.h according to https://docs.webkit.org/Infrastructure/MemoryInspection.html#malloc-heap-breakdown, I get this error: > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -ivfsstatcache /Users/ben/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/macosx15.1-24B75-26c8390a7c93c703a57fb2538426748e.sdkstatcache -fmessage-length\=216 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fcolor-diagnostics -Wno-trigraphs -Werror -Wno-missing-field-initializers -Wmissing-prototypes -Wunreachable-code -Wnon-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wsign-compare -Wno-shorten-64-to-32 -Wnewline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -index-store-path /Users/ben/Library/Developer/Xcode/DerivedData/WebKit-gyjdrlxthwjchfgyraqnnpzuqsst/Index.noindex/DataStore -Wall -Wc99-designator -Wconditional-uninitialized -Wextra -Wdeprecated-enum-enum-conversion -Wdeprecated-enum-float-conversion -Wenum-float-conversion -Wfinal-dtor-non-final-class -Wformat\=2 -Wmisleading-indentation -Wreorder-init-list -Wundef -Wvla -Wcast-qual -Wchar-subscripts -Wextra-tokens -Winit-self -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -Wvla -Wliteral-conversion -Wthread-safety -Wunsafe-buffer-usage @/Users/ben/code/WebKit/WebKitBuild/WTF.build/Debug/WTF.build/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp -MMD -MT dependencies -MF /Users/ben/code/WebKit/WebKitBuild/WTF.build/Debug/WTF.build/Objects-normal/arm64/WTFString.d --serialize-diagnostics /Users/ben/code/WebKit/WebKitBuild/WTF.build/Debug/WTF.build/Objects-normal/arm64/WTFString.dia -c /Users/ben/code/WebKit/Source/WTF/wtf/text/WTFString.cpp -o /Users/ben/code/WebKit/WebKitBuild/WTF.build/Debug/WTF.build/Objects-normal/arm64/WTFString.o -index-unit-output-path /WTF.build/Debug/WTF.build/Objects-normal/arm64/WTFString.o > In file included from /Users/ben/code/WebKit/Source/WTF/wtf/text/WTFString.cpp:23: > In file included from /Users/ben/code/WebKit/WebKitBuild/Debug/usr/local/include/wtf/text/WTFString.h:29: > In file included from /Users/ben/code/WebKit/WebKitBuild/Debug/usr/local/include/wtf/text/StringImpl.h:39: > /Users/ben/code/WebKit/Source/WTF/wtf/Vector.h:700:5: error: too few arguments provided to function-like macro invocation > 700 | WTF_MAKE_CONFIGURABLE_ALLOCATED_WITH_HEAP_IDENTIFIER(Vector, FastMalloc); > | ^ > In file included from /Users/ben/code/WebKit/Source/WTF/wtf/text/WTFString.cpp:22: > In file included from /Users/ben/code/WebKit/Source/WTF/config.h:31: > In file included from /Users/ben/code/WebKit/Source/WTF/wtf/FastMalloc.h:26: > /Users/ben/code/WebKit/Source/WTF/wtf/MallocCommon.h:184:79: note: expanded from macro 'WTF_MAKE_CONFIGURABLE_ALLOCATED_WITH_HEAP_IDENTIFIER' > 184 | WTF_MAKE_CONFIGURABLE_ALLOCATED_WITH_HEAP_IDENTIFIER_IMPL(classname, alloc) \ > | ^ > /Users/ben/code/WebKit/Source/WTF/wtf/MallocCommon.h:148:9: note: macro 'WTF_MAKE_CONFIGURABLE_ALLOCATED_WITH_HEAP_IDENTIFIER_IMPL' defined here > 148 | #define WTF_MAKE_CONFIGURABLE_ALLOCATED_WITH_HEAP_IDENTIFIER_IMPL(classname, alloc, family) \ > | ^ > In file included from /Users/ben/code/WebKit/Source/WTF/wtf/text/WTFString.cpp:23: > In file included from /Users/ben/code/WebKit/WebKitBuild/Debug/usr/local/include/wtf/text/WTFString.h:29: > In file included from /Users/ben/code/WebKit/WebKitBuild/Debug/usr/local/include/wtf/text/StringImpl.h:39: > /Users/ben/code/WebKit/Source/WTF/wtf/Vector.h:700:5: error: unknown type name 'WTF_MAKE_CONFIGURABLE_ALLOCATED_WITH_HEAP_IDENTIFIER_IMPL' > 700 | WTF_MAKE_CONFIGURABLE_ALLOCATED_WITH_HEAP_IDENTIFIER(Vector, FastMalloc); > | ^ > In file included from /Users/ben/code/WebKit/Source/WTF/wtf/text/WTFString.cpp:22: > In file included from /Users/ben/code/WebKit/Source/WTF/config.h:31: > In file included from /Users/ben/code/WebKit/Source/WTF/wtf/FastMalloc.h:26: > /Users/ben/code/WebKit/Source/WTF/wtf/MallocCommon.h:184:5: note: expanded from macro 'WTF_MAKE_CONFIGURABLE_ALLOCATED_WITH_HEAP_IDENTIFIER' > 184 | WTF_MAKE_CONFIGURABLE_ALLOCATED_WITH_HEAP_IDENTIFIER_IMPL(classname, alloc) \ > | ^ > In file included from /Users/ben/code/WebKit/Source/WTF/wtf/text/WTFString.cpp:23: > In file included from /Users/ben/code/WebKit/WebKitBuild/Debug/usr/local/include/wtf/text/WTFString.h:29: > In file included from /Users/ben/code/WebKit/WebKitBuild/Debug/usr/local/include/wtf/text/StringImpl.h:39: > /Users/ben/code/WebKit/Source/WTF/wtf/Vector.h:700:5: error: expected member name or ';' after declaration specifiers > 700 | WTF_MAKE_CONFIGURABLE_ALLOCATED_WITH_HEAP_IDENTIFIER(Vector, FastMalloc); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from /Users/ben/code/WebKit/Source/WTF/wtf/text/WTFString.cpp:22: > In file included from /Users/ben/code/WebKit/Source/WTF/config.h:31: > In file included from /Users/ben/code/WebKit/Source/WTF/wtf/FastMalloc.h:26: > /Users/ben/code/WebKit/Source/WTF/wtf/MallocCommon.h:184:81: note: expanded from macro 'WTF_MAKE_CONFIGURABLE_ALLOCATED_WITH_HEAP_IDENTIFIER' > 184 | WTF_MAKE_CONFIGURABLE_ALLOCATED_WITH_HEAP_IDENTIFIER_IMPL(classname, alloc) \ > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ The issue is that when heap breakdown is enabled, WTF_MAKE_CONFIGURABLE_ALLOCATED_WITH_HEAP_IDENTIFIER_IMPL takes 3 parameters instead of 2, but WTF_MAKE_CONFIGURABLE_ALLOCATED_WITH_HEAP_IDENTIFIER only passes 2 parameters (like it does when heap breakdown is disabled). The attached patch fixes building JSC only by supplying the third parameter in WTF_MAKE_CONFIGURABLE_ALLOCATED_WITH_HEAP_IDENTIFIER's definition. To fix building other components I think https://github.com/WebKit/WebKit/pull/32329 will be needed. I wasn't sure if this is best categorized as JSC or WTF, so I've left it in "New Bugs" for now.
Attachments
Patch fixing errors in MallocCommon.h with ENABLE_MALLOC_HEAP_BREAKDOWN=1 (1.04 KB, patch)
2025-02-19 16:15 PST, benjamin.j.grant
no flags
Radar WebKit Bug Importer
Comment 1 2025-02-26 16:16:16 PST
Note You need to log in before you can comment on or make changes to this bug.