Closed Bug 948718 Opened 8 years ago Closed 8 years ago
_linux _stack .py in-process inside mochitest and reftest
Because fix-linux-stack.pl is written in perl, we now have to do all kinds of brittle ugliness to call it outside of the main mochitest/reftest harness (see e.g. bug 924253). We should port it to python and just use the routines directly there.
In case it is useful, here's my crude porting of fix_macosx_stack.py to work on Linux instead. It works when I last tested it, but I won't claim it is any good beyond that.
(I had some problem with the Perl script and decided it was easiest to port over the OSX Python script than figure out Perl.)
Let's put the porting work in bug 914253 and the in-process bits here.
William, now that |fix-linux-stack.pl| has been ported to Python do you have any specific requirements for an API for usage inside mochitest and reftest? Currently I believe it just reads from stdin, outputs to stdout, and stores a bunch of global state probably leaving a bunch of addr2line processes open. We'll probably want to encapsulate that inside an actual class that can be cleaned up. I'm assuming you just want something like: class StackFixer: def fixSymbols(self, line): """Attempts to fix the symbols in the given line, returns the converted line"""
Summary: Port fix-linux-stack.pl to python and use in-process inside mochitest and reftest → Use fix_linux_stack.py in-process inside mochitest and reftest
Yes, I can't remember if we need context of previous lines to decode the stack? If not, a simple python function would suffice, no need to bother with a class.
(In reply to William Lachance (:wlach) from comment #5) > Yes, I can't remember if we need context of previous lines to decode the > stack? If not, a simple python function would suffice, no need to bother > with a class. The context doesn't matter, just one line at a time is fine. Unfortunately the class is needed for performance reasons -- we maintain a mapping of known frames so that we can avoid having to pipe out to addr2line. Additionally addr2line is kept running for the duration of conversions (my understanding is it takes a _long_ time to launch addr2line and load libxul).
Whatever you do, it would be nice if this script and fix_stack_using_bpsyms wound up with the same interface so we could swap them seamlessly: http://mxr.mozilla.org/mozilla-central/source/tools/rb/fix_stack_using_bpsyms.py
A way to call in from another script will be a big help for bug 1044709.
Comment on attachment 8345619 [details] fix_linux_stack.py This attachment is obsolete now that fix_linux_stack.py has landed.
Attachment #8345619 - Attachment is obsolete: true
I ended up fixing this as part of bug 1050601.
Status: NEW → RESOLVED
Closed: 8 years ago
No longer depends on: 1050601
Resolution: --- → DUPLICATE
Duplicate of bug: 1050601
You need to log in before you can comment on or make changes to this bug.