RESOLVED FIXED124579
Use unsigned consistently, and check for invalid casts when calling into SharedBuffer from other code.
https://bugs.webkit.org/show_bug.cgi?id=124579
Summary Use unsigned consistently, and check for invalid casts when calling into Shar...
László Langó
Reported 2013-11-19 06:03:41 PST
Use unsigned consistently, and check for invalid casts when calling into SharedBuffer from other code.
Attachments
Patch (8.94 KB, patch)
2013-11-19 06:06 PST, László Langó
no flags
Patch (11.95 KB, patch)
2013-11-19 07:01 PST, László Langó
no flags
Patch (17.75 KB, patch)
2013-11-20 07:29 PST, László Langó
no flags
Patch (18.34 KB, patch)
2013-11-21 00:04 PST, László Langó
no flags
Patch (24.23 KB, patch)
2013-11-21 01:05 PST, László Langó
eflews.bot: commit-queue-
Patch (40.51 KB, patch)
2013-11-21 02:42 PST, László Langó
no flags
Patch (40.91 KB, patch)
2013-11-21 03:40 PST, László Langó
no flags
Patch (44.01 KB, patch)
2013-11-25 02:14 PST, László Langó
no flags
patch for landing (44.05 KB, patch)
2014-01-06 01:46 PST, László Langó
no flags
László Langó
Comment 1 2013-11-19 06:06:09 PST
Build Bot
Comment 2 2013-11-19 06:19:34 PST
Build Bot
Comment 3 2013-11-19 06:35:00 PST
László Langó
Comment 4 2013-11-19 07:01:54 PST
Build Bot
Comment 5 2013-11-19 07:15:53 PST
Build Bot
Comment 6 2013-11-19 07:36:34 PST
Darin Adler
Comment 7 2013-11-19 09:27:10 PST
Comment on attachment 217297 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=217297&action=review > Source/WebCore/ChangeLog:3 > + Use unsigned consistently, and check for invalid casts when calling into SharedBuffer from other code. On 64-bit platforms, this changes from 32-bit to 64-bit, not just from signed to unsigned. Rationale?
Brent Fulgham
Comment 8 2013-11-19 09:32:39 PST
Comment on attachment 217297 [details] Patch You changed the type signature of some symbols that are exported by the WebCore.order file. Update the entry for __ZN7WebCore12SharedBufferC1EPKci to match the new __ZN7WebCore12SharedBufferC1EPKhi signature.
Alexey Proskuryakov
Comment 9 2013-11-19 10:16:29 PST
Comment on attachment 217297 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=217297&action=review To fix the build, please update WebCore.exp. There is no need to change WebCore.order, even if it gets out of date - it's generated from profile data when needed. But I think that this patch doesn't fix all the code paths where an implicit cast occurs. > Source/WebCore/loader/ResourceLoader.cpp:193 > -void ResourceLoader::addDataOrBuffer(const char* data, int length, SharedBuffer* buffer, DataPayloadType dataPayloadType) > +void ResourceLoader::addDataOrBuffer(const char* data, size_t length, SharedBuffer* buffer, DataPayloadType dataPayloadType) The patch changes this function, but doesn't change call sites. Specifically, ResourceLoader::didReceiveDataOrBuffer still calls this function with an int length.
Alexey Proskuryakov
Comment 10 2013-11-19 10:18:14 PST
Thank you for looking into this. It's crazy that we still have a signed type here, and it's a very desirable improvement.
Alexey Proskuryakov
Comment 11 2013-11-19 10:23:14 PST
> To fix the build, please update WebCore.exp. More precisely, WebCore.exp.in.
Brent Fulgham
Comment 12 2013-11-19 10:26:38 PST
(In reply to comment #11) > > To fix the build, please update WebCore.exp. > > More precisely, WebCore.exp.in. Sorry for my misinformation!
László Langó
Comment 13 2013-11-20 07:29:44 PST
EFL EWS Bot
Comment 14 2013-11-20 07:38:36 PST
EFL EWS Bot
Comment 15 2013-11-20 07:43:15 PST
Build Bot
Comment 16 2013-11-20 08:02:28 PST
Build Bot
Comment 17 2013-11-20 08:10:44 PST
kov's GTK+ EWS bot
Comment 18 2013-11-20 08:14:20 PST
Build Bot
Comment 19 2013-11-20 08:26:40 PST
László Langó
Comment 20 2013-11-21 00:04:54 PST
EFL EWS Bot
Comment 21 2013-11-21 00:15:24 PST
EFL EWS Bot
Comment 22 2013-11-21 00:32:00 PST
Build Bot
Comment 23 2013-11-21 00:34:15 PST
Build Bot
Comment 24 2013-11-21 00:37:05 PST
Build Bot
Comment 25 2013-11-21 01:03:15 PST
László Langó
Comment 26 2013-11-21 01:05:50 PST
EFL EWS Bot
Comment 27 2013-11-21 01:13:10 PST
Build Bot
Comment 28 2013-11-21 01:16:42 PST
EFL EWS Bot
Comment 29 2013-11-21 01:17:16 PST
László Langó
Comment 30 2013-11-21 02:42:43 PST
Build Bot
Comment 31 2013-11-21 03:13:39 PST
Build Bot
Comment 32 2013-11-21 03:34:11 PST
László Langó
Comment 33 2013-11-21 03:40:35 PST
Alexey Proskuryakov
Comment 34 2013-11-21 09:27:43 PST
Comment on attachment 217544 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=217544&action=review There are even more threads that need to be pulled :( See for example this line in WebCoreResourceHandleAsDelegate.mm: m_handle->client()->willStopBufferingData(m_handle, (const char*)[data bytes], static_cast<int>([data length])); willStopBufferingData is the first and only name I grepped for, so probabilistically speaking, there are likely more implicit casts remaining. Please grep WebCore for every function name you changed. > Source/WebCore/loader/ResourceLoader.cpp:1 > -/* > + /* Accidental change here.
László Langó
Comment 35 2013-11-22 03:03:55 PST
(In reply to comment #34) > (From update of attachment 217544 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=217544&action=review > > There are even more threads that need to be pulled :( > > See for example this line in WebCoreResourceHandleAsDelegate.mm: > > m_handle->client()->willStopBufferingData(m_handle, (const char*)[data bytes], static_cast<int>([data length])); > > willStopBufferingData is the first and only name I grepped for, so probabilistically speaking, there are likely more implicit casts remaining. Please grep WebCore for every function name you changed. Sorry, I missed the *.mm files. I only grepped in *.cpp and *.h files. :s I will check it twice before the next upload. I didn't expected that this change will affect so many files.
László Langó
Comment 36 2013-11-25 02:14:15 PST
WebKit Commit Bot
Comment 37 2013-12-22 08:06:38 PST
Comment on attachment 217779 [details] Patch Rejecting attachment 217779 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.appspot.com', '--bot-id=webkit-cq-02', 'apply-attachment', '--no-update', '--non-interactive', 217779, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit Last 500 characters of output: patching file Source/WebKit/win/WebKitDLL.cpp patching file Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp Hunk #1 succeeded at 191 (offset -1 lines). Hunk #2 succeeded at 393 (offset -1 lines). patching file Source/WebKit2/NetworkProcess/NetworkResourceLoader.h patching file Source/WebKit2/Shared/Downloads/soup/DownloadSoup.cpp Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Anders Carlsson']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit Full output: http://webkit-queues.appspot.com/results/51728022
László Langó
Comment 38 2014-01-06 01:46:00 PST
Created attachment 220423 [details] patch for landing
WebKit Commit Bot
Comment 39 2014-01-06 03:13:54 PST
Comment on attachment 220423 [details] patch for landing Clearing flags on attachment: 220423 Committed r161338: <http://trac.webkit.org/changeset/161338>
WebKit Commit Bot
Comment 40 2014-01-06 03:14:00 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.