Closed Bug 1232285 Opened 9 years ago Closed 9 years ago

The Terminator's notion of ticks is incorrect

Categories

(Toolkit :: Async Tooling, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla46
Tracking Status
firefox46 --- fixed

People

(Reporter: Yoric, Assigned: tvaleev, Mentored)

References

(Blocks 1 open bug)

Details

(Whiteboard: [lang=c++])

Attachments

(1 file, 2 obsolete files)

In nsTerminator.cpp, we currently hardcode TICK_DURATION = 1000, assuming that one tick is one millisecond. That's probably not true on all platforms.

Rather, we should define `tick_duration = PR_MillisecondsToInterval(1000)` to get the correct value for the platform.
Attached patch bug-1232285-fix-0.1.patch (obsolete) — Splinter Review
Hi! Is it good?
Attachment #8698459 - Flags: review?(dteller)
Comment on attachment 8698459 [details] [diff] [review]
bug-1232285-fix-0.1.patch

Review of attachment 8698459 [details] [diff] [review]:
-----------------------------------------------------------------

Actually, that's not exactly what I want.
Define `TICKS_DURATION` is used twice in the code. I'd like to replace the global define with a local constant `ticksDuration` defined from `PR_MillisecondsToInterval(1000)`.
Attachment #8698459 - Flags: review?(dteller) → feedback+
Attached patch bug-1232285-fix-0.2.patch (obsolete) — Splinter Review
Attachment #8698459 - Attachment is obsolete: true
Attachment #8699010 - Flags: review?(dteller)
Assignee: nobody → tvaleev
Comment on attachment 8699010 [details] [diff] [review]
bug-1232285-fix-0.2.patch

Review of attachment 8699010 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me. Just don't forget to change the commit message to add ",r=Yoric" at the end.
Let's run this through the tests: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ac274be0103f

Note that I'll be away for ~2 weeks so you may need to find someone else to land this code.

::: toolkit/components/terminator/nsTerminator.cpp
@@ +126,5 @@
>    uint32_t crashAfterTicks = options->crashAfterTicks;
>    options = nullptr;
>  
>    const uint32_t timeToLive = crashAfterTicks;
> +  const uint32_t ticksDuration = PR_MillisecondsToInterval(1000);

This should work, but let's make it `PRIntervalTime` instead of `uint32_t`.
Attachment #8699010 - Flags: review?(dteller) → review+
Attachment #8699010 - Attachment is obsolete: true
Hi! Do you know who can land this code?
Flags: needinfo?(vladan.bugzilla)
Flags: needinfo?(nfroyd)
(In reply to Timur Valeev from comment #6)
> Hi! Do you know who can land this code?

Landed, thanks!

(For future patches, you can set the checkin-needed keyword after posting a successful try run URL to the bug.)
Flags: needinfo?(vladan.bugzilla)
Flags: needinfo?(nfroyd)
https://hg.mozilla.org/mozilla-central/rev/15e06810ae30
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: