Closed Bug 1259358 Opened 8 years ago Closed 8 years ago

Platform specific strange nsITimer behavior under e10s

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID
Tracking Status
e10s m9+ ---

People

(Reporter: cleu, Unassigned)

Details

Under bug1254298
https://bugzilla.mozilla.org/show_bug.cgi?id=1254298

The timer will not work if we use it in the first tab.
And if we have used it in first tab, the timer wont work in same service anymore until restart.

This problem only exists in Linux (Tested under Ubuntu 14.04) and MacOSX (10.11.3)

bug1254298 is fixed by remove the timer used in GamepadService,
but I think the nsITimer problem still exists.

Possibly has some to do with pthread since Windows is not affected.
Nathan, this is concerning, especially as it could relate to bug 1250672. Could you take a look at it?
tracking-e10s: --- → m9+
Flags: needinfo?(nfroyd)
Bug 1254298 looks like it relates to a specific timer usage that's not valid in e10s.  I don't understand why "the nsITimer problem still exists"...what nsITimer problem?
Flags: needinfo?(nfroyd) → needinfo?(cleu)
The problem is that nsITimer may not fire callback if we use it with something like InitWithFuncCallback() in the first Tab under e10s.
This situation only happens in Linux and Mac OSX.
Flags: needinfo?(cleu)
(In reply to Michael Leu[:lenzak800] from comment #3)
> The problem is that nsITimer may not fire callback if we use it with
> something like InitWithFuncCallback() in the first Tab under e10s.
> This situation only happens in Linux and Mac OSX.

That's a pretty strong claim.  Do you have steps to reproduce this bug?  Is that using it from C++, JS, an extension...?
Flags: needinfo?(cleu)
It is C++ part, the problem can be reproduced under Comment 1 in bug1254298 before it landed.
https://bugzilla.mozilla.org/show_bug.cgi?id=1254298#c1

There's a nsITimer in GamepadService which act as a cleanup timer.
It fires callback 2 seconds after no tabs using Gamepad API to cleanup gamepad backend

This timer doesn't fire callback so the backend cannot stop, but only the first tab has this problem.  

The patch in bug1254298 is to just bypass the timer, which is a minimal fix for Gamepad's situation.

But the timer is expected to work in any tab.
Flags: needinfo?(cleu)
ps. The test site should be http://html5gamepad.com.
Component: General → XPCOM
(In reply to Michael Leu[:lenzak800] from comment #5)
> It is C++ part, the problem can be reproduced under Comment 1 in bug1254298
> before it landed.
> https://bugzilla.mozilla.org/show_bug.cgi?id=1254298#c1
> 
> There's a nsITimer in GamepadService which act as a cleanup timer.
> It fires callback 2 seconds after no tabs using Gamepad API to cleanup
> gamepad backend
> 
> This timer doesn't fire callback so the backend cannot stop, but only the
> first tab has this problem.  
> 
> The patch in bug1254298 is to just bypass the timer, which is a minimal fix
> for Gamepad's situation.

Why do you think that bug 1254298 comment 2 is not an accurate description of the problem?  According to that comment, it sounds like what's going wrong is that the timer *is* firing, but the child cannot receive the shutdown message, and that causes the gamepad to never be deregistered.  It's not clear to me that bug 1254298 comment 1 conclusively showed that the timer isn't firing.
Flags: needinfo?(cleu)
Kyle, are Nathan and I misunderstanding your comments in bug 1254298? It sounds to me like there was some kind of shutdown race condition, not that timers weren't firing.
Flags: needinfo?(kyle)
(In reply to Brad Lassey [:blassey] (use needinfo?) from comment #1)
> Nathan, this is concerning, especially as it could relate to bug 1250672.
> Could you take a look at it?

Just to reiterate in case we're using it as a priority measure, bug 1250672 is a non-issue and had nothing to do with timers.
> Why do you think that bug 1254298 comment 2 is not an accurate description
> of the problem?  According to that comment, it sounds like what's going
> wrong is that the timer *is* firing, but the child cannot receive the
> shutdown message, and that causes the gamepad to never be deregistered. 
> It's not clear to me that bug 1254298 comment 1 conclusively showed that the
> timer isn't firing.

I think you are right, it's my misunderstanding.
Sorry about that....
Flags: needinfo?(kyle)
Flags: needinfo?(cleu)
(In reply to Michael Leu[:lenzak800] from comment #10)
> > Why do you think that bug 1254298 comment 2 is not an accurate description
> > of the problem?  According to that comment, it sounds like what's going
> > wrong is that the timer *is* firing, but the child cannot receive the
> > shutdown message, and that causes the gamepad to never be deregistered. 
> > It's not clear to me that bug 1254298 comment 1 conclusively showed that the
> > timer isn't firing.
> 
> I think you are right, it's my misunderstanding.
> Sorry about that....

No problem!  I'm going to close this bug.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.