Closed Bug 1750209 Opened 3 years ago Closed 3 years ago

Assertion in nsHostResolver::CompleteLookupLocked when steering and TRR mode 2.5 is used

Categories

(Core :: Networking: DNS, defect, P2)

defect

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: dragana, Assigned: valentin)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

I also filed bug 1750154 for this.

Assignee: nobody → valentin.gosu

I think the problem here is that the return value of NativeLookup or TrrLookup is ignored. MaybeRetryTRRLookup should not return true when it didn't retry anything.
FWIW, I have a WIP patch below.

diff --git a/netwerk/dns/nsHostResolver.cpp b/netwerk/dns/nsHostResolver.cpp
index c8da615b8660..781ab7d846b5 100644
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -1323,8 +1323,7 @@ bool nsHostResolver::MaybeRetryTRRLookup(
   MOZ_ASSERT(!aAddrRec->mResolving);
   if (!StaticPrefs::network_trr_strict_native_fallback()) {
     LOG(("nsHostResolver::MaybeRetryTRRLookup retrying with native"));
-    NativeLookup(aAddrRec, aLock);
-    return true;
+    return NS_SUCCEEDED(NativeLookup(aAddrRec, aLock));
   }
 
   if (aFirstAttemptSkipReason == TRRSkippedReason::TRR_NXDOMAIN ||
@@ -1334,8 +1333,7 @@ bool nsHostResolver::MaybeRetryTRRLookup(
         ("nsHostResolver::MaybeRetryTRRLookup retrying with native in strict "
          "mode, skip reason was %d",
          static_cast<uint32_t>(aFirstAttemptSkipReason)));
-    NativeLookup(aAddrRec, aLock);
-    return true;
+    return NS_SUCCEEDED(NativeLookup(aAddrRec, aLock));
   }
 
   if (aAddrRec->mTrrAttempts > 1) {
@@ -1354,9 +1352,13 @@ bool nsHostResolver::MaybeRetryTRRLookup(
     auto trrQuery = aAddrRec->mTRRQuery.Lock();
     trrQuery.ref() = nullptr;
   }
-  aAddrRec->NotifyRetryingTrr();
-  TrrLookup(aAddrRec, aLock, nullptr /* pushedTRR */);
-  return true;
+
+  if (NS_SUCCEEDED(TrrLookup(aAddrRec, aLock, nullptr /* pushedTRR */))) {
+    aAddrRec->NotifyRetryingTrr();
+    return true;
+  }
+
+  return false;
 }
 
 //
Pushed by valentin.gosu@gmail.com: https://hg.mozilla.org/integration/autoland/rev/6ee30c962971 Check return values in MaybeRetryTRRLookup r=necko-reviewers,kershaw
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: