Closed Bug 516302 Opened 10 years ago Closed 9 years ago

nsWifiMonitor::DoScan spins in a tight loop on error

Categories

(Core :: Networking, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: kinetik, Assigned: dougt)

References

()

Details

Attachments

(1 file)

If WirelessScanSplit returns an error (which happens if wifi is disabled), DoScan() spins in a tight loop until it's killed by its owner setting mKeepGoing to PR_FALSE.  This might also happen with wifi enabled if WirelessScanSplit returns a null managed_access_points, but it seems just as likely it'd return a zero sized CFArray in that case.

To test: turn off wifi via the menubar, then try to use geolocation.  The scanner thread spins using 100% CPU for 5 seconds before a timer fires and kills off the scan.
Summary: OS X version of nsWifiMonitor::DoScan spins in a tight loop on error → [10.6] nsWifiMonitor::DoScan spins in a tight loop on error
Summary: [10.6] nsWifiMonitor::DoScan spins in a tight loop on error → nsWifiMonitor::DoScan spins in a tight loop on error
Assignee: nobody → doug.turner
Attached patch patch v.1Splinter Review
Attachment #470828 - Flags: review?
Attachment #470828 - Flags: review? → review?(blassey.bugs)
Attachment #470828 - Flags: review?(blassey.bugs) → review+
Attachment #470828 - Flags: approval2.0?
risk/reward:

this basically just prevents us from busy waiting for 5s if wifi is off.  it is very safe.
Attachment #470828 - Flags: approval2.0? → approval2.0+
http://hg.mozilla.org/mozilla-central/rev/c6ca51771894
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.