Does a call stack prove that the code execution was not interrupted?
I am trying to understand the root cause of a very rare intermittent bug, which no developer in our team has ever managed to reproduce. I have its JS error stack trace, which kinda looks like this:
Cannot call method 'getObject' of undefined at method3 (source.js:2247:551) at method2 (source.js:2248:247) at method1 (source.js:2415:168) at window.Dialog.Class.#ok-button click (source.js:184:59) at HTMLButtonElement.window.GenericController.Class.triggerMethod (source.js:2059:207) at HTMLButtonElement.x.event.dispatch (jquery.js:5:14129) at HTMLButtonElement.v.handle (jquery.js:5:10866)
It seems (not 100% sure) to me that the code, which is executing here on click of a button, is written in such a way that it is impossible for this bug to occur by itself, provided there is no intervention from the outside (so like an event from an external system, which might mess up the state of a program). What I mean is that in essence it looks similar to this:
1. var x = 5;
2. if (x !== 5) { throw new Error(); }
Obviously, we will never get an Error thrown here. Also, here it's clear that no event can somehow intervene between the execution of lines 1 & 2.
My questions are:
I guess that this could depend on the browser and since we use some custom Chromium-based browser, I might get some results which would otherwise never occur on Chrome, for example.
链接地址: http://www.djcxy.com/p/71698.html上一篇: Chrome火焰图中的顶级函数调用
下一篇: 调用堆栈是否证明代码执行没有中断?