Bug 165075 - REGRESSION(r200346): WTFLogVerbose is passing arguments to WTFLog incorrectly
Summary: REGRESSION(r200346): WTFLogVerbose is passing arguments to WTFLog incorrectly
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: https://github.com/WebKit/webkit/blob...
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-26 04:06 PST by Ihor Ivlev
Modified: 2017-01-30 12:06 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ihor Ivlev 2016-11-26 04:06:24 PST
WTFLogVerbose is a variadic function.
It is trying to pass argument list to another variadic function, WTFLog.
*This is not possible* (leads to output corruption), we may consider using a variadic macro or a function that takes va_args instead.
Explanation why this is not possible:
http://c-faq.com/varargs/handoff.html
Comment 1 Keith Rollin 2017-01-30 12:06:16 PST
WTFLogVerbose is referenced in only one place:


$ rg -w WTFLogVerbose
WTF/wtf/Assertions.cpp
495:void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChannel* channel, const char* format, ...)

WTF/wtf/Assertions.h
175:WTF_EXPORT_PRIVATE void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChannel*, const char* format, ...) WTF_ATTRIBUTE_PRINTF(5, 6);
407:#define LOG_VERBOSE(channel, ...) WTFLogVerbose(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, &LOG_CHANNEL(channel), __VA_ARGS__)

WebCore/platform/NotImplemented.h
48:            WTFLogVerbose(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, WebCore::notImplementedLoggingChannel(), "UNIMPLEMENTED: "); \


However, this "one place" is the definition of the notImplemented macro, which is used in about 763 places.

As indicated by the title, this issue is related to Bug 157274.