Closed
Bug 1400380
Opened 7 years ago
Closed 7 years ago
Doesn't seem to be possible to run Talos under a debugger
Categories
(Testing :: Talos, enhancement)
Testing
Talos
Tracking
(firefox59 fixed)
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: igoldan)
References
Details
(Whiteboard: [PI:December])
Attachments
(1 file, 2 obsolete files)
"mach talos-test" doesn't support a --debugger option, as far as I can tell. How am I supposed to debug something that fails during a talos run?
Flags: needinfo?(rwood)
Flags: needinfo?(jmaher)
Comment 1•7 years ago
|
||
I see bug 1237215 for using a --jsdebugger; what debuggers would be useful? I don't think this is impossible, but there have been very few requests for this in the last 5 years- I put this in our next queue of work to consider.
Flags: needinfo?(jmaher)
Whiteboard: [PI:October]
Reporter | ||
Comment 2•7 years ago
|
||
> what debuggers would be useful?
gdb and lldb come to mind, and whatever people use on Windows.
Basically, it should work just like all our unit test suites work: you pass in a debugger string and that gets used.
Reporter | ||
Comment 3•7 years ago
|
||
Oh, and the reason I expect there have been so few requests is that even just running Talos locally is so painful, and so broken, that people printf-debug on try instead. :(
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(ionut.goldan)
Updated•7 years ago
|
Flags: needinfo?(rwood)
Updated•7 years ago
|
Assignee: nobody → igoldan
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(igoldan)
Assignee | ||
Comment 5•7 years ago
|
||
Implementation-wise: does this involve sticking gdb in the command line arguments that Talos prepares here https://dxr.mozilla.org/mozilla-central/source/testing/talos/talos/ttest.py?q=path%3Atalos+file%3Attest.py&redirect_type=single#174 before it invokes the perf test? Right before the browser path?
Flags: needinfo?(rwood)
Comment 6•7 years ago
|
||
(In reply to Ionuț Goldan [:igoldan], Performance Sheriffing from comment #5) > Implementation-wise: does this involve sticking gdb in the command line > arguments that Talos prepares here > https://dxr.mozilla.org/mozilla-central/source/testing/talos/talos/ttest. > py?q=path%3Atalos+file%3Attest.py&redirect_type=single#174 > before it invokes the perf test? > Right before the browser path? Hi Ionut, First of all I suggest you have a look at how other tests (i.e. mochitest) support debuggers (if you've already done that, awesome!). Perhaps we could have talos options for each debugger that is implemented, i.e. '--gdb', '--lldb', '--jsdebugger', etc. I did a grep for 'jsdebugger' and here's where it is implemented in mochitest [1]. I would start there and follow the code through and see how the jsdebugger is started, etc. That will hopefully give you a good idea how to mirror similar functionality in talos perhaps? Maybe also look if gdb is supported in other unit tests? When it comes time to adding debugger support to talos, you'd want it to work with ./mach talos-test for running talos and debugging locally. First step you'd have to add a talos command line option, i.e. in [2]. Then figure out where to start/stop the debugger etc, perhaps at or near the code link you asked about but I'm not sure. [1] http://searchfox.org/mozilla-central/rev/1285ae3e810e2dbf2652c49ee539e3199fcfe820/testing/mochitest/mochitest_options.py#394 [2] http://searchfox.org/mozilla-central/rev/1285ae3e810e2dbf2652c49ee539e3199fcfe820/testing/talos/talos/cmdline.py#54
Flags: needinfo?(rwood)
Reporter | ||
Comment 7•7 years ago
|
||
Note that I was trying to run with --debugger and --debugger-args, because I wanted to run under rr, not one of the built-in debugger options.
Comment 8•7 years ago
|
||
(In reply to Boris Zbarsky [:bz] (no decent commit message means r-) from comment #7) > Note that I was trying to run with --debugger and --debugger-args, because I > wanted to run under rr, not one of the built-in debugger options. Cool yes that would be ideal if talos could support those generic cmd line options for all debuggers instead of implementing one cmd line option for each debugger type.
Assignee | ||
Comment 9•7 years ago
|
||
:bz Can you please name some of the common mach subcommands you use, that have the desired CLI options? So I know precisely what kind of flow I need to integrate into Talos.
Flags: needinfo?(bzbarsky)
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 13•7 years ago
|
||
mozreview-review |
Comment on attachment 8923831 [details] Bug 1400380 - start integrating debugger https://reviewboard.mozilla.org/r/194996/#review200028 overall this looks good. A few questions: 1) what did you do to test this? 2) how can you write unittests to ensure this doesn't break? (followup bug is ok) 3) does this break anything on try, and does it work with/without debugger args via ./mach?
Attachment #8923831 -
Flags: review?(jmaher) → review+
Assignee | ||
Comment 14•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8923831 [details] Bug 1400380 - start integrating debugger https://reviewboard.mozilla.org/r/194996/#review200028 This isn't currently functional. I wanted to be sure I'm on the right track. I still need to prepare the final command line we use to run the browser. To do that, I need to understand the mozdebug lib we have.
Updated•7 years ago
|
Whiteboard: [PI:October] → [PI:November]
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 18•7 years ago
|
||
We configure subprocess.PIPE here: https://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozprocess/mozprocess/processhandler.py#742 so out threads defined here https://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozprocess/mozprocess/processhandler.py#943 can process it when they like. This messes the interaction with gdb. I am able to give commands to gdb; the Talos test complete without problems. But it feels faulty and buggy. Do you have suggestions for handling this? I will look for some options, but we need to agree on a special handling when using a debugger.
Flags: needinfo?(jmaher)
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(rwood)
Comment 19•7 years ago
|
||
(In reply to Ionuț Goldan [:igoldan], Performance Sheriffing from comment #18) > We configure subprocess.PIPE here: > https://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozprocess/ > mozprocess/processhandler.py#742 > so out threads defined here > https://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozprocess/ > mozprocess/processhandler.py#943 > can process it when they like. > This messes the interaction with gdb. > > I am able to give commands to gdb; the Talos test complete without problems. > But it feels faulty and buggy. > Do you have suggestions for handling this? I will look for some options, but > we need to agree on a special handling when using a debugger. Thanks Ionut. How do the other frameworks (like those listed in comment 10) handle/enable debuggers? Maybe there's some code there that will provide direction? Also maybe list specific issues that you are running into, that demonstrate "it feels faulty and buggy".
Flags: needinfo?(rwood)
Comment 20•7 years ago
|
||
mochitest uses --interactive on the command line: https://searchfox.org/mozilla-central/source/testing/mochitest/runtests.py#538
Flags: needinfo?(jmaher)
Assignee | ||
Comment 21•7 years ago
|
||
(In reply to Robert Wood [:rwood] from comment #19) > Thanks Ionut. How do the other frameworks (like those listed in comment 10) > handle/enable debuggers? Maybe there's some code there that will provide > direction? Also maybe list specific issues that you are running into, that > demonstrate "it feels faulty and buggy". Out of the 3 tests mentioned in comment 10, I looked over reftest; I investigate gtest's implementation too. Both of these tools at some point launch a subprocess like |gdb firefox <various arguments>|. It's plain simple as you get prompted into gdb directly and interract with it. Problem is Talos handles things very differently. Our business logic involves Talos' output be consumed by a separate thread. That thread reads the output line by line and then logs it again to the console. It acts like an intermediary. The tricky part in this equation is this: gdb is interactive, so it prompts something like: (gdb) <type command here> Until you hit Enter, the thread won't be able to consume anything. You won't see that initial (gdb) prompt, so you'll type blindly. This is the faulty behavior I was referring to.
Comment 22•7 years ago
|
||
in debugger mode we can avoid parsing the stdout- it will break some tests, but I think that is acceptable. The goal here is to debug the code while firefox is running a test- vs when firefox is collecting metrics. Another thing is we might want to skip the profile warmup when running with a debugger. another random thought- we now have 'headless' mode for firefox and we could run the profile warmup in headless mode, this would make the user experience locally much less confusing as they wouldn't see a window popup and disappear quickly.
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8923831 -
Attachment is obsolete: true
Assignee | ||
Updated•7 years ago
|
Attachment #8928533 -
Attachment is obsolete: true
Comment 24•7 years ago
|
||
mozreview-review |
Comment on attachment 8923830 [details] Bug 1400380 - run Talos with browser in debug mode https://reviewboard.mozilla.org/r/194994/#review206476 this is looking really good, thanks for working on solving the problem of debugging talos. I am sure there will be hiccups going forward. A few thoughts: 1) it would be nice if all our harnesses has a mozdebug process that we could manage the cli properly, etc. (not required for this) 2) can you outline what commands (and os + build configs) you used to test this. This will help when a developer runs into problems in the future 3) can you ensure we don't accidentally break anything on try
Attachment #8923830 -
Flags: review?(jmaher) → review+
Assignee | ||
Comment 25•7 years ago
|
||
(In reply to Joel Maher ( :jmaher) (UTC-5) from comment #24) > Comment on attachment 8923830 [details] > Bug 1400380 - run Talos with browser in debug mode > > https://reviewboard.mozilla.org/r/194994/#review206476 > > this is looking really good, thanks for working on solving the problem of > debugging talos. I am sure there will be hiccups going forward. A few > thoughts: > 1) it would be nice if all our harnesses has a mozdebug process that we > could manage the cli properly, etc. (not required for this) I don't follow. Can you elaborate on this? > 2) can you outline what commands (and os + build configs) you used to test You can get into debug mode using |mach talos-test -a <perf_test> --debugger gdb|. Assuming the default debuggers are properly configured (as mozdebug is expecting here https://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozdebug/mozdebug/mozdebug.py#27), you should also be able to run the command above with the --debug/--debug_args flags. I didn't test this yet, but I don't expect issues from this part. You get prompted into the debugger directly. I only executed 'run' under gdb, to check that Firefox runs without problems and that Talos closes properly. I tested this on Windows 10, using the gdb for this platform. > this. This will help when a developer runs into problems in the future > 3) can you ensure we don't accidentally break anything on try Before landing this, I'll do a thorough testing.
Comment 26•7 years ago
|
||
I am thinking we have mozprocess, mozprofile, etc. but each harness has custom code for managing the cli flags and setting up the debugger args- ideally we can have a common module that helps with that. I view this as unrelated to this bug. Please test all the cli flags locally and test on try to ensure no odd side effects. When you are ready for landing request checkin-needed or ping myself or :rwood online.
Updated•7 years ago
|
Whiteboard: [PI:November] → [PI:December]
Comment hidden (mozreview-request) |
Assignee | ||
Comment 28•7 years ago
|
||
I tested this thoroughly here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=5420c4afc6f27b73dc09bec17d76ec23eb607399 So far, the jobs are green, with only one orange.
Comment 29•7 years ago
|
||
Pushed by jmaher@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9137f72f3043 run Talos with browser in debug mode r=jmaher
Comment 30•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9137f72f3043
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in
before you can comment on or make changes to this bug.
Description
•