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)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: alan.yenlin.huang, Assigned: alan.yenlin.huang)

References

Details

Attachments

(2 files)

Attached file ps-grep.txt —
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.
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.
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.
Hi Dave, Can you help to review this patch on tools/fix_b2g_stack.py? Many thanks.
Assignee: nobody → ahuang
Status: NEW → ASSIGNED
Attachment #798422 - Flags: review?(dhylands)
Blocks: 908610
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 ?
(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 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+
Hello Dave, I did a pull request. Please help to merge it, thanks :) https://github.com/mozilla-b2g/B2G/pull/272
Attachment #798422 - Attachment description: bug-910847-fix.patch → Make self._addr2line_procs class-static
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.

Attachment

General

Creator:
Created:
Updated:
Size: