Closed Bug 1699375 Opened 4 years ago Closed 4 years ago

Stack traces are not printed in all cases one would expect they would

Categories

(Core :: mozglue, defect)

defect

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(4 files)

No description provided.
Blocks: 1515229

It requires including <windows.h>, preventing the inclusion of StackWalk.h
from some places (and upcoming changes will make StackWalk.h included in
more places).

and use them in MozFormatCodeAddress.

A long standing issue is that MOZ_ASSERT and related don't print stack
traces in debug builds when they're directly or indirectly emitted from
non-libxul code. Moving WalkTheStack to mozglue alleviates the problem.

It's also not printing stack traces when emitted from C code (and for
some C third party libraries, we do redirect assert to MOZ_ASSERT),
which we solve by making the corresponding API available without C++
(which WalkTheStack being a static method of the nsTraceRefCnt class
didn't allow, or the use of a closure on Android).

This requires some adjustements to headers that indirectly assume that
Assertions.h includes ErrorList.h through nsError.h through nscore.h
through nsTraceRefcnt.h.

We also remove TestStackCrawl.cpp because it hasn't been built since
bug 158528, 19 years ago.

Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/71bc75cbf173 Move MozStackWalkThread to a separate header. r=gerald https://hg.mozilla.org/integration/autoland/rev/7ed2beea85d5 Add {Vs,S}printLiteral-like functions for buffers of arbitrary size. r=nika https://hg.mozilla.org/integration/autoland/rev/210889846202 Make MozFormatCodeAddress* return the printed size, and use that instead of strlen. r=nika https://hg.mozilla.org/integration/autoland/rev/37042c0c6cd4 Move WalkTheStack to mozglue. r=nika
Regressions: 1700885
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: