Add refcount logging for servo_arc
Categories
(Core :: CSS Parsing and Computation, task, P3)
Tracking
()
People
(Reporter: emilio, Assigned: emilio)
References
Details
Attachments
(3 files)
Should be useful to catch silly mistakes like the nsString logging caught https://phabricator.services.mozilla.com/D31319?vs=104569&id=104702.
Though we leak some stuff "on purpose" (the UA cascade data cache may come to mind, the static arc that I added for ArcSlice::default() too) and we may need to do something that accounts for that / cleans those up.
| Assignee | ||
Comment 1•6 years ago
|
||
Hmm, the ThinArc / RawOffsetArc business may not make this exactly trivial...
| Assignee | ||
Comment 2•6 years ago
|
||
I tried this, but I quickly hit assertions about reporting different sizes for different type classes.
This is not great, because we cannot just move the refcount logging one level up everywhere, and we cannot use different names because std::intrinsics::type_name is unstable.
Nick, any idea?
| Assignee | ||
Comment 3•6 years ago
|
||
In particular this is the assertion I'm hitting (expectedly, I guess, given what I'm doing). Maybe Eric / Andrew also have ideas?
Comment 4•6 years ago
|
||
I talked to Emilio about this in IRC. Basically, your choices are to either statically generate strings for type names, which sounds like it won't really work, or just use the same size for all of the arcs. I argued that losing specific size information isn't a huge loss. If it turns out to be, some followup work can investigate improvements.
Updated•6 years ago
|
| Assignee | ||
Comment 5•6 years ago
|
||
So current try push is:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=910b474ac929e35fe64c4520adb0e09018d05dbf
Looks like we're leaking really small amount of references but consistently. So my guess is that we're leaving some Arc<> in a static or such.
Well, no wonder, here's one:
Others could be the UA data cache or what not... I guess I'll have to hack up something to see the type (probably using RUSTC_BOOTSTRAP=1 and the intrinsic thing), because otherwise this is going to be fun to chase down.
Comment 6•6 years ago
|
||
I don't know much about this bloat stuff, so I defer to mccr8's opinion.
| Assignee | ||
Comment 7•6 years ago
|
||
These allocation stacks are not very encouraging :(
allocation stack:
#00: ???[/home/emilio/src/moz/gecko-artifact/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0x6bf69ed]
#01: _$LT$servo_arc..Arc$LT$servo_arc..HeaderSlice$LT$H$C$$u20$$u5b$T$u5d$$GT$$GT$$GT$::from_header_and_iter_alloc::ha8e308758b837277[/home/emilio/src/moz/gecko-artifact/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0x127dd697]
12 @0x7f7ac0d3dc80 (0 references; 0 from COMPtrs)
allocation stack:
#00: ???[/home/emilio/src/moz/gecko-artifact/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0x6bf69ed]
#01: _$LT$servo_arc..Arc$LT$servo_arc..HeaderSlice$LT$H$C$$u20$$u5b$T$u5d$$GT$$GT$$GT$::from_header_and_iter_alloc::h1c0599374377bfe6[/home/emilio/src/moz/gecko-artifact/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0x1314f95b]
2101 @0x7f7ac0d72000 (0 references; 0 from COMPtrs)
allocation stack:
#00: ???[/home/emilio/src/moz/gecko-artifact/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0x6bf69ed]
#01: _$LT$servo_arc..Arc$LT$T$GT$$GT$::new::h83923b4cf302a259[/home/emilio/src/moz/gecko-artifact/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0x127b5ad4]
28 @0x7f7ac0d40ea0 (0 references; 0 from COMPtrs)
allocation stack:
#00: ???[/home/emilio/src/moz/gecko-artifact/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0x6bf69ed]
#01: _$LT$servo_arc..Arc$LT$T$GT$$GT$::new::hef89c649fce1be16[/home/emilio/src/moz/gecko-artifact/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0x127b6f9b]
2102 @0x7f7abf06e000 (0 references; 0 from COMPtrs)
allocation stack:
#00: ???[/home/emilio/src/moz/gecko-artifact/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0x6bf69ed]
#01: _$LT$servo_arc..Arc$LT$T$GT$$GT$::new::hfd7bda5abbd2adc8[/home/emilio/src/moz/gecko-artifact/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so +0x127b7574]
(Forget about the gecko-artifact part of the name, it's a regular debug build, just used that spare directory)
| Assignee | ||
Comment 8•6 years ago
|
||
I found most of them using rr, but I want to see if I can get proper stack traces by using RUSTFLAGS="-C force-frame-pointers=y".
| Assignee | ||
Comment 9•6 years ago
|
||
Comment 10•6 years ago
|
||
You need to run tools/rb/fix_linux_stack.py on the stack trace output to symbolicate it.
| Assignee | ||
Comment 11•6 years ago
|
||
Yeah, that helps, but the stack trace is only two frames deep unfortunately, so I don't see the interesting stuff.
Comment 12•6 years ago
|
||
Oh, sorry. I didn't notice that it was the same stack over and over again.
| Assignee | ||
Comment 13•6 years ago
|
||
| Assignee | ||
Comment 14•6 years ago
|
||
We cannot compile with just feature(gecko + debug_assertions), since that's how
debug rusttests get compiled and they don't have the refcount logging stuff.
We were getting away with it for the pre-existing usage of the style crate,
because it wasn't used during any test and presumably the linker didn't
complain. But servo_arc is definitely used in tests.
| Assignee | ||
Comment 15•6 years ago
|
||
We weren't honoring the case where the library features differ from the tests
features (situation which my previous patch does).
We were incorrectly overriding rust_feature_flags, which of course ended up
with a working rusttests with my patches, but a bunch of negative leaks :)
Name the test features differently so that they don't affect the regular library
features.
| Assignee | ||
Updated•6 years ago
|
Comment 16•6 years ago
|
||
Comment 17•6 years ago
|
||
| bugherder | ||
Updated•6 years ago
|
Comment 18•6 years ago
|
||
Updated•6 years ago
|
Comment 19•6 years ago
|
||
| bugherder | ||
| Assignee | ||
Updated•6 years ago
|
Updated•6 years ago
|
Description
•