Bug 124322

Summary: [ASAN] WebKit2 fails to build with trunk clang: Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm:56:10: error: no matching conversion for C-style cast from 'RetainPtr<NSURLRequest>' to 'NSMutableURLRequest *'
Product: WebKit Reporter: David Farler <dfarler>
Component: WebKit2Assignee: David Farler <dfarler>
Status: RESOLVED INVALID    
Severity: Normal CC: andersca, ddkilzer, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: All   
Attachments:
Description Flags
Patch andersca: review-

David Farler
Reported 2013-11-13 16:58:53 PST
CompileC /Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/WebKit2.build/Debug/WebKit2.build/Objects-normal/x86_64/WebCoreArgumentCodersMac.o Shared/mac/WebCoreArgumentCodersMac.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler cd /Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/Source/WebKit2 /Volumes/Data/BuildSlave/build-asan-webkit/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/clang -x objective-c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu++11 -stdlib=libc++ -fobjc-gc -Wno-trigraphs -fno-exceptions -fno-rtti -fpascal-strings -O0 -Wno-missing-field-initializers -Wmissing-prototypes -Wno-implicit-atomic-properties -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wnon-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wduplicate-method-match -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 -Wsign-compare -Wno-shorten-64-to-32 -Wnewline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -Wno-c++11-extensions -DDISABLE_THREAD_CHECK -DENABLE_3D_RENDERING -DENABLE_BLOB -DENABLE_CACHE_PARTITIONING -DENABLE_CANVAS_PATH -DENABLE_CHANNEL_MESSAGING -DENABLE_CSS_BOX_DECORATION_BREAK -DENABLE_CSS_COMPOSITING -DENABLE_CSS_EXCLUSIONS -DENABLE_CSS_FILTERS -DENABLE_CSS_REGIONS -DENABLE_CSS_SHADERS -DENABLE_CSS_SHAPES -DENABLE_CSS_STICKY_POSITION -DENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED -DENABLE_CSS_TEXT_DECORATION -DENABLE_CURSOR_VISIBILITY -DENABLE_DASHBOARD_SUPPORT -DENABLE_DETAILS_ELEMENT -DENABLE_DOM4_EVENTS_CONSTRUCTOR -DENABLE_ENCRYPTED_MEDIA -DENABLE_ENCRYPTED_MEDIA_V2 -DENABLE_FILTERS -DENABLE_FULLSCREEN_API -DENABLE_GEOLOCATION -DENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING -DENABLE_ICONDATABASE -DENABLE_IFRAME_SEAMLESS -DENABLE_INDEXED_DATABASE -DENABLE_INDIE_UI -DENABLE_INPUT_TYPE_COLOR -DENABLE_INPUT_TYPE_COLOR_POPOVER -DENABLE_JAVASCRIPT_DEBUGGER -DENABLE_LEGACY_CSS_VENDOR_PREFIXES -DENABLE_LEGACY_NOTIFICATIONS -DENABLE_LEGACY_VENDOR_PREFIXES -DENABLE_LEGACY_WEB_AUDIO -DENABLE_MATHML -DENABLE_MEDIA_CONTROLS_SCRIPT -DENABLE_MEDIA_SOURCE -DENABLE_METER_ELEMENT -DENABLE_MOUSE_CURSOR_SCALE -DENABLE_NOTIFICATIONS -DENABLE_PAGE_VISIBILITY_API -DENABLE_PDFKIT_PLUGIN -DENABLE_PROGRESS_ELEMENT -DENABLE_PROMISES -DENABLE_PUBLIC_SUFFIX_LIST -DENABLE_REQUEST_ANIMATION_FRAME -DENABLE_REMOTE_INSPECTOR -DENABLE_SHARED_WORKERS -DENABLE_SPEECH_SYNTHESIS -DENABLE_SQL_DATABASE -DENABLE_SUBTLE_CRYPTO -DENABLE_SVG -DENABLE_SVG_FONTS -DENABLE_USERSELECT_ALL -DENABLE_VIDEO -DENABLE_VIDEO_TRACK -DENABLE_WEBGL -DENABLE_WEB_ANIMATIONS -DENABLE_WEB_AUDIO -DENABLE_WEB_SOCKETS -DENABLE_WORKERS -DENABLE_XHR_TIMEOUT -DENABLE_XSLT -DFRAMEWORK_NAME=WebKit2 -isysroot /Volumes/Data/BuildSlave/build-asan-webkit/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.Internal.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.9 -g -fvisibility=hidden -fvisibility-inlines-hidden -fno-threadsafe-statics -Wno-sign-conversion -I/Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/WebKit2.build/Debug/WebKit2.build/WebKit2.hmap -I/Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/Debug/include -I/Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/Debug/usr/local/include -I/Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/Debug/WebCore.framework/PrivateHeaders/ForwardingHeaders -I/Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/Debug/WebCore.framework/PrivateHeaders/icu -I/Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/Debug/DerivedSources/WebKit2 -I/Volumes/Data/BuildSlave/build-asan-webkit/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/WebKit2.build/Debug/WebKit2.build/DerivedSources/x86_64 -I/Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/WebKit2.build/Debug/WebKit2.build/DerivedSources -Wall -Wextra -Wchar-subscripts -Wextra-tokens -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -F/Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/Debug -F/Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/Debug -fsanitize=address -O1 -mllvm -asan-blacklist=/Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/Tools/asan/webkit-asan-ignore.txt -Wno-error -fno-omit-frame-pointer -g -DUSE_SYSTEM_MALLOC=1 -iframework /Volumes/Data/BuildSlave/build-asan-webkit/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.Internal.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks -iframework /Volumes/Data/BuildSlave/build-asan-webkit/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.Internal.sdk/System/Library/Frameworks/Carbon.framework/Frameworks -iframework /Volumes/Data/BuildSlave/build-asan-webkit/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.Internal.sdk/System/Library/Frameworks/Quartz.framework/Frameworks -iframework /Volumes/Data/BuildSlave/build-asan-webkit/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.Internal.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks -include /Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/PrecompiledHeaders/WebKit2Prefix-fogbksqvybtqlefpxqfnakpyrdpe/WebKit2Prefix.h -MMD -MT dependencies -MF /Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/WebKit2.build/Debug/WebKit2.build/Objects-normal/x86_64/WebCoreArgumentCodersMac.d --serialize-diagnostics /Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/WebKit2.build/Debug/WebKit2.build/Objects-normal/x86_64/WebCoreArgumentCodersMac.dia -c /Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm -o /Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/WebKit2.build/Debug/WebKit2.build/Objects-normal/x86_64/WebCoreArgumentCodersMac.o /Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm:56:10: error: no matching conversion for C-style cast from 'RetainPtr<NSURLRequest>' to 'NSMutableURLRequest *' [(NSMutableURLRequest *)requestToSerialize setHTTPBody:nil]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm:29: In file included from /Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/Source/WebKit2/Shared/cf/ArgumentCodersCF.h:29: /Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/RetainPtr.h:128:9: note: candidate function operator UnspecifiedBoolType() const { return m_ptr ? &RetainPtr::m_ptr : 0; } ^ /Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm:57:10: error: no matching conversion for C-style cast from 'RetainPtr<NSURLRequest>' to 'NSMutableURLRequest *' [(NSMutableURLRequest *)requestToSerialize setHTTPBodyStream:nil]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm:29: In file included from /Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/Source/WebKit2/Shared/cf/ArgumentCodersCF.h:29: /Volumes/Data/BuildSlave/build-asan-webkit/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/RetainPtr.h:128:9: note: candidate function operator UnspecifiedBoolType() const { return m_ptr ? &RetainPtr::m_ptr : 0; } ^ 2 errors generated.
Attachments
Patch (2.93 KB, patch)
2013-11-14 09:12 PST, David Farler
andersca: review-
David Farler
Comment 1 2013-11-13 17:55:51 PST
David Farler
Comment 2 2013-11-14 08:51:59 PST
This temporary requestToSerialize’s scope is limited to this function. Why not just make a mutable copy outright and have the declaration be RetainPtr<NSMutableURLRequest>? Also, if ([requestToSerialize HTTPBody] || [requestToSerialize HTTPBodyStream) { [requestToSerialize setHTTPBody:nil]; [requestToSerialize setHTTPBodyStream:nil]; } can be simplified to just [requestToSerialize setHTTPBody:nil]; [requestToSerialize setHTTPBodyStream:nil]; All of this would workaround the clang problem and would also cut down the maximum number of objc message sends from this function from 5 to 3.
David Farler
Comment 3 2013-11-14 09:12:28 PST
Anders Carlsson
Comment 4 2013-11-14 09:25:39 PST
Comment on attachment 216945 [details] Patch We don't always want to copy the request.
David Farler
Comment 5 2013-11-14 09:27:48 PST
(In reply to comment #4) > (From update of attachment 216945 [details]) > We don't always want to copy the request. I’m guessing that creating a second mutable variable for serialization in that conditional wouldn’t be more acceptable — should I close?
Anders Carlsson
Comment 6 2013-11-14 09:36:47 PST
(In reply to comment #5) > (In reply to comment #4) > > (From update of attachment 216945 [details] [details]) > > We don't always want to copy the request. > > I’m guessing that creating a second mutable variable for serialization in that conditional wouldn’t be more acceptable — should I close? Copying it if any of the streams are non-null is acceptable.
David Farler
Comment 7 2013-11-14 09:44:59 PST
(In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #4) > > > (From update of attachment 216945 [details] [details] [details]) > > > We don't always want to copy the request. > > > > I’m guessing that creating a second mutable variable for serialization in that conditional wouldn’t be more acceptable — should I close? > > Copying it if any of the streams are non-null is acceptable. Right, this is what it was doing before. I think any other workaround is going to involve creating another variable and duplicating code in an else branch and that’s probably not worth it just to work around this. I can just do something locally to get a build through and look for more problems.
David Farler
Comment 8 2013-11-19 11:58:32 PST
I have a workaround on the ASan builder for now with this patch. This should be fixed upstream in http://llvm.org/bugs/show_bug.cgi?id=17922 <rdar://problem/15494681>
Note You need to log in before you can comment on or make changes to this bug.