Skip to content
Keegan McAllister edited this page Jul 24, 2013 · 2 revisions

Source information

If you build Servo with make RUSTFLAGS="-Z debug-info" then the binaries will include source line information. So for example you can do

objdump -Srd build/src/components/script/libscript-*.so

and see the assembly interleaved with Rust source from the script crate.

I think ./configure --enable-debug is supposed to provide the same info but doesn't, yet.

To see the rustc command lines, use make VERBOSE=1.

Debugging memory management failures

Some notes from kmc:

Valgrind was fairly useful; I ran it like

valgrind --num-callers=50 --log-file=results/$N/valgrind.out --suppressions=../../notes/valgrind.suppression ./servo ../src/test/html/about-mozilla.html

The suppressions file is here; it just excludes things from i965_dri.so, and not very well.

Also you can edit src/compiler/rust/src/rt/memory_region.h and set RUSTRT_TRACK_ALLOCATIONS to 3 and then run with DETAILED_LEAKS=1, and also probably apply this commit and the previous one. Then when free goes wrong, it will print a backtrace of where that object was allocated, assuming you're talking about things allocated by the Rust RT.

Alas I didn't find that information to be very useful; it's easy enough to guess where something was allocated, anyway, but hard to figure out where we failed to increment a refcount or something.