WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
124579
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
Details
Formatted Diff
Diff
Patch
(11.95 KB, patch)
2013-11-19 07:01 PST
,
László Langó
no flags
Details
Formatted Diff
Diff
Patch
(17.75 KB, patch)
2013-11-20 07:29 PST
,
László Langó
no flags
Details
Formatted Diff
Diff
Patch
(18.34 KB, patch)
2013-11-21 00:04 PST
,
László Langó
no flags
Details
Formatted Diff
Diff
Patch
(24.23 KB, patch)
2013-11-21 01:05 PST
,
László Langó
eflews.bot
: commit-queue-
Details
Formatted Diff
Diff
Patch
(40.51 KB, patch)
2013-11-21 02:42 PST
,
László Langó
no flags
Details
Formatted Diff
Diff
Patch
(40.91 KB, patch)
2013-11-21 03:40 PST
,
László Langó
no flags
Details
Formatted Diff
Diff
Patch
(44.01 KB, patch)
2013-11-25 02:14 PST
,
László Langó
no flags
Details
Formatted Diff
Diff
patch for landing
(44.05 KB, patch)
2014-01-06 01:46 PST
,
László Langó
no flags
Details
Formatted Diff
Diff
Show Obsolete
(8)
View All
Add attachment
proposed patch, testcase, etc.
László Langó
Comment 1
2013-11-19 06:06:09 PST
Created
attachment 217294
[details]
Patch
Build Bot
Comment 2
2013-11-19 06:19:34 PST
Comment on
attachment 217294
[details]
Patch
Attachment 217294
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/27118092
Build Bot
Comment 3
2013-11-19 06:35:00 PST
Comment on
attachment 217294
[details]
Patch
Attachment 217294
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/27578006
László Langó
Comment 4
2013-11-19 07:01:54 PST
Created
attachment 217297
[details]
Patch
Build Bot
Comment 5
2013-11-19 07:15:53 PST
Comment on
attachment 217297
[details]
Patch
Attachment 217297
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/26898113
Build Bot
Comment 6
2013-11-19 07:36:34 PST
Comment on
attachment 217297
[details]
Patch
Attachment 217297
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/27538008
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
Created
attachment 217429
[details]
Patch
EFL EWS Bot
Comment 14
2013-11-20 07:38:36 PST
Comment on
attachment 217429
[details]
Patch
Attachment 217429
[details]
did not pass efl-ews (efl): Output:
http://webkit-queues.appspot.com/results/30128097
EFL EWS Bot
Comment 15
2013-11-20 07:43:15 PST
Comment on
attachment 217429
[details]
Patch
Attachment 217429
[details]
did not pass efl-wk2-ews (efl-wk2): Output:
http://webkit-queues.appspot.com/results/29688102
Build Bot
Comment 16
2013-11-20 08:02:28 PST
Comment on
attachment 217429
[details]
Patch
Attachment 217429
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/29888098
Build Bot
Comment 17
2013-11-20 08:10:44 PST
Comment on
attachment 217429
[details]
Patch
Attachment 217429
[details]
did not pass win-ews (win): Output:
http://webkit-queues.appspot.com/results/29878111
kov's GTK+ EWS bot
Comment 18
2013-11-20 08:14:20 PST
Comment on
attachment 217429
[details]
Patch
Attachment 217429
[details]
did not pass gtk-ews (gtk): Output:
http://webkit-queues.appspot.com/results/29798007
Build Bot
Comment 19
2013-11-20 08:26:40 PST
Comment on
attachment 217429
[details]
Patch
Attachment 217429
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/30378007
László Langó
Comment 20
2013-11-21 00:04:54 PST
Created
attachment 217523
[details]
Patch
EFL EWS Bot
Comment 21
2013-11-21 00:15:24 PST
Comment on
attachment 217523
[details]
Patch
Attachment 217523
[details]
did not pass efl-ews (efl): Output:
http://webkit-queues.appspot.com/results/32348051
EFL EWS Bot
Comment 22
2013-11-21 00:32:00 PST
Comment on
attachment 217523
[details]
Patch
Attachment 217523
[details]
did not pass efl-wk2-ews (efl-wk2): Output:
http://webkit-queues.appspot.com/results/31728015
Build Bot
Comment 23
2013-11-21 00:34:15 PST
Comment on
attachment 217523
[details]
Patch
Attachment 217523
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/31768009
Build Bot
Comment 24
2013-11-21 00:37:05 PST
Comment on
attachment 217523
[details]
Patch
Attachment 217523
[details]
did not pass win-ews (win): Output:
http://webkit-queues.appspot.com/results/31998060
Build Bot
Comment 25
2013-11-21 01:03:15 PST
Comment on
attachment 217523
[details]
Patch
Attachment 217523
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/31998059
László Langó
Comment 26
2013-11-21 01:05:50 PST
Created
attachment 217529
[details]
Patch
EFL EWS Bot
Comment 27
2013-11-21 01:13:10 PST
Comment on
attachment 217529
[details]
Patch
Attachment 217529
[details]
did not pass efl-ews (efl): Output:
http://webkit-queues.appspot.com/results/31978066
Build Bot
Comment 28
2013-11-21 01:16:42 PST
Comment on
attachment 217529
[details]
Patch
Attachment 217529
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/32018074
EFL EWS Bot
Comment 29
2013-11-21 01:17:16 PST
Comment on
attachment 217529
[details]
Patch
Attachment 217529
[details]
did not pass efl-wk2-ews (efl-wk2): Output:
http://webkit-queues.appspot.com/results/31588073
László Langó
Comment 30
2013-11-21 02:42:43 PST
Created
attachment 217539
[details]
Patch
Build Bot
Comment 31
2013-11-21 03:13:39 PST
Comment on
attachment 217539
[details]
Patch
Attachment 217539
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/32348077
Build Bot
Comment 32
2013-11-21 03:34:11 PST
Comment on
attachment 217539
[details]
Patch
Attachment 217539
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/31588099
László Langó
Comment 33
2013-11-21 03:40:35 PST
Created
attachment 217544
[details]
Patch
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
Created
attachment 217779
[details]
Patch
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.
Top of Page
Format For Printing
XML
Clone This Bug