Closed Bug 435122 Opened 16 years ago Closed 16 years ago

Use TraceMalloc to get stack traces of potential deadlocks

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bent.mozilla, Assigned: bent.mozilla)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Patch, v1 (obsolete) — Splinter Review
This patch makes it possible to see the full stack trace for both locks implicated in a potential deadlock warning. You have to --enable-trace-malloc in order for this to all work, and then you have to run the resulting stacks through dbaron's fix-<myOS>-stack.pl script found in mozilla/tools/rb.

Thanks to dbaron and brendan this code was ready to go. It just needed to get hooked up.
Attachment #322025 - Flags: review?(benjamin)
Attachment #322025 - Flags: review?(benjamin) → review?(ted.mielczarek)
The nsAutoLock changes look fine to me.  But I wonder why you needed to add FORCE_STATIC_LIB to trace-malloc -- that makes trace-malloc hacking a good bit harder, since it requires rebuilding in a whole bunch of places.
Comment on attachment 322025 [details] [diff] [review]
Patch, v1

OK, now I see what you're doing with the linker stuff -- just moving trace-malloc back into xpcom (where it used to be).  That's fine with me, though you should run it by Benjamin.

I'm still curious what's up with the changes to xpcom/tests/Makefile.in and xpcom/proxy/tests/Makefile.in, though.
Bah, those are totally unnecessary! I'll remove those pronto.
To make a clean tree able to compile, you also need to move tools/trace-malloc/lib from tier_gecko in toolkit/toolkit-tiers.mk to tier_xpcom (at some point before xpcom/build) in xpcom/build.mk .  You probably also need to test that.

It might be worth waiting to see if Benjamin's OK with the approach before doing all that, though.
(In reply to comment #4)
> you also need to move tools/trace-malloc/lib from tier_gecko in
> toolkit/toolkit-tiers.mk to tier_xpcom (at some point before xpcom/build)
> in xpcom/build.mk .

Unless I'm misunderstanding you that has already been done in this patch, and it was suggested by Benjamin.
Attached patch Patch, v1Splinter Review
Here's the same patch with the extraneous REQUIRES removed, oops.
Attachment #322025 - Attachment is obsolete: true
Attachment #322132 - Flags: review?(benjamin)
Attachment #322025 - Flags: review?(ted.mielczarek)
Attachment #322025 - Flags: review?(dbaron)
Comment on attachment 322132 [details] [diff] [review]
Patch, v1

r=dbaron, although I think the REQUIRES in xpcom/build is probably unnecessary as well
Attachment #322132 - Flags: review?(dbaron) → review+
Comment on attachment 322132 [details] [diff] [review]
Patch, v1

Does linking tracemalloc into libxul actually work!? I thought that the symbol redirection only worked correctly when the final binary linked the tracemalloc lib.
It certainly used to work fine the way this bug makes it work -- it used to be part of XPCOM until dougt took it out -- see bug 186585.
Attachment #322132 - Flags: review?(benjamin) → review+
(In reply to comment #8)
> I think the REQUIRES in xpcom/build is probably unnecessary
> as well

It is, actually. It won't compile otherwise.

Pushed to moz-central.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: