phetsims / hookes-law

"Hooke's Law" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
1 stars 4 forks source link

Assertion failed: Exit events not matched by an enter #18

Closed samreid closed 9 years ago

samreid commented 9 years ago

Most likely a scenery issue but I saw this in Hooke's Law so I'll report here first. With the dev tools open, if I open the Systems screen and move the slider, then mouse out and back in, I see this problem. It happened 2-3 times in a row so I thought I should report it:

Uncaught Error: Assertion failed: Exit events not matched by an enter

image

I'll reassign to @pixelzoom to see if he can reproduce the problem.

I'm on OSX 10.10.4 running Chrome Version 44.0.2403.130 (64-bit). Testing a requirejs version of hookes law out of master. Tagging @jonathanolson in case he knows anything helpful about this kind of error.

samreid commented 9 years ago

This error happened again on the next run (4th run) but not the following 2 runs.

pixelzoom commented 9 years ago

Thanks for reproducing this. I've seen it a few times (over the past few months?). I couldn't reproduce it, so assumed (perhaps incorrectly) that it was transient Chrome problem. No idea what the cause is, so assigning to @jonathanolson. If this is indeed a scenery issue, then it's probably high priority.

pixelzoom commented 9 years ago

@samreid There's no URL shown in your screenshot, and you didn't mention how you were running the sim. But I'm assuming you were running with assertions enabled (?ea), correct?

samreid commented 9 years ago

Yes, ?ea

samreid commented 9 years ago

You can see that it says enabling assert in the console

jonathanolson commented 9 years ago

I've spent about 15-20 minutes trying to reproduce across platforms (I have OS X 10.9.5, maybe that is a difference), for OS X, Windows and all browsers, and I haven't been able to cause it.

Any more detail on:

open the Systems screen and move the slider, then mouse out and back in

Mouse out (of window?)

samreid commented 9 years ago

I tested with the built and non-built versions of hookes law and could not reproduce the problem again.

samreid commented 9 years ago

Not sure what else I can do here, I'll send it back to @pixelzoom to decide what's next, if anything.

pixelzoom commented 9 years ago

Hmmm... Now I can't reproduce reliably either. But I have seen this repeatedly with hookes-law and other sims over the past few months. So I'm hesitant to just close this as "cannot reproduce".

Searching for the error message, this assertion comes from scenery.ButtonListener, line 104:

assert && assert( this._overCount > 0, 'Exit events not matched by an enter' );

@jonathanolson Does that provide any additional clues about what might be going on here, or how to reproduce it reliably?

jonathanolson commented 9 years ago

Yes, it would generally indicate an inconsistent state for input handling. It could be either a browser issue or Scenery issue.

It's the type of bug where it would be very helpful to record Scenery input events so that we could play back the failing sequence once recorded.

samreid commented 9 years ago

In my case, I was mousing out to the dev tools, not out of the entire browser. Not sure if that was a critical ingredient or not.

jonathanolson commented 9 years ago

In my case, I was mousing out to the dev tools, not out of the entire browser. Not sure if that was a critical ingredient or not.

That's what I was testing. Just tried it out a few more times on OS X / Win, and still wasn't able to reproduce. If we can reproduce even somewhat regularly, I think it would be useful to log all input events.

I'll leave assigned to me, and look more into bringing Scenery event recording back up-to-date.

jonathanolson commented 9 years ago

Pulling latest. If you're able to reproduce, please do the following:

  1. In 'chronicle', npm install
  2. In 'chronicle', node js/server.js
  3. Run sim with ?recordInputEventLog&ea
  4. If assertion is hit, resume, interact just a bit more, then close the sim browser tab (it uses a websocket, but the message won't be hit right when the debugger pauses it).
  5. Check chronicle/data for a .txt file, and get it to me.
  6. Record exact SHAs, to help reproduce?

I'll hopefully be able to reproduce from a log.

pixelzoom commented 9 years ago

I've been playing around with the sim, but can't reproduce the problem. Mac OS X 10.10.5, Chrome 4.0.2403.155 (64 bit).

@samreid you said:

With the dev tools open, if I open the Systems screen and move the slider, then mouse out and back in, I see this problem.

Do you recall if you moved into the dev tools window with the mouse still down on the slider? Or did you release the mouse in the browser window, then move the mouse (still up) into the dev tools window?

samreid commented 9 years ago

I believe the mouse was up, but, like I said in https://github.com/phetsims/hookes-law/issues/18#issuecomment-130695248 I can no longer reproduce the problem.

pixelzoom commented 9 years ago

As I mentioned in https://github.com/phetsims/hookes-law/issues/18#issuecomment-130754603, this assertion is occurring in scenery.ButtonListener. So it seems like we should be able to isolate it, or at least hypothesize about what's causing it. But I've been unable to reproduce it, and I haven't heard any thoughts about how this might be related to scenery.ButtonListener. So I'm going to unassign this issue. If someone experiences the problem, follow @jonathanolson's instructions in https://github.com/phetsims/hookes-law/issues/18#issuecomment-130961341.

pixelzoom commented 9 years ago

This is a general issue, moved to https://github.com/phetsims/scenery/issues/456.