Closed Bug 1194532 Opened 9 years ago Closed 9 years ago

[Aries] Phone is hot after being on for ~2 days, mdnsd is at 45% CPU constantly


(Firefox OS Graveyard :: Performance, defect)

Gonk (Firefox OS)
Not set


(tracking-b2g:+, b2g-master fixed)

FxOS-S6 (04Sep)
tracking-b2g +
Tracking Status
b2g-master --- fixed


(Reporter: hobinjk, Assigned: cyu)




(2 files)

Attached file sample-top-output.txt
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:43.0) Gecko/20100101 Firefox/43.0
Build ID: 20150813030208

Steps to reproduce:

Used phone for two days, mostly for calls, texting, and internet browsing

Actual results:

Phone began to be constantly hot, with /system/bin/mdnsd listed as the likely culprit with its constant use of 45-50% CPU

Expected results:

mdnsd should not take over the phone's processor, more generally the phone should be a normal temperature.
I can confirm this on my aries running ver2.5 

git commit gaia
2015-08-14 18:55 

build indentifier
its not there right after reboot. I don't know how to reproduce it.

does anybody know, which "app" invokes mdnsd?
I think you encounter
We need to fix the buggy mdnsd.
See Also: → 1175387
(In reply to Cervantes Yu [:cyu] [:cervantes] from comment #3)
> I think you encounter
We saw this on one aries-kk device and it's the same problem.
> We need to fix the buggy mdnsd.
I think I can place a check to the FD before it's added to the FDSet for select(). I'll work on a quick fix for this.
Assignee: nobody → cyu
Not sure if this is related: bug 1172383
See Also: → 1172383
tracking-b2g: --- → +
Component: General → Performance
On the phone that observes a CPU spin we observe that mdnsd leaks file descriptors. The leak results from:

* assert(close(socket)) that is omitted on a release build, and
* the lack of fclose() to a open file.

The leaks are fixed on mdnsresponder for lollipop. We need to upgrade mdnsresponder to the lollipop branch.
I'll dogfood the lollipop version of mdnsd to see if it fixes the CPU spin. If it's fixed then I'll update the repo manifest to upgrade mdnsresponder.
mdnsd works well so far. The device is still coll given that I switched wifi networks and turned on/off tethering, which trigger the FD leak.
Comment on attachment 8653242 [details] [review]
Upgrade mdnsd to fix several FD leaks that causes CPU spin

I wonder if Android suffers from the same problem. Does it shut off mdnsd?
Attachment #8653242 - Flags: review?(mwu) → review+
(In reply to Michael Wu [:mwu] from comment #11)
> Comment on attachment 8653242 [details] [review]
> Upgrade mdnsd to fix several FD leaks that causes CPU spin
> I wonder if Android suffers from the same problem. Does it shut off mdnsd?

Yes, at least xiaomi suffers the problem. openwrt also has this problem. A search of "mdnsd battery drain" returns a lot of reports. I don't think it shut off mdnsd.
Keywords: checkin-needed
See Also: → 1194049
Closed: 9 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S6 (04Sep)
Naoki, will this change be installed with OTA, or we need to find another way have it installed to the dogfood devides?
Flags: needinfo?(nhirata.bugzilla)
I don't think this change will be in OTA.
We need a way to FOTA.
Blocks: 1200271
FOTA pushed to internal users.
Flags: needinfo?(nhirata.bugzilla)
You need to log in before you can comment on or make changes to this bug.