Flow id serialization mismatch between c++ and rust
Categories
(Core :: Gecko Profiler, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox163 | --- | fixed |
People
(Reporter: kats, Assigned: kats)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fxpe])
Attachments
(1 external file)
Rust code: https://searchfox.org/firefox-main/rev/4de791e9c62b308a5ab1e4464dc1fd19d8c4d13b/tools/profiler/rust-api/src/marker/flow_id.rs#34
C++ code: https://searchfox.org/firefox-main/rev/4de791e9c62b308a5ab1e4464dc1fd19d8c4d13b/mozglue/baseprofiler/public/BaseProfileJSONWriter.h#334
The C++ code says it's null-terminating the string but is actually appending a '0' character. This causes a mismatch between the flow id being serialized in C++ vs Rust. The null termination doesn't seem needed since the Span constructor the array gets passed to handles fixed-length arrays, so we should just be able to drop that and use an array of size 16.
Updated•9 days ago
|
| Assignee | ||
Comment 1•9 days ago
|
||
HexString() meant to null terminate its buffer but wrote the character '0'.
This made the flow id serialization incompatible with the Rust counterpart in
FlowId::to_hex. The null termination is unnecessary here so we can just drop
the spurious '0'.
Updated•9 days ago
|
Comment 3•9 days ago
|
||
| bugherder | ||
Description
•