Javascript execution is non-deterministic
Reported by
eno...@onshape.com,
Mar 1 2016
|
||||
Issue descriptionChrome Version : Version 50.0.2660.3 canary (64-bit) on OSX URLs (if applicable) : https://cad.onshape.com Other browsers tested: Chrome 48: OK Safari: OK Firefox: OK What steps will reproduce the problem? 1. Navigate to: https://cad.onshape.com/documents/be88cf3dfb120bfc31066502/w/f4f54147163b49be00f6ab81/e/d07d9b751f0eccf330d24c1d 2. Sign in with an account you have created, or contact bug author for credentials 3. Once document is open, click on the version button (see "Versions Button.png" for location) 4. Open the javascript console 5. Observe that errors are logged (See "JS Error.png" for example) 6. Observe that the UI is sporadically non-functional What is the expected result? It is expected that no error should appear. In all other browsers and versions of Chrome the code executes successfully. What happens instead? The code fails. The code in question is a usage of underscore's _.findWhere function, which searches a collection of objects to find one that matches a queried set of properties (see http://underscorejs.org/#findWhere). In Chrome 50, the method _sometimes_ fails to find a contained object. I have not yet been able to discern a pattern of when the method will succeed and when it will fail. I tried reproducing the problem in isolation, but the code always succeeds. Stepping through the code with the javascript debugger appears to make the code always succeed. For what it's worth, the problem is particularly problematic, as it is executed as part of Angular's digest cycle. So when the code does fail, it can kill the update of the UI. We can code around it to some extent, but it seems like there could be a serious underlying issue that needs to be addressed.
,
Mar 2 2016
This has to be a V8 roll, or at least something involving JS. My patch just affects how background images are drawn. The bisect seems bad with high probability. Nothing in the linked range is a likely candidate.
,
Mar 8 2016
@enowak
Can you try to track it down by inserting something like below to the failing line:
if (!assert_condition) (function() { debugger; })();
And then inspect if the list is in fact contains the object.
,
Mar 8 2016
We have been affected by a similar "cannot read property 'x' of undefined" issue, which we also tracked down to underscorejs. Our issue has been resolved now, and I suspect that this specific bug fix did the trick: https://bugs.chromium.org/p/chromium/issues/detail?id=590989 (callback function not called any more after called lots of times and in different place.) Do you still see your issue in latest Chrome Canary?
,
Mar 8 2016
It looks like the issue is resolved in 51.0.2671.0. Thanks! (FWIW, I did add a debugger break in the older version. I found that the property was present in the object, even though the assertion failed.)
,
Mar 9 2016
Issue found fixed on Windows 7, MAC (10.11.3) & Ubuntu Trusty (14.04) for Google Chrome Canary Version - 51.0.2671.0 |
||||
►
Sign in to add a comment |
||||
Comment 1 by rnimmagadda@chromium.org
, Mar 2 2016Components: Platform>DevTools
Labels: M-50 Type-Bug-Regression Pri-2 OS-Linux OS-Mac OS-Windows
Owner: schenney@chromium.org
Status: Assigned (was: Unconfirmed)