About issue
- The issue stops the app execution at different random moments based on the size of 2D Scene.
- The issue stops the DevTools and the page turns white.
- The issue doesn't appear as an Error or Warning in the DevTools console.
- The issue appears only in the Chrome and Edge browsers.
- The issue didn’t appear in the Chrome and Edge browsers during the first 4 days of testing.
About app
I made a JS6 app to test some 2D graphics using canvas. Just pure HTML, CSS and JavaScript only. The app is supposed to draw a scene and different geometric primitives after collision detections (using AABB algorithm), path finding, impact physics and some AI. I used the method requestAnimationFrame(render) to emulate animation rendering. All the code is built based on the OOP principles described in ECMAScript 6. The core and very simplified sample of code:
class Scene{
#vMap = [];
constructor(board){
this.canvas = document.getElementById(board);
this.ctx = this.canvas.getContext('2d');
this.#createMap();
this.#createModels();
//etc.
}
#createMap(){//to do}
#createModels(){//to do}
render(){
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
this.#vMap.forEach(obj =>{
obj.draw();
if(obj.checkCollision(this.ball)){
this.ball.updateSpeedVector(obj);
}
});
this.ball.draw();
window.requestAnimationFrame(this.render.bind(this));
}
//…
const board = new Scene("board").render();
I performed many tests by enabling and disabling different options, methods, functions in the app. Therefore, I noticed that any draw() methods (aka canvas methods) don’t cause the issue. The issue appears only if I enable collision detection (mainly), physics or AI. I’m using points, vectors and other math functions for respective middleware detections. The browser’s debuggers and performance monitors didn’t show any memory leaks or other abnormal behavior in the respective methods.
I analyzed the respective code frame by frame, pixel by pixel and step by step. During the debug time the browser just suddenly stops the DevTools with the message “DevTools was disconnected from the page” and the browser tab turns white with the message “Error: STATUS_BREAKPOINT”.
The most uncommon and strange thing is that this issue appears at different random moments (after 5 sec, after 25 sec) based on the Scene size, the number of objects. Also, there’s no any error or warning notifications in the DevTools console. And the most crazy thing about this issue is that it worked just fine during the first 4 days of development and testing, considering I didn’t make any OS or browser updates before this. Here’s a screenshot from my app performance just before the crash:
As you can notice, the app works like a clock. Call Tree for the checkCollision method shows 0.4ms execution time. There’s no memory leaks and GC works just fine:
About environment
- Platform x64;
- OS Win10 v.18363;
- CPU AMD x64;
- Chrome 97.0.4692.71 and Edge 97.0.1072.55.
Similar issues
DevTools:
- Tips on solving 'DevTools was disconnected from the page' and Electron Helper dies
- https://groups.google.com/a/chromium.org/g/chromium-discuss/c/SBxe5gMOzS0
- https://github.com/electron/electron/issues/21834
STATUS_BREAKPOINT:
- https://browserhow.com/how-to-fix-the-error-status_breakpoint-on-chrome-or-edge/
- https://www.technipages.com/fixing-google-chrome-error-code-status_breakpoint
- https://answers.microsoft.com/en-us/microsoftedge/forum/all/error-statusbreakpoint-in-any-browser-i-use/957692c0-3428-4fb5-9499-dbf8f1779b6f
- https://support.google.com/chrome/thread/121850451/error-status-breakpoint-everytime-i-open-paypal-com?hl=en
My assumptions
I’d like to find a solution or at least an explanation of what’s going on. It seems that this issue is very common based on the links above. In my opinion, it’s a serious bug or even a vulnerability in the respective browser's runtime, GPU or JIT-Compiler code. Something that even a DevTool can’t detect or handle. I found that this issue seems to appear more frequently on Win10 OS under AMD CPU. Also the issue is caused by an internal infinite loop which runtime can't handle, as somebody wrote. Looks like both Chrome and Edge are using similar/same core runtime.