RESOLVED FIXED 97397
[BlackBerry] Fix assertion in NetworkJob::notifyChallengeResult.
https://bugs.webkit.org/show_bug.cgi?id=97397
Summary [BlackBerry] Fix assertion in NetworkJob::notifyChallengeResult.
Lyon Chen
Reported 2012-09-22 13:50:03 PDT
Changeset 129251 for https://bugs.webkit.org/show_bug.cgi?id=97348 caused an assertion. This is due to calling to NetworkJob::updateDeferLoadingCount() is not balanced. It's called for increment only when a authentication challenge is request, but will be called for decrement no matter authentication challenge is request or not.
Attachments
patch for 97397. (2.83 KB, patch)
2012-09-22 14:03 PDT, Lyon Chen
yong.li.webkit: commit-queue-
Updated patch for 97397. (31.04 KB, patch)
2012-10-10 19:49 PDT, Lyon Chen
no flags
Updated patch that conforms to new indention style requirement. (29.59 KB, patch)
2012-10-10 20:36 PDT, Lyon Chen
no flags
Lyon Chen
Comment 1 2012-09-22 14:03:00 PDT
+ Yong, Joe, and Rob.
Lyon Chen
Comment 2 2012-09-22 14:03:26 PDT
Created attachment 165268 [details] patch for 97397.
Joe Mason
Comment 3 2012-09-24 07:33:51 PDT
Comment on attachment 165268 [details] patch for 97397. View in context: https://bugs.webkit.org/attachment.cgi?id=165268&action=review > Source/WebCore/platform/network/blackberry/NetworkJob.cpp:-849 > - if (result != AuthenticationChallengeSuccess || protectionSpace.host().isEmpty() || !url.isValid()) { What happened to the protectionSpace and url checks in the refactored code?
Yong Li
Comment 4 2012-09-24 07:39:19 PDT
Comment on attachment 165268 [details] patch for 97397. LGTM
Yong Li
Comment 5 2012-09-24 07:39:56 PDT
Oops. didn't see Joe's question. will wait for Lyon's answer
Lyon Chen
Comment 6 2012-10-08 20:23:41 PDT
(In reply to comment #3) > (From update of attachment 165268 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=165268&action=review > > > Source/WebCore/platform/network/blackberry/NetworkJob.cpp:-849 > > - if (result != AuthenticationChallengeSuccess || protectionSpace.host().isEmpty() || !url.isValid()) { > > What happened to the protectionSpace and url checks in the refactored code? Sorry for the late response. I think the URL and protectionSpace checking is not necessary because if they are invalid we should fail somewhere already. For example url is checked before, and a url without host (or empty host) could not possibly asking for an authentication challenge.
Joe Mason
Comment 7 2012-10-09 07:07:34 PDT
Comment on attachment 165268 [details] patch for 97397. View in context: https://bugs.webkit.org/attachment.cgi?id=165268&action=review >>> Source/WebCore/platform/network/blackberry/NetworkJob.cpp:-849 >>> - if (result != AuthenticationChallengeSuccess || protectionSpace.host().isEmpty() || !url.isValid()) { >> >> What happened to the protectionSpace and url checks in the refactored code? > > Sorry for the late response. I think the URL and protectionSpace checking is not necessary because if they are invalid we should fail somewhere already. For example url is checked before, and a url without host (or empty host) could not possibly asking for an authentication challenge. I disagree - url and protectionSpace are passed in as parameters, so they should be checked in case the call site changes. Just from looking at the function on its own its not clear that they're always correct, and we shouldn't require people to find every call site to reason about correctness. Or at least there should be an assert.
Lyon Chen
Comment 8 2012-10-09 18:18:57 PDT
(In reply to comment #7) > I disagree - url and protectionSpace are passed in as parameters, so they should be checked in case the call site changes. Just from looking at the function on its own its not clear that they're always correct, and we shouldn't require people to find every call site to reason about correctness. Or at least there should be an assert. OK, I prefer the assertions, as these 2 values (the url here and host) are not user input, when there is a problem with url or protectionSpace host at this stage, it must be a software error.
Lyon Chen
Comment 9 2012-10-10 19:49:35 PDT
Created attachment 168129 [details] Updated patch for 97397. This patch also includes the original patch for bug 97348 (https://bugs.webkit.org/show_bug.cgi?id=97348), because that patch is reverted in changeset 129419 (http://trac.webkit.org/changeset/129419) due to other reason.
WebKit Review Bot
Comment 10 2012-10-10 19:51:51 PDT
Attachment 168129 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/platform/blackberry/AuthenticationChallengeManager.h:53: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.h:54: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.h:55: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.h:56: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.h:61: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.h:62: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.h:63: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:726: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Source/WebCore/platform/network/blackberry/NetworkJob.cpp:800: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp:50: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp:51: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp:52: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp:53: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp:100: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp:101: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp:159: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp:160: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp:161: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp:162: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp:205: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp:206: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/platform/blackberry/AuthenticationChallengeManager.cpp:207: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 22 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Lyon Chen
Comment 11 2012-10-10 20:36:20 PDT
Created attachment 168134 [details] Updated patch that conforms to new indention style requirement.
WebKit Review Bot
Comment 12 2012-10-10 21:55:03 PDT
Comment on attachment 168134 [details] Updated patch that conforms to new indention style requirement. Clearing flags on attachment: 168134 Committed r131014: <http://trac.webkit.org/changeset/131014>
WebKit Review Bot
Comment 13 2012-10-10 21:55:08 PDT
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.