Closed Bug 890026 Opened 13 years ago Closed 11 years ago

add mozcrash.kill_and_get_minidump

Categories

(Testing :: Mozbase, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

(firefox42 fixed)

RESOLVED FIXED
Tracking Status
firefox42 --- fixed

People

(Reporter: ted, Assigned: chmanchester)

References

(Blocks 1 open bug)

Details

(Keywords: sheriffing-P1)

Attachments

(4 files, 1 obsolete file)

I've been trying to find a root cause for bug 874647, and I had this code laying around somewhere, so I integrated it into a new mozcrash method. It's kind of crazy and I didn't write any tests for it (because they're probably going to be a PITA), but it works.
Comment on attachment 770985 [details] [diff] [review] add mozcrash.kill_and_get_minidump Review of attachment 770985 [details] [diff] [review]: ----------------------------------------------------------------- drive-by comment on the docstring style, since that tends to be missed by other reviewers... ::: mozcrash/mozcrash/mozcrash.py @@ +231,5 @@ > + > + `pid` is the process ID to kill. > + `dump_directory` is the directory where a minidump should be written on > + Windows, where the dump will be written from outside the process. > + It would be better to use the :param: declaration here. See for example: https://github.com/mozilla/mozbase/blob/master/mozdevice/mozdevice/devicemanager.py#L188
Yeah, apparently that changed (or we just didn't know about it) since we did our doc sprint, so I was following file style. Thanks for reminding me!
Blocks: 911249
What's the status here?
Flags: needinfo?(ted)
This mostly just needs cleanup and polish. I need to make sure that it's not losing any features from the existing implementation.
Flags: needinfo?(ted)
SLightly updated. I tested that this works on Try (I have separate patches to enable its use in the xpcshell harness and Mochitest).
Blocks: 1027802
Attachment #770985 - Attachment is obsolete: true
Ed: note that as currently written this patch doesn't do anything for Android tests.
Yeah but it was my understanding that we would expand kill_and_get_minidump() later?
Here's a before[1] and after[2] for an infinite loop in content JS, and before[3] and after[4] for one of the hangs associated with bug 1032849. The former case is about the same, and the latter yields a lot more information, so if there aren't outstanding concerns with the approach I think we should take this. I'm testing a rebased patch plugged in to mochitests now and am planning to land this if everything looks ok. [1] https://treeherder.mozilla.org/logviewer.html#?job_id=8728227&repo=try [2] https://treeherder.mozilla.org/logviewer.html#?job_id=8749615&repo=try [3] https://treeherder.mozilla.org/logviewer.html#?repo=mozilla-central&job_id=1617377 [4] https://treeherder.mozilla.org/logviewer.html#?job_id=8758029&repo=try
Bug 890026 - Use kill_and_get_minidump in place of crashinject.exe in mochitest so we can stacks from more hangs.
Attachment #8625159 - Flags: review?(ted)
As much as I want to land these patches, I wrote them so I can't review them. I can't figure out how to reassign the reviews in ReviewBoard. I'm sure we can find someone else to review them, let's ask around today.
Comment on attachment 8625158 [details] MozReview Request: bug 890026 - Add mozcrash.kill_and_get_minidump bug 890026 - Add mozcrash.kill_and_get_minidump
Attachment #8625158 - Flags: review?(ted) → review?(jmathies)
https://reviewboard.mozilla.org/r/11787/#review11135 ::: testing/mozbase/mozcrash/mozcrash/mozcrash.py:376 (Diff revision 1) > + if not isinstance(file_name, unicode): I'm not sure what isinstance does so a comment here explaining what this check / change is would be useful. ::: testing/mozbase/mozcrash/mozcrash/mozcrash.py:380 (Diff revision 1) > + FILE_SHARE_READ | FILE_SHARE_WRITE, Why do we need FILE_SHARE_READ | FILE_SHARE_WRITE? ::: testing/mozbase/mozcrash/mozcrash/mozcrash.py:353 (Diff revision 1) > + def write_minidump(pid, dump_directory): Should this return a result indicating success or failure? ::: testing/mozbase/mozcrash/mozcrash/mozcrash.py:386 (Diff revision 1) > + if file_handle: success here is a value > 0, failure is INVALID_HANDLE_VALUE, which is -1. I don't think your check here tests for failure correctly.
Attachment #8625158 - Flags: review?(jmathies) → review-
https://reviewboard.mozilla.org/r/11787/#review11169 ::: testing/mozbase/mozcrash/mozcrash/mozcrash.py:353 (Diff revision 1) > + def write_minidump(pid, dump_directory): I don't think the result would be significant to any of the current callers - check_for_crashes is called after this, and will handle any minidump files we write here. ::: testing/mozbase/mozcrash/mozcrash/mozcrash.py:380 (Diff revision 1) > + FILE_SHARE_READ | FILE_SHARE_WRITE, I don't think we do.
Comment on attachment 8625158 [details] MozReview Request: bug 890026 - Add mozcrash.kill_and_get_minidump bug 890026 - Add mozcrash.kill_and_get_minidump
Attachment #8625158 - Flags: review- → review?(jmathies)
Comment on attachment 8625159 [details] MozReview Request: Bug 890026 - Use kill_and_get_minidump in place of crashinject.exe in mochitest so we can stacks from more hangs. Bug 890026 - Use kill_and_get_minidump in place of crashinject.exe in mochitest so we can stacks from more hangs.
Attachment #8625158 - Flags: review?(jmathies) → review+
Comment on attachment 8625158 [details] MozReview Request: bug 890026 - Add mozcrash.kill_and_get_minidump https://reviewboard.mozilla.org/r/11789/#review11187 Ship It!
Comment on attachment 8625159 [details] MozReview Request: Bug 890026 - Use kill_and_get_minidump in place of crashinject.exe in mochitest so we can stacks from more hangs. https://reviewboard.mozilla.org/r/11791/#review11997 Ship It!
Attachment #8625159 - Flags: review?(ted) → review+
Missing import causing problems on mac and linux.
Attachment #8635465 - Flags: review?(ahalberstadt)
Assignee: ted → cmanchester
Status: NEW → ASSIGNED
Attachment #8635465 - Flags: review?(ahalberstadt) → review+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Keywords: leave-open
Resolution: --- → FIXED
Blocks: 1193738
Blocks: 1185602
Blocks: 1311429
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: