Closed Bug 1136841 Opened 5 years ago Closed 4 years ago

crashing gtests do not print a stack trace in the log

Categories

(Testing :: General, defect)

x86
macOS
defect
Not set

Tracking

(firefox46 fixed)

RESOLVED FIXED
mozilla46
Tracking Status
firefox46 --- fixed

People

(Reporter: ehsan, Assigned: chmanchester)

References

Details

Attachments

(1 file)

The first problem (which only happens on Windows) is that with GTEST_HAS_SEH defined, the gtest framework eats the crash and happily continues running the rest of the tests!!!  See <https://treeherder.mozilla.org/#/jobs?repo=try&revision=3703d3deac4b> for a demonstration of what that looks like.

But the more important issue is that even with that disabled manually as in <https://treeherder.mozilla.org/#/jobs?repo=try&revision=d06c3dd490ac>, we just crash and do not attempt to print a stack trace.
Blocks: 1126295
Stupid question: is the MOZ_CRASHREPORTER env variable set to 1 on the Windows gtest runs?
Should be, it gets run in make check here:
https://dxr.mozilla.org/mozilla-central/source/testing/gtest/Makefile.in#34

and rungtests.py sets it here:
https://dxr.mozilla.org/mozilla-central/source/testing/gtest/rungtests.py#73

Maybe there's something goofy about the way gtest runs tests on Windows, or this test in particular?
Yeah, it could be something that gtest is doing which is conflicting with our crash reporter, such as calling SetUnhandledExceptionFilter and clobbering our handler...
We have code (that I think you wrote) to prevent that:
https://hg.mozilla.org/mozilla-central/annotate/008b3f65a7e0/toolkit/crashreporter/nsExceptionHandler.cpp#l1311

...but that doesn't mean something isn't going wrong. I haven't had a chance to actually try reproducing this locally though.
I have patches that will fix this once gtests land in the test package.
Assignee: nobody → cmanchester
Attachment #8704949 - Flags: review?(ahalberstadt)
Comment on attachment 8704949 [details]
MozReview Request: Bug 1136841 - Fix rungtests.py to check for crashes in the correct directory. r=ahal

https://reviewboard.mozilla.org/r/29819/#review26689

::: testing/gtest/rungtests.py:56
(Diff revision 1)
> -        if mozcrash.check_for_crashes(os.getcwd(), symbols_path, test_name="gtest"):
> +        if mozcrash.check_for_crashes(cwd, symbols_path, test_name="gtest"):

If cwd is None, this will raise an AttributeError:
https://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozcrash/mozcrash/mozcrash.py#186

Should probably have some sort of fallback.
https://reviewboard.mozilla.org/r/29819/#review26689

> If cwd is None, this will raise an AttributeError:
> https://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozcrash/mozcrash/mozcrash.py#186
> 
> Should probably have some sort of fallback.

Or possibly make cwd a mandatory parameter.
https://reviewboard.mozilla.org/r/29819/#review26689

> Or possibly make cwd a mandatory parameter.

The option parser provides a default, so I'll just make it mandatory.
Attachment #8704949 - Flags: review?(ahalberstadt)
Comment on attachment 8704949 [details]
MozReview Request: Bug 1136841 - Fix rungtests.py to check for crashes in the correct directory. r=ahal

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/29819/diff/1-2/
Comment on attachment 8704949 [details]
MozReview Request: Bug 1136841 - Fix rungtests.py to check for crashes in the correct directory. r=ahal

https://reviewboard.mozilla.org/r/29819/#review26725

Thanks.
Attachment #8704949 - Flags: review?(ahalberstadt) → review+
https://hg.mozilla.org/mozilla-central/rev/c2b1901fba11
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in before you can comment on or make changes to this bug.