Bug 1637648 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

 I hit an assertion on [try](https://treeherder.mozilla.org/#/jobs?repo=try&revision=0b16002f855bc7c5296cb238af76a0d1d30d20f3&selectedTaskRun=LMs4mHTUSsO0ZllfpSCs3w-0).
```
[task 2020-06-09T09:06:54.050Z] 09:06:54     INFO -  PID 1167 | Assertion failure: mConfirmer, at /builds/worker/checkouts/gecko/netwerk/dns/TRRService.cpp:978
[task 2020-06-09T09:06:54.050Z] 09:06:54     INFO -  Initializing stack-fixing for the first stack frame, this may take a while...
[task 2020-06-09T09:07:02.819Z] 09:07:02     INFO -  PID 1167 | #01: non-virtual thunk to mozilla::net::TRRService::CompleteLookup(nsHostRecord*, nsresult, mozilla::net::AddrInfo*, bool, nsTSubstring<char> const&) [netwerk/dns/TRRService.cpp:0]
[task 2020-06-09T09:07:02.819Z] 09:07:02     INFO -  PID 1167 | #02: mozilla::net::TRR::FailData(nsresult) [netwerk/dns/TRR.cpp:1273]
[task 2020-06-09T09:07:02.820Z] 09:07:02     INFO -  PID 1167 | #03: mozilla::net::TRR::OnStopRequest(nsIRequest*, nsresult) [netwerk/dns/TRR.cpp:1402]
[task 2020-06-09T09:07:02.820Z] 09:07:02     INFO -  PID 1167 | #04: mozilla::net::TRRServiceChannel::OnStopRequest(nsIRequest*, nsresult) [netwerk/protocol/http/TRRServiceChannel.cpp:1186]
[task 2020-06-09T09:07:02.822Z] 09:07:02     INFO -  PID 1167 | #05: non-virtual thunk to mozilla::net::TRRServiceChannel::OnStopRequest(nsIRequest*, nsresult) [netwerk/protocol/http/TRRServiceChannel.cpp:0]
[task 2020-06-09T09:07:02.822Z] 09:07:02     INFO -  PID 1167 | #06: nsInputStreamPump::OnStateStop() [netwerk/base/nsInputStreamPump.cpp:687]
[task 2020-06-09T09:07:02.823Z] 09:07:02     INFO -  PID 1167 | #07: nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*) [netwerk/base/nsInputStreamPump.cpp:443]
[task 2020-06-09T09:07:02.823Z] 09:07:02     INFO -  PID 1167 | #08: non-virtual thunk to nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*) [netwerk/base/nsInputStreamPump.cpp:0]
```
The detail of this assertion is described below.
1. `test_trr.js` is finished, so we rest the pref `network.trr.confirmationNS` to `example.com`.
2. Then, `profile-change-net-teardown` notification is also sent to socket process.
3. In socket process, `mConfirmationState` is reset to `CONFIRM_TRYING`.
4. An TRR request is failed because of `profile-change-net-teardown` notification.
5. `TRRService::CompleteLookup()` is called and we hit the [assertion](https://searchfox.org/mozilla-central/rev/35b97af64a55d1d30caa4d6e9fabc1a7fbabc509/netwerk/dns/TRRService.cpp#957) since `mConfirmer` is not created.

To fix this, I think we should call `MaybeConfirm()` when `network.trr.confirmationNS` is changed.
 I hit an assertion on [try](https://treeherder.mozilla.org/#/jobs?repo=try&revision=0b16002f855bc7c5296cb238af76a0d1d30d20f3&selectedTaskRun=LMs4mHTUSsO0ZllfpSCs3w-0).
```
[task 2020-06-09T09:06:54.050Z] 09:06:54     INFO -  PID 1167 | Assertion failure: mConfirmer, at /builds/worker/checkouts/gecko/netwerk/dns/TRRService.cpp:978
[task 2020-06-09T09:06:54.050Z] 09:06:54     INFO -  Initializing stack-fixing for the first stack frame, this may take a while...
[task 2020-06-09T09:07:02.819Z] 09:07:02     INFO -  PID 1167 | #01: non-virtual thunk to mozilla::net::TRRService::CompleteLookup(nsHostRecord*, nsresult, mozilla::net::AddrInfo*, bool, nsTSubstring<char> const&) [netwerk/dns/TRRService.cpp:0]
[task 2020-06-09T09:07:02.819Z] 09:07:02     INFO -  PID 1167 | #02: mozilla::net::TRR::FailData(nsresult) [netwerk/dns/TRR.cpp:1273]
[task 2020-06-09T09:07:02.820Z] 09:07:02     INFO -  PID 1167 | #03: mozilla::net::TRR::OnStopRequest(nsIRequest*, nsresult) [netwerk/dns/TRR.cpp:1402]
[task 2020-06-09T09:07:02.820Z] 09:07:02     INFO -  PID 1167 | #04: mozilla::net::TRRServiceChannel::OnStopRequest(nsIRequest*, nsresult) [netwerk/protocol/http/TRRServiceChannel.cpp:1186]
[task 2020-06-09T09:07:02.822Z] 09:07:02     INFO -  PID 1167 | #05: non-virtual thunk to mozilla::net::TRRServiceChannel::OnStopRequest(nsIRequest*, nsresult) [netwerk/protocol/http/TRRServiceChannel.cpp:0]
[task 2020-06-09T09:07:02.822Z] 09:07:02     INFO -  PID 1167 | #06: nsInputStreamPump::OnStateStop() [netwerk/base/nsInputStreamPump.cpp:687]
[task 2020-06-09T09:07:02.823Z] 09:07:02     INFO -  PID 1167 | #07: nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*) [netwerk/base/nsInputStreamPump.cpp:443]
[task 2020-06-09T09:07:02.823Z] 09:07:02     INFO -  PID 1167 | #08: non-virtual thunk to nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*) [netwerk/base/nsInputStreamPump.cpp:0]
```
The detail of this assertion is described below.
1. `test_trr.js` is finished, so we reset the pref `network.trr.confirmationNS` to `example.com`.
2. Then, `profile-change-net-teardown` notification is also sent to socket process.
3. In socket process, `mConfirmationState` is reset to `CONFIRM_TRYING`.
4. An TRR request is failed because of `profile-change-net-teardown` notification.
5. `TRRService::CompleteLookup()` is called and we hit the [assertion](https://searchfox.org/mozilla-central/rev/35b97af64a55d1d30caa4d6e9fabc1a7fbabc509/netwerk/dns/TRRService.cpp#957) since `mConfirmer` is not created.

To fix this, I think we should call `MaybeConfirm()` when `network.trr.confirmationNS` is changed.

Back to Bug 1637648 Comment 4