Closed
Bug 910847
Opened 13 years ago
Closed 13 years ago
[DMD] fix_b2g_stack.py may cause host run out of memory
Categories
(Firefox OS Graveyard :: GonkIntegration, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: alan.yenlin.huang, Assigned: alan.yenlin.huang)
References
Details
Attachments
(2 files)
|
23.05 KB,
text/plain
|
Details | |
|
1.36 KB,
patch
|
dhylands
:
review+
|
Details | Diff | Splinter Review |
I saw host linux run out of memory while processing DMDs file pulled from partner's helix and my unagi (512MB boot.img). I observe more than 80 "arm-linux-androideabi-addr2line" processes on both hosts, and some of them consume more than 800MB.
I checked the PPID but those are not zombies. From the ps shows that many of them are process the same library.
Comment 1•13 years ago
|
||
I think the problem here is that fix_b2g_stack.py::StackFixer never kills its addr2line processes when it's done with them.
You could fix this by killing the processes, but IIRC starting one of these processes takes a nontrivial amount of time, so it would probably be better just to let the addr2line's live as long as the python script is alive and reuse them between multiple StackFixer objects.
To do this, I think you just need to make self._addr2line_procs class-static.
Comment 2•13 years ago
|
||
I have also seen this happen during the processing of DMD files that were pulled off of the B2G emulator by get_about_memory.py.
| Assignee | ||
Comment 3•13 years ago
|
||
Hi Dave,
Can you help to review this patch on tools/fix_b2g_stack.py? Many thanks.
Comment 4•13 years ago
|
||
Comment on attachment 798422 [details] [diff] [review]
Make self._addr2line_procs class-static
Review of attachment 798422 [details] [diff] [review]:
-----------------------------------------------------------------
It looks like you missed one instance of _addr2line.
Line 383 in the original source (end of the translate function) has:
return self._cache.get_maybe_set(lib_path, offset,
lambda: self._addr2line(lib, offset, pc, fn_guess))
Shouldn't self.add2line be changed to StackFixer._addr2line ?
| Assignee | ||
Comment 5•13 years ago
|
||
(In reply to Dave Hylands [:dhylands] from comment #4)
Hello Dave,
> Comment on attachment 798422 [details] [diff] [review]
> bug-910847-fix.patch
>
> Review of attachment 798422 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> It looks like you missed one instance of _addr2line.
>
> Line 383 in the original source (end of the translate function) has:
>
> return self._cache.get_maybe_set(lib_path, offset,
> lambda: self._addr2line(lib, offset, pc, fn_guess))
>
> Shouldn't self.add2line be changed to StackFixer._addr2line ?
I think our purpose here is to make _addr2line_procs static, instead of _addr2line.
_addr2line searches lib through _addr2line_procs. if it doesn't exist, then _addr2line create a new process for it. So making _addr2line_procs class-static should reuse those subprocesses between multiple StackFixer objects and fix this bug :)
Comment 6•13 years ago
|
||
Comment on attachment 798422 [details] [diff] [review]
Make self._addr2line_procs class-static
Review of attachment 798422 [details] [diff] [review]:
-----------------------------------------------------------------
I knew I had to be missing something :)
Attachment #798422 -
Flags: review?(dhylands) → review+
| Assignee | ||
Comment 7•13 years ago
|
||
Hello Dave,
I did a pull request. Please help to merge it, thanks :)
https://github.com/mozilla-b2g/B2G/pull/272
| Assignee | ||
Updated•13 years ago
|
Attachment #798422 -
Attachment description: bug-910847-fix.patch → Make self._addr2line_procs class-static
Comment 8•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Component: General → Builds
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•