WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 296043
296880
REGRESSION(
296858@main
): [GTK][WPE] build broken with JOURNALD_LOG disabled
https://bugs.webkit.org/show_bug.cgi?id=296880
Summary
REGRESSION(296858@main): [GTK][WPE] build broken with JOURNALD_LOG disabled
Miguel Gomez
Reported
2025-08-04 06:51:55 PDT
The problem seems to come from the replacement of fprintf with SAFE_PRINTF that was done in Logger.h. When building with JOURNALD_LOG disabled, SAFE_PRINTF is used to print the logs, which triggers an static assertion indicating that the function cannot be used to print char* variables, which are basically what we use for the errors. The error message looks like this: In file included from /host/home/magomez/webkit/WebKit/WebKitBuild/WPE/Release/WTF/Headers/wtf/MallocCommon.h:29, from /host/home/magomez/webkit/WebKit/WebKitBuild/WPE/Release/WTF/Headers/wtf/FastMalloc.h:26, from /host/home/magomez/webkit/WebKit/Source/WebCore/PAL/config.h:36, from /host/home/magomez/webkit/WebKit/Source/WebCore/PAL/pal/text/TextEncodingRegistry.cpp:27: /host/home/magomez/webkit/WebKit/WebKitBuild/WPE/Release/WTF/Headers/wtf/StdLibExtras.h: In instantiation of ‘typename std::enable_if<std::is_pointer<_Tp>::value, T>::type WTF::safePrintfType(T) [with T = const char*; typename std::enable_if<std::is_pointer<_Tp>::value, T>::type = const char*]’: /host/home/magomez/webkit/WebKit/Source/WebCore/PAL/pal/text/TextEncodingRegistry.cpp:299:9: required from here /host/home/magomez/webkit/WebKit/WebKitBuild/WPE/Release/WTF/Headers/wtf/StdLibExtras.h:1183:25: error: static assertion failed: char* is not bounds safe; please use a null terminated string type 1183 | static_assert(!std::is_same_v<std::remove_cv_t<std::remove_pointer_t<T>>, char>, "char* is not bounds safe; please use a null terminated string type"); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Then, if RELEASE_LOG is enabled, more errors are being shown because of the usage of SAFE_PRINTF. Those errors look like this: In file included from WTF/Headers/wtf/MallocCommon.h:29, from WTF/Headers/wtf/FastMalloc.h:26, from WTF/Headers/wtf/TZoneMalloc.h:35, from ./Source/WebKit/WebKit2Prefix.h:67, from <command-line>: Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp: In member function 'virtual WTF::HashMap<WTF::String, WTF::String> WebKit::SQLiteStorageArea::allItems()': WTF/Headers/wtf/StdLibExtras.h:1173:50: error: no matching function for call to 'safePrintfType(std::experimental::fundamentals_v3::expected<WTF::String, WebKit::StorageError>::error_type&)' 1173 | #define WTF_FOR_EACH_HELPER(macro, a1, ...) macro(a1) __VA_OPT__(, WTF_FOR_EACH_AGAIN WTF_PARENS (macro, __VA_ARGS__)) | ^ WTF/Headers/wtf/StdLibExtras.h:1172:26: note: in definition of macro 'WTF_EXPAND1' 1172 | #define WTF_EXPAND1(...) __VA_ARGS__ | ^~~~~~~~~~~ WTF/Headers/wtf/StdLibExtras.h:1171:38: note: in expansion of macro 'WTF_EXPAND1' 1171 | #define WTF_EXPAND2(...) WTF_EXPAND1(WTF_EXPAND1(WTF_EXPAND1(WTF_EXPAND1(__VA_ARGS__)))) | ^~~~~~~~~~~ WTF/Headers/wtf/StdLibExtras.h:1171:50: note: in expansion of macro 'WTF_EXPAND1' 1171 | #define WTF_EXPAND2(...) WTF_EXPAND1(WTF_EXPAND1(WTF_EXPAND1(WTF_EXPAND1(__VA_ARGS__)))) | ^~~~~~~~~~~ then a lot of errors related to expanding macros until this WTF/Headers/wtf/Assertions.h:745:41: note: in expansion of macro 'LOGF' 745 | #define RELEASE_LOG_ERROR(channel, ...) LOGF(channel, 1, __VA_ARGS__) | ^~~~ Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp:319:17: note: in expansion of macro 'RELEASE_LOG_ERROR' 319 | RELEASE_LOG_ERROR(Storage, "SQLiteStorageArea::allItems failed during read from cache (%hhu)" PUBLIC_LOG_STRING, result.error()); | ^~~~~~~~~~~~~~~~~ WTF/Headers/wtf/StdLibExtras.h:1180:88: note: candidate: 'template<class T> typename std::enable_if<std::is_integral<_Tp>::value, _Tp>::type WTF::safePrintfType(T)' 1180 | template <class T> inline typename std::enable_if<std::is_integral<T>::value, T>::type safePrintfType(T arg) { return arg; } | ^~~~~~~~~~~~~~ WTF/Headers/wtf/StdLibExtras.h:1180:88: note: template argument deduction/substitution failed: WTF/Headers/wtf/StdLibExtras.h: In substitution of 'template<class T> typename std::enable_if<std::is_integral<_Tp>::value, _Tp>::type WTF::safePrintfType(T) [with T = WebKit::StorageError]': Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp:319:17: required from here WTF/Headers/wtf/StdLibExtras.h:1180:88: error: no type named 'type' in 'struct std::enable_if<false, WebKit::StorageError>' WTF/Headers/wtf/StdLibExtras.h:1181:94: note: candidate: 'template<class T> typename std::enable_if<std::is_floating_point<_Tp>::value, T>::type WTF::safePrintfType(T)' 1181 | template <class T> inline typename std::enable_if<std::is_floating_point<T>::value, T>::type safePrintfType(T arg) { return arg; }
Attachments
Add attachment
proposed patch, testcase, etc.
Adrian Perez
Comment 1
2025-08-04 07:10:30 PDT
I have found this and reported already in
bug #296043
-- and I proposed a patch, which is pending review:
https://github.com/WebKit/WebKit/pull/48366
*** This bug has been marked as a duplicate of
bug 296043
***
Miguel Gomez
Comment 2
2025-08-04 07:18:37 PDT
Ah, great!! Thanks Adrian!!
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug