RESOLVED FIXED 52867
OwnArraryPtr.h uses deleteOwnedPtr but doesn’t include OwnPtrCommon.h
https://bugs.webkit.org/show_bug.cgi?id=52867
Summary OwnArraryPtr.h uses deleteOwnedPtr but doesn’t include OwnPtrCommon.h
Ryosuke Niwa
Reported Friday, January 21, 2011 5:22:37 AM UTC
Chromium clang build is failing with the following error: > In file included from > third_party/WebKit/Source/WebCore/html/HTMLFrameSetElement.h:27: > third_party/WebKit/Source/JavaScriptCore/wtf/OwnArrayPtr.h:123:5:error: > use of undeclared identifier 'deleteOwnedPtr' >    deleteOwnedPtr(oldPtr); >    ^ > third_party/WebKit/Source/WebCore/html/HTMLFrameSetElement.cpp:78:26: > note: in instantiation of member function > 'WTF::OwnArrayPtr<WebCore::Length>::set' requested here >            m_rowLengths.set(newLengthArray(attr->value().string(), > m_totalRows)); >                         ^ > 1 error generated. The problem is that OwnArrayPtr::set calls deleteOwnedPtr but doesn't include OwnPtrCommon.h. We should either include the header or should call deleteOwnedArrayPtr.
Attachments
Include OwnPtrCommon.h in OwnArrayPtr.h (934 bytes, patch)
2011-01-20 21:53 PST, Ryosuke Niwa
no flags
get rid of set (25.37 KB, patch)
2011-01-21 22:17 PST, Ryosuke Niwa
no flags
fixed platform code (30.73 KB, patch)
2011-01-21 23:07 PST, Ryosuke Niwa
no flags
more port specific fixes (32.66 KB, patch)
2011-01-22 00:43 PST, Ryosuke Niwa
no flags
another attempt (40.17 KB, patch)
2011-01-22 03:40 PST, Ryosuke Niwa
no flags
yet another attempt (44.93 KB, patch)
2011-01-22 12:47 PST, Ryosuke Niwa
no flags
fixed v8 binding (44.93 KB, patch)
2011-01-22 17:10 PST, Ryosuke Niwa
no flags
fixed cr-mac build (46.69 KB, patch)
2011-02-06 18:06 PST, Ryosuke Niwa
no flags
fixed per Darin's comment (47.20 KB, patch)
2011-02-06 20:35 PST, Ryosuke Niwa
darin: review+
Ryosuke Niwa
Comment 1 Friday, January 21, 2011 5:53:14 AM UTC
Created attachment 79693 [details] Include OwnPtrCommon.h in OwnArrayPtr.h Reading the comment: // Remove this once we make all WebKit code compatible with stricter rules about OwnArrayPtr. #define LOOSE_OWN_ARRAY_PTR the correct thing to do here seems to include OwnPtrCommon.h.
Maciej Stachowiak
Comment 2 Friday, January 21, 2011 6:01:55 AM UTC
Comment on attachment 79693 [details] Include OwnPtrCommon.h in OwnArrayPtr.h r=me
Ryosuke Niwa
Comment 3 Friday, January 21, 2011 6:04:18 AM UTC
(In reply to comment #2) > (From update of attachment 79693 [details]) > r=me Thanks for the review!
Ryosuke Niwa
Comment 4 Friday, January 21, 2011 6:10:51 AM UTC
Comment on attachment 79693 [details] Include OwnPtrCommon.h in OwnArrayPtr.h Clearing flags on attachment: 79693 Committed r76334: <http://trac.webkit.org/changeset/76334>
Ryosuke Niwa
Comment 5 Friday, January 21, 2011 6:10:57 AM UTC
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 6 Friday, January 21, 2011 7:40:14 PM UTC
This was the wrong fix. OwnArrayPtr<T>::set needs to use deletedOwnedArrayPtr. Or it needs to be removed.
Ryosuke Niwa
Comment 7 Friday, January 21, 2011 7:49:51 PM UTC
(In reply to comment #6) > This was the wrong fix. OwnArrayPtr<T>::set needs to use deletedOwnedArrayPtr. Or it needs to be removed. Ok, let's fix then!
Darin Adler
Comment 8 Friday, January 21, 2011 7:53:12 PM UTC
(In reply to comment #7) > (In reply to comment #6) > > This was the wrong fix. OwnArrayPtr<T>::set needs to use deletedOwnedArrayPtr. Or it needs to be removed. > > Ok, let's fix then! My preference would be to remove it, if we can quickly find the callers using it and change them to use adoptPtr instead.
Ryosuke Niwa
Comment 9 Saturday, January 22, 2011 1:14:37 AM UTC
Let me do this over the weekend (hopefully).
Ryosuke Niwa
Comment 10 Saturday, January 22, 2011 6:17:08 AM UTC
Created attachment 79827 [details] get rid of set
WebKit Review Bot
Comment 11 Saturday, January 22, 2011 6:29:35 AM UTC
Build Bot
Comment 12 Saturday, January 22, 2011 6:46:15 AM UTC
Ryosuke Niwa
Comment 13 Saturday, January 22, 2011 7:07:39 AM UTC
Created attachment 79830 [details] fixed platform code
WebKit Review Bot
Comment 14 Saturday, January 22, 2011 7:22:28 AM UTC
Build Bot
Comment 15 Saturday, January 22, 2011 8:02:05 AM UTC
Ryosuke Niwa
Comment 16 Saturday, January 22, 2011 8:43:17 AM UTC
Created attachment 79834 [details] more port specific fixes
WebKit Review Bot
Comment 17 Saturday, January 22, 2011 8:57:27 AM UTC
Build Bot
Comment 18 Saturday, January 22, 2011 9:38:41 AM UTC
Ryosuke Niwa
Comment 19 Saturday, January 22, 2011 11:40:06 AM UTC
Created attachment 79839 [details] another attempt
WebKit Review Bot
Comment 20 Saturday, January 22, 2011 12:03:01 PM UTC
Build Bot
Comment 21 Saturday, January 22, 2011 12:35:15 PM UTC
Ryosuke Niwa
Comment 22 Saturday, January 22, 2011 8:47:47 PM UTC
Created attachment 79854 [details] yet another attempt
WebKit Review Bot
Comment 23 Saturday, January 22, 2011 9:10:47 PM UTC
Ryosuke Niwa
Comment 24 Sunday, January 23, 2011 1:10:01 AM UTC
Created attachment 79861 [details] fixed v8 binding
WebKit Review Bot
Comment 25 Sunday, January 23, 2011 1:48:37 AM UTC
Ryosuke Niwa
Comment 26 Monday, February 7, 2011 2:06:47 AM UTC
Created attachment 81438 [details] fixed cr-mac build
Early Warning System Bot
Comment 27 Monday, February 7, 2011 2:30:06 AM UTC
Ryosuke Niwa
Comment 28 Monday, February 7, 2011 3:31:48 AM UTC
(In reply to comment #27) > Attachment 81438 [details] did not build on qt: > Build output: http://queues.webkit.org/results/7700733 This is ews flakinss. kling kindly verified that it builds on qt.
Darin Adler
Comment 29 Monday, February 7, 2011 4:04:40 AM UTC
Comment on attachment 81438 [details] fixed cr-mac build View in context: https://bugs.webkit.org/attachment.cgi?id=81438&action=review Exciting to see this. Looking forward to it landing. review- because of the JavaScriptCore registers issues. > Source/JavaScriptCore/runtime/Arguments.h:232 > Register* registerArray = new Register[registerArraySize]; > memcpy(registerArray, d->registers - registerOffset, registerArraySize * sizeof(Register)); > - d->registerArray.set(registerArray); > + d->registerArray = registerArray; > d->registers = registerArray + registerOffset; Needs an adoptArrayPtr. Probably won’t compile. I think this is may be why EWS bots are failing to build. > Source/JavaScriptCore/runtime/JSVariableObject.h:165 > inline void JSVariableObject::setRegisters(Register* registers, Register* registerArray) > { > ASSERT(registerArray != d->registerArray.get()); > - d->registerArray.set(registerArray); > + d->registerArray = registerArray; > d->registers = registers; > } Needs PassOwnArrayPtr. Same as above.
Ryosuke Niwa
Comment 30 Monday, February 7, 2011 4:17:01 AM UTC
(In reply to comment #29) > (From update of attachment 81438 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=81438&action=review > > Exciting to see this. Looking forward to it landing. review- because of the JavaScriptCore registers issues. Thanks for the review. > > Source/JavaScriptCore/runtime/Arguments.h:232 > > Register* registerArray = new Register[registerArraySize]; > > memcpy(registerArray, d->registers - registerOffset, registerArraySize * sizeof(Register)); > > - d->registerArray.set(registerArray); > > + d->registerArray = registerArray; > > d->registers = registerArray + registerOffset; > > Needs an adoptArrayPtr. Probably won’t compile. I think this is may be why EWS bots are failing to build. Sure enough. I don't understand why XCode didn't complain about this. Will fix.
Ryosuke Niwa
Comment 31 Monday, February 7, 2011 4:35:18 AM UTC
Created attachment 81445 [details] fixed per Darin's comment
Darin Adler
Comment 32 Monday, February 7, 2011 4:40:31 AM UTC
Comment on attachment 81445 [details] fixed per Darin's comment View in context: https://bugs.webkit.org/attachment.cgi?id=81445&action=review > Source/JavaScriptCore/runtime/JSVariableObject.h:165 > inline void JSVariableObject::setRegisters(Register* registers, Register* registerArray) > { > ASSERT(registerArray != d->registerArray.get()); > - d->registerArray.set(registerArray); > + d->registerArray = adoptArrayPtr(registerArray); > d->registers = registers; > } This is OK for landing, but really we need the adoptArrayPtr to be close to the actual allocation. In this case, setRegisters should be taking a PassOwnArrayPtr for registerArray. And JSGlobalObject::copyGlobalsFrom should be getting the register array in an OwnArrayPtr by calling JSVariableObject::copyRegisterArray. And inside copyRegisterArray, the adoptArrayPtr should be right there where it calls new.
Ryosuke Niwa
Comment 33 Monday, February 7, 2011 4:43:57 AM UTC
(In reply to comment #32) > (From update of attachment 81445 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=81445&action=review > This is OK for landing, but really we need the adoptArrayPtr to be close to the actual allocation. In this case, setRegisters should be taking a PassOwnArrayPtr for registerArray. And JSGlobalObject::copyGlobalsFrom should be getting the register array in an OwnArrayPtr by calling JSVariableObject::copyRegisterArray. And inside copyRegisterArray, the adoptArrayPtr should be right there where it calls new. I totally agree. The only reason I didn't do was because this patch was already 47KB and adding that change seemed to bloat the patch.
Ryosuke Niwa
Comment 34 Monday, February 7, 2011 5:01:45 AM UTC
Early Warning System Bot
Comment 35 Monday, February 7, 2011 5:15:34 AM UTC
WebKit Review Bot
Comment 36 Monday, February 7, 2011 5:25:04 AM UTC
http://trac.webkit.org/changeset/77785 might have broken Chromium Win Release
Note You need to log in before you can comment on or make changes to this bug.