While profiling with WebRender enabled on a debug build, multiple of the following assertions occur:
[Parent 5439, Renderer] ###!!! ASSERTION: nsTDependentString must wrap only null-terminated strings. You are probably looking for nsTDependentSubstring.: 'this->mData[substring_type::mLength] == 0', file /home/barret/Workspace/src/hg.mozilla.org/mozilla-central/obj-x86_64-pc-linux-gnu/dist/include/nsTString.h, line 456
- Build a debug build of Firefox.
- Enable Web Render.
- Start profiling with the Gecko Profiler.
We should not be hitting this assertion.
After some investigation, this occurs because
<GeckoProfilerHooks as ProfilerHooks>::add_text_marker in the WebRender bindings accepts a
&str and passes its pointer and length to
gecko_profiler_add_text_marker, which constructs a
nsTDependentString. However, Rust strings are not NUL-terminated.