Closed Bug 1971874 Opened 1 year ago Closed 4 months ago

ChatGPT web page unresponsive after TypeError: Performance.measure: Given attribute end cannot be negative

Categories

(Core :: DOM: Performance APIs, defect, P1)

Unspecified
All
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: cpeterson, Unassigned, NeedInfo)

References

Details

Attachments

(1 file)

Attached image screenshot.png

I have ChatGPT open in a pinned tab all day. Twice during Nightly 140 and once (so far) in Nightly 141, my ChatGPT tab stopped responding to mouse clicks. Hover effects when mousing over web page buttons still work.

Reloading the tab doesn't fix the problem, but opening ChatGPT in a second tab works normally (and doesn't unblock the first tab).

Disabling ETP and uBlock Origin and all my other extensions doesn't fix the problem.

I see an error in the web console from a React internal function called addTiming in unresponsive ChatGPT tabs, but not in my responsive ChatGPT tabs. Maybe this error is thrown and causing React stop responding.

Uncaught (in promise) TypeError: Performance.mark: Expected startTime >= 0
    addTiming https://cdn.oaistatic.com/assets/jjc2httdu26pxxat.js:2
    addTiming https://cdn.oaistatic.com/assets/jjc2httdu26pxxat.js:2
    <anonymous> https://cdn.oaistatic.com/assets/d68wm3uy6nlrfskx.js:1

I see references to Firefox and this performance.mark error in this OpenAI forum comment from 2025-05-09:

https://community.openai.com/t/chatgpt-has-stopped-working-in-firefox/664425/102

Okay, actual solution involving code.

If you look in the console you’ll a lot of warnings and in my case, an error at the top saying Uncaught (in promise) TypeError: Performance.mark: Expected startTime >= 0. My hunch is that maybe Firefox doesn’t allow Performance.mark to have a startTime < 0, but OpenAI (or a package they use) is doing some funk with specific timings and state causing a race-condition.

This race condition sometimes causes errors. So what I did was click the file-link top right of the error. You can see in this next page that the r - performance.timeOrigin is the issue here. So right-click on the file and select “Add script override” (which lets you use a file on your computer rather than their code).

Dump the file somewhere. Then do a Ctrl-Replace with performance.mark(t,{startTime:r-performance.timeOrigin}) to performance.mark(t,{startTime:Date.now()}). Save, wait for any linters you have enabled to have a breakdown, then refresh the page.

And if your problem was the same as mine, it should work. It’ll likely last for about three days until they release a new update, but I figured I’d tell people.

Component: General → DOM: Performance APIs

I wonder if you can hit that legitimately due to our clamping of performance.now precision or what not.

The severity field is not set for this bug.
:bas.schouten, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(bas)
Duplicate of this bug: 1972808

I see performance.mark(t,{startTime:Math.max(0,r-performance.timeOrigin)}) so this might be fixed now.

Severity: -- → S2
Priority: -- → P1

If someone still sees this please reopen

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Resolution: FIXED → WORKSFORME
See Also: → 1976926
See Also: → 1977888

I'm reopening this bug because I'm experiencing this ChatGPT problem again. I see a similar Performance error about negative time in the console. I'm using Nightly 148 on Windows 11.

Here's a profile: https://share.firefox.dev/49iC9Wa

Ignoring unsupported entryTypes: longtask. 6028f1590zjexm5i.js:58:135419
Uncaught (in promise) TypeError: Performance.measure: Given attribute end cannot be negative 3sy3v96swt75qo1o.js:2:83266
    addTiming https://chatgpt.com/cdn/assets/3sy3v96swt75qo1o.js:2
    addFirstTiming https://chatgpt.com/cdn/assets/3sy3v96swt75qo1o.js:2
    addFirstTiming https://chatgpt.com/cdn/assets/3sy3v96swt75qo1o.js:2
    <anonymous> https://chatgpt.com/cdn/assets/gkd04ql7k0htvtda.js:1

(In reply to Emilio Cobos Álvarez [:emilio] from comment #2)

I wonder if you can hit that legitimately due to our clamping of performance.now precision or what not.

I do have the privacy.fingerprintingProtection pref enabled, in case that is affecting the timer precision.

I reset privacy.fingerprintingProtection to false and reloaded the ChatGPT page. And now the page works! Previously, once the page got stuck, reloading wouldn't fix the page. When I then set privacy.fingerprintingProtection back to true and reloaded the page, it still worked.

I don't know if changing privacy.fingerprintingProtection requires a restart. If so, then my test was invalid.

Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Summary: ChatGPT web page unresponsive after React TypeError: Performance.mark: Expected startTime >= 0 → ChatGPT web page unresponsive after TypeError: Performance.measure: Given attribute end cannot be negative
Blocks: 1834329
Summary: ChatGPT web page unresponsive after TypeError: Performance.measure: Given attribute end cannot be negative → ChatGPT web page (with fingerprintingProtection?) unresponsive after TypeError: Performance.measure: Given attribute end cannot be negative

FPP does not control any of the timer precision code actually. Reasonable misunderstanding because the RFP pref does enforce much lower precision on all timestamps.

My best guess is that an extremely uncommon edge case resulting from float rounding and the precision code in nsRFPService resulted in this negative time. Reloading the page just refreshed all of their state and fix the page. The edge case is so uncommon that it only arises very rarely.

Bug 1959231 was a recent bug of that I dug into illustrating the float issues, I'm not sure if it's the same problem here, but probably related or at least similar.

See Also: → 1959231

Unlinking the FPP meta bug because I experienced this bug with privacy.fingerprintingProtection = false.

No longer blocks: 1834329
Summary: ChatGPT web page (with fingerprintingProtection?) unresponsive after TypeError: Performance.measure: Given attribute end cannot be negative → ChatGPT web page unresponsive after TypeError: Performance.measure: Given attribute end cannot be negative
See Also: → 2010712

I've been hitting this frequently with a very long conversation including code snippets.

Not sure if the profile can help: https://share.firefox.dev/3MedQ2X

I've been hitting this bug almost every day recently.

Uncaught (in promise) TypeError: Performance.measure: Given attribute end cannot be negative
    addTiming https://chatgpt.com/cdn/assets/4813494d-bxpu2b3wrwxtmqh4.js:2
    addFirstTiming https://chatgpt.com/cdn/assets/4813494d-bxpu2b3wrwxtmqh4.js:2
    addFirstTiming https://chatgpt.com/cdn/assets/4813494d-bxpu2b3wrwxtmqh4.js:2
    <anonymous> https://chatgpt.com/cdn/assets/85c26ade-c71mto5267rxt35n.js:1

Some findings from my debugging this exception from performance.measure(t,{start:o,end:i}) in https://chatgpt.com/cdn/assets/4813494d-bxpu2b3wrwxtmqh4.js:

In the addTiming() function below, argument n = 1769812280669 and performance.timeOrigin = 1769812284802, so performance.measure() is called with:

  • mark name = "composer.html"
  • start = 0
  • end = -4133 (from n 1769812280669 - performance.timeOrigin 1769812284802)

I don't know where argument n's value 1769812280669 came from.

Note how this function anticipates negative end time when it calls performance.mark(t, {startTime: Math.max(0, i)}), but not when it calls performance.measure() three lines later:

    addTiming(t, {
        time: n,
        serialTimingGroup: r
    } = {}) {
        const s = n != null ? n : Date.now(),
            i = s - performance.timeOrigin;
        if (performance.mark(t, {
                startTime: Math.max(0, i)
            }), r) {
            te(this, Ic).has(r) || te(this, Ic).set(r, 0);
            const o = te(this, Ic).get(r);
            performance.measure(t, {
                start: o,
                end: i
            }), te(this, Ic).set(r, i)
        }
        return te(this, Bh).set(t, s), te(this, no) || (console.error("Should not call addTiming before initialize"), this.initialize()), Bn.addTiming(t, n), n
    }

On 2026-02-04, an OpenAI developer said:

I merged in a fix to this issue yesterday so hopefully it should be resolved later today.

I haven't seen the hang since then, so I'm hopeful it worked. If no one reports seeing this bug for a couple weeks, I'll close this bug as fixed.

I've been hitting several times over the past week. As mentioned in comment 11, this happens when there is a lot of code snippets involved.

@ flod: when you hit the hang, can you please share any Uncaught (in promise) TypeError stack traces from your dev tools console? I am following up with an OpenAI engineer.

Flags: needinfo?(francesco.lodolo)

I'll see if I can reproduce again. I stopped keeping long conversations with code given the bug, and move to Claude for coding tasks.

Clearing NI: I've been trying to replicate on a couple of laptops, also restarting old conversations, but the problem seems to have gone away. I'm sure it will resurface as soon as we close this bug…

Flags: needinfo?(francesco.lodolo)

Thanks for checking again. I'll optimistically close this bug for now.

Status: REOPENED → RESOLVED
Closed: 1 year ago4 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: