-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0 hits reported incorrectly #23
Comments
@Andarist left a comment in the replay that the outer IF is returning falsey for all 24 branches. How did you get to |
@jasonLaster this is how: https://app.replay.io/recording/cf835ced-5001-469b-8111-90c4522bb64d . Just go to the very last hit at |
The bit of the conditional on line 60022 that never hits is the Small-stepping through the debug also demonstrates this: the debugger enters the That last breakpoint before returning to the caller maybe corresponds to a "IFNE" (jump if false) bytecode instruction to skip the loop conditional. There would need to be one after the "AND 131072" operation to implement short-circuiting. Then I thought about it more and figured that the last instruction before returning to the might actually be a "RET" instruction embedded inside the conditional code, since a failure of any of the terms in the conditional leads to the end of the function. Either way, what I think might be happening is this: the IFNE/RET instruction we land at right before returning is not classified as part of the conditional. If we land on it, we map that to a minified code location that corresponds to "after the conditional", which presents as "before the call". The inner "if" is not mapped because a smart enough bytecode compiler converts it into a single conditional with the inner expression being I'm hoping to maybe replicate this in a reduced test case with conditionals. |
I'm afraid that this might not be the correct diagnosis here. This whole debugging session has started from the fact that TS was not able to infer a parameter type and raised an implicit any error.
So it makes sense that Of course, this doesn't yet prove anything as the error could have been somehow raised by any other function in And the reported call stack looks exactly like the one on this loom: https://www.loom.com/share/9628264e684a4d0eb66e5176296972e5
|
Thanks for the detailed info! It's interesting that the stack trace you have has Thanks, I'm convinced by your argument that there's more going on than just a mapping issue here. I looked at |
Yeah, I saw that before I posted. However, if you hover of the line-numbers on that line it's reporting the line as having 0 hits. Either way, there is a codepath that's not getting picked up. This is a wild guess but maybe some types of frame entries that are not getting picked up by the replay-process instrumentation. |
@Andarist would it be possible to get the materials needed to repro this locally? |
hmm... I wonder if part of this is that there are multiple breakable locations on that line. You should both enable column breakpoints via |
@kannanvijayan sorry for the late reply but I've finally extracted the repro case for this. You can find it here: https://github.com/Andarist/replay-stopped-at-0-hits-line/tree/323f80789d6a20691c52b05b1ee33a3b065a1056 . I think the info in the README and in the Loom recording is enough but if anything is still unclear - just let me know. |
@Andarist thanks that's fantastic! I've been hacking away at internal analysis tooling to lets us inspect our logs better this last week or so. I'm actually heading on vacation for the next week, but others will be looking at it in the meantime and I'll be getting back to it as soon as I'm back. Appreciate the effort in getting a repro testcase. That's very well prepared! |
I have one additional recording suffering from a very similar problem here: I've also noticed something very similar today while stepping out of functions and I think this all might be the same issue. I think what happens here (at least on this new replay and while stepping out of a function) is that we always get to the last statement of a particular function. But that statement might be from a random location really if we have if statements etc. Consider this: function foo(a) {
if (a) {
callSmth()
}
} If I make a step on the |
It seems that "0 hits" may actually be correct and we're sometimes getting wrong locations for the stack frames: in the initial recording the debugger should never step to the |
This would probably highly relate to my observation from the previous post (just making sure that you have not missed it by accident). Wrong frame locations could explain both problems. |
@hbenl removed from our current sprint since it is blocked on RecordReplay/backend#3288 |
This ticket has been moved to RUN-307 |
I'm debugging this recording:
https://app.replay.io/recording/21594023-f9ae-4787-912c-c391a68304aa
and I've noticed that sometimes I'm not able to step into certain functions. Take a look at this loom:
https://www.loom.com/share/9628264e684a4d0eb66e5176296972e5
Notice how I've wanted to step into
reportImplicitAny
but I was taken out of this frame, to the point after the call to thereportImplicitAny
's caller.One additional thing I've noticed here is that 0 hits are reported on the line containing that
reportImplicitAny
This is clearly incorrect as I was paused at this line of code.
The text was updated successfully, but these errors were encountered: