Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(432)

Issue 13024043: Scanner rejects functions which always throw; fix revealed bugs. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 6 months ago by kpreid2
Modified:
12 years, 6 months ago
Reviewers:
felix8a
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

The scanner now fails if all of its invocations of a given function throw (and this is not expected); this catches bugs in the functions and the scanner providing incorrect arguments. Other than this, * Fixed setting <button>.type failing on Safari. * ES5/3 implementation of Function.prototype.bind does not leave a .prototype value if deleting the property fails. * ES5/3 now uses a consistent error message for 'Property name may not end in double underscore.' * Scanner: Added/fixed invocations to satisfy non-throwing requirement, notably including Array methods. * Scanner: Added 'Ref' abstraction to generalize the argsBy* shortcuts. It is not yet used everywhere it ought to be. * Scanner: Fix bug in handling of prototype methods from the taming frame where the prototype would be used as 'this' rather than an instance. @r5569

Patch Set 1 #

Total comments: 2

Patch Set 2 : Scanner rejects functions which always throw; fix revealed bugs. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+646 lines, -180 lines) Patch
M src/com/google/caja/es53.js View 1 2 chunks +4 lines, -2 lines 0 comments Download
M src/com/google/caja/plugin/domado.js View 1 1 chunk +3 lines, -1 line 0 comments Download
M tests/com/google/caja/plugin/test-scan-guest.js View 1 45 chunks +639 lines, -177 lines 2 comments Download

Messages

Total messages: 11
kpreid2
12 years, 6 months ago (2013-08-15 23:11:52 UTC) #1
felix8a
es53.js and domado.js look fine to me. still working through test-scan-guest.js
12 years, 6 months ago (2013-08-16 23:07:10 UTC) #2
felix8a
about halfway through the test-scan-guest changes https://codereview.appspot.com/13024043/diff/1/tests/com/google/caja/plugin/test-scan-guest.js File tests/com/google/caja/plugin/test-scan-guest.js (right): https://codereview.appspot.com/13024043/diff/1/tests/com/google/caja/plugin/test-scan-guest.js#newcode412 tests/com/google/caja/plugin/test-scan-guest.js:412: forEach: function(f) { ...
12 years, 6 months ago (2013-08-20 22:58:37 UTC) #3
kpreid2
The scanner now fails if all of its invocations of a given function throw (and ...
12 years, 6 months ago (2013-08-21 18:27:22 UTC) #4
kpreid2
new snapshot https://codereview.appspot.com/13024043/diff/1/tests/com/google/caja/plugin/test-scan-guest.js File tests/com/google/caja/plugin/test-scan-guest.js (right): https://codereview.appspot.com/13024043/diff/1/tests/com/google/caja/plugin/test-scan-guest.js#newcode412 tests/com/google/caja/plugin/test-scan-guest.js:412: forEach: function(f) { On 2013/08/20 22:58:38, felix8a ...
12 years, 6 months ago (2013-08-21 18:29:24 UTC) #5
felix8a
lgtm vague meta-concern: I find it very hard to audit the scanner rules meaningfully, and ...
12 years, 6 months ago (2013-08-21 19:28:35 UTC) #6
kpreid2
https://codereview.appspot.com/13024043/diff/7001/tests/com/google/caja/plugin/test-scan-guest.js File tests/com/google/caja/plugin/test-scan-guest.js (right): https://codereview.appspot.com/13024043/diff/7001/tests/com/google/caja/plugin/test-scan-guest.js#newcode1062 tests/com/google/caja/plugin/test-scan-guest.js:1062: G.apply(function() { return new RegExp('f(.*)o'); })); On 2013/08/21 19:28:35, ...
12 years, 6 months ago (2013-08-21 19:30:26 UTC) #7
kpreid2
On 2013/08/21 19:28:35, felix8a wrote: > lgtm > > vague meta-concern: I find it very ...
12 years, 6 months ago (2013-08-21 19:38:04 UTC) #8
felix8a
On 2013/08/21 19:30:26, kpreid2 wrote: > https://codereview.appspot.com/13024043/diff/7001/tests/com/google/caja/plugin/test-scan-guest.js > File tests/com/google/caja/plugin/test-scan-guest.js (right): > > https://codereview.appspot.com/13024043/diff/7001/tests/com/google/caja/plugin/test-scan-guest.js#newcode1062 > ...
12 years, 6 months ago (2013-08-21 19:38:08 UTC) #9
felix8a
On 2013/08/21 19:38:04, kpreid2 wrote: > On 2013/08/21 19:28:35, felix8a wrote: > > lgtm > ...
12 years, 6 months ago (2013-08-21 19:44:56 UTC) #10
kpreid2
12 years, 6 months ago (2013-08-22 18:15:59 UTC) #11
Message was sent while issue was closed.
On 2013/08/21 19:44:56, felix8a wrote:
> I'd be ok with a more exhaustive scanner that's run separately on demand. We
> could setup a farm of browsers somewhere that run nothing but the scanner. Up
to
> 1day-ish of scanning per browser seems plausible to me, since that would mesh
ok
> with daily build cycles. Under an hour is friendlier, but for what the scanner
> is guarding against, several hours seems ok.

That would be nice to have, but:

1. We would still need to maintain the short list in addition to the long list.

2. From experience, there's a significant chance that a sufficiently large scan
will hang/crash the browser/tab, or simply run into slowdowns (i.e. performance
is worse than O(n)), and the scan cannot be simply split across multiple browser
runs, because it is traversing a highly cyclic graph without reliable unique
node labels.

(Given the ability to provoke crashes, I've even been giving some thought to
repurposing it for stress testing browsers.)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b