Closed Bug 1398030 Opened 8 years ago Closed 8 years ago

Intermittent /eventsource/format-field-id.htm | application crashed [@ mozilla::dom::EventSourceImpl::SetupHttpChannel] after Assertion: ((bool)(__builtin_expect(!!(!NS_FAILED_impl(rv)), 1))), at EventSource.cpp:971

Categories

(Core :: DOM: Events, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox-esr52 --- wontfix
firefox56 --- wontfix
firefox57 --- wontfix
firefox58 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: stone)

References

Details

(Keywords: crash, intermittent-failure, Whiteboard: [stockwell unknown])

Crash Data

Attachments

(2 files, 3 obsolete files)

Component: DOM → DOM: Events
See Also: → 1398004
Assignee: nobody → sshih
There is an assertion some seconds before the crash: [task 2017-09-14T08:29:13.107728Z] 08:29:13 INFO - PID 2779 | Assertion failure: ((bool)(__builtin_expect(!!(!NS_FAILED_impl(rv)), 1))), at /builds/worker/workspace/build/src/dom/base/EventSource.cpp:971 [task 2017-09-14T08:29:13.350974Z] 08:29:13 INFO - PID 2779 | #01: mozilla::dom::EventSourceImpl::SetupHttpChannel() (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.359183Z] 08:29:13 INFO - PID 2779 | #02: mozilla::dom::EventSourceImpl::InitChannelAndRequestEventSource() (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.367481Z] 08:29:13 INFO - PID 2779 | #03: mozilla::dom::EventSourceImpl::TimerCallback(nsITimer*, void*) (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.371397Z] 08:29:13 INFO - PID 2779 | #04: nsTimerImpl::Fire(int) (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.379591Z] 08:29:13 INFO - PID 2779 | #05: nsTimerEvent::Run() (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.383528Z] 08:29:13 INFO - PID 2779 | #06: nsThread::ProcessNextEvent(bool, bool*) [clone .part.256] (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.391654Z] 08:29:13 INFO - PID 2779 | #07: NS_ProcessNextEvent(nsIThread*, bool) (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.395521Z] 08:29:13 INFO - PID 2779 | #08: mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.403592Z] 08:29:13 INFO - PID 2779 | #09: MessageLoop::RunInternal() (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.407486Z] 08:29:13 INFO - PID 2779 | #10: MessageLoop::Run() (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.415796Z] 08:29:13 INFO - PID 2779 | #11: nsBaseAppShell::Run() (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.423938Z] 08:29:13 INFO - PID 2779 | #12: XRE_RunAppShell() (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.431996Z] 08:29:13 INFO - PID 2779 | #13: mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.432407Z] 08:29:13 INFO - PID 2779 | #14: MessageLoop::RunInternal() (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.432911Z] 08:29:13 INFO - PID 2779 | #15: MessageLoop::Run() (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.436890Z] 08:29:13 INFO - PID 2779 | #16: .L299 (/builds/worker/workspace/build/application/firefox/libxul.so) [task 2017-09-14T08:29:13.518433Z] 08:29:13 INFO - PID 2779 | #17: content_process_main(mozilla::Bootstrap*, int, char**) (/builds/worker/workspace/build/application/firefox/firefox) [task 2017-09-14T08:29:13.519830Z] 08:29:13 INFO - PID 2779 | #18: main (/builds/worker/workspace/build/application/firefox/firefox) [task 2017-09-14T08:29:13.520554Z] 08:29:13 INFO - PID 2779 |
Summary: Intermittent /eventsource/format-field-id.htm | application crashed [@ mozilla::dom::EventSourceImpl::SetupHttpChannel] → Intermittent /eventsource/format-field-id.htm | application crashed [@ mozilla::dom::EventSourceImpl::SetupHttpChannel] after Assertion: ((bool)(__builtin_expect(!!(!NS_FAILED_impl(rv)), 1))), at EventSource.cpp:971
Stone, are you able to take a look?
Flags: needinfo?(sshih)
Priority: -- → P2
(In reply to Andrew Overholt [:overholt] from comment #6) > Stone, are you able to take a look? Yes. It hits the assertion that calls http channel SetRequestHeader failed. It's odd that we call SetRequestHeader few lines before and it doesn't fail. Trying to figure out what's the difference.
Flags: needinfo?(sshih)
(In reply to Ming-Chou Shih [:stone] from comment #7) > (In reply to Andrew Overholt [:overholt] from comment #6) > > Stone, are you able to take a look? > Yes. It hits the assertion that calls http channel SetRequestHeader failed. > It's odd that we call SetRequestHeader few lines before and it doesn't fail. > Trying to figure out what's the difference. Can't reproduce it in local and on the try server. Checked the history [1] and looks like the frequency is decreasing. [1] https://brasstacks.mozilla.com/orangefactor/?display=Bug&bugid=1398030&startday=2017-09-01&endday=2017-09-21&tree=all
See Also: → 1398772
This is caused by a server response with id = "\n" Spec says 'If the field value does not contain U+0000 NULL, then set the last event ID buffer to the field value. Otherwise, ignore the field.' We follow what spec says but fails to SetRequestHeader for a http channel (checks it in [1]) [1] http://searchfox.org/mozilla-central/rev/d0448c970093f94bd986a21d3a9e8c366b316eb4/netwerk/protocol/http/nsHttp.cpp#278
hmm, might be a problem when parsing stream in EventSource
Attachment #8920921 - Flags: review?(amarchesini)
Attachment #8920922 - Flags: review?(amarchesini)
Attachment #8920922 - Flags: review?(amarchesini) → review+
Comment on attachment 8920921 [details] [diff] [review] Add debug info when EventSource set http request header failed. Review of attachment 8920921 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/base/EventSource.cpp @@ +969,2 @@ > } > + nsAutoCString eventId = NS_ConvertUTF16toUTF8(mLastEventID); NS_ConvertUTF16toUTF8 eventId(mlastEventID); @@ +971,5 @@ > + rv = mHttpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Last-Event-ID"), > + eventId, false); > +#ifdef DEBUG > + if (NS_FAILED(rv)) { > + MOZ_CRASH_UNSAFE_PRINTF("SetupHttpChannel. rv=%x (%s)", uint32_t(rv), Why this crash?
Attachment #8920921 - Flags: review?(amarchesini) → review-
(In reply to Andrea Marchesini [:baku] from comment #21) > @@ +971,5 @@ > > + rv = mHttpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Last-Event-ID"), > > + eventId, false); > > +#ifdef DEBUG > > + if (NS_FAILED(rv)) { > > + MOZ_CRASH_UNSAFE_PRINTF("SetupHttpChannel. rv=%x (%s)", uint32_t(rv), > > Why this crash? Just want to easily aware of the failure of setting an invalid http request header on the debug build. It's okay to me to only output some messages.
Attachment #8920921 - Attachment is obsolete: true
Attachment #8920989 - Flags: review?(amarchesini)
Comment on attachment 8920989 [details] [diff] [review] Add debug info when EventSource set http request header failed. Review of attachment 8920989 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/base/EventSource.cpp @@ +971,5 @@ > + rv = mHttpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Last-Event-ID"), > + eventId, false); > +#ifdef DEBUG > + if (NS_FAILED(rv)) { > + printf_stderr("SetupHttpChannel. rv=%x (%s)", uint32_t(rv), eventId.get()); You should use MOZ_LOG here.
Attachment #8920989 - Flags: review?(amarchesini) → review-
Attachment #8920989 - Attachment is obsolete: true
Attachment #8921354 - Flags: review?(amarchesini)
Comment on attachment 8921354 [details] [diff] [review] Add debug info when EventSource set http request header failed. Review of attachment 8921354 [details] [diff] [review]: ----------------------------------------------------------------- Thanks!
Attachment #8921354 - Flags: review?(amarchesini) → review+
Pushed by sshih@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/f9b2e32292a1 Part1: Add debug info when EventSource set http request header failed. r=baku. https://hg.mozilla.org/integration/mozilla-inbound/rev/c9f228c158d7 Part2: Handle null id of the message for EventSource. r=baku.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: