URLPattern latent x86 shippable gtest crash
Categories
(Core :: Networking, defect, P2)
Tracking
()
People
(Reporter: edgul, Unassigned)
Details
(Whiteboard: [necko-triaged])
During development of Bug 1948330 (see also: bug 1731418 and bug 1948295) one of the WIP patches introduced a gtest which directly called urlp_get_protocol_component()
rust-defined function from c++ bindings (cbindgen-generated). This invocation would crash when we attempt to clone the q_pattern.protocol in the following (rust) code on x86 (32 bit) PGO/LTO builds:
#[no_mangle]
pub unsafe extern "C" fn urlp_get_protocol_component(
pattern: UrlpPattern,
res: *mut UrlpComponent,
) {
let q_pattern = &*(pattern.0 as *const Uq::UrlPattern);
let tmp: UrlpComponent = q_pattern.protocol.clone().into();
*res = tmp;
}
This crash magically goes away when we replace the direct call to urlp_get_protocol_component()
to use our c++ defined convenience getter UrlpGetProtocol
, which uses the same rust function in the implementation. (scenario 1)
It is also suspected that the crash disappears by changing the c++ getter UrlpGetProtocol
to pass UrlpPattern
by-value instead of by-reference, but we are having trouble reliably reproducing the crash. (scenario 2). Note that in this scenario we have continued to use the rust-defined getting directly in the test.
So the current working hypothesis is that this is a compiler bug in either/or PGO or LTO 32 bit builds.
But also seen on try in followup builds (with Linux 24.04 x86 Shippable gtest-1proc
manually added to the suite): https://treeherder.mozilla.org/jobs?repo=try&revision=4062e451a048b7d558c07df537e1b994b4e4531e&selectedTaskRun=J05_NjMxSHSNrhUogWKFdg.0
I've also created some additional test builds (currently still running) to try to narrow down PGO or LTO:
- control (should experience crash): https://treeherder.mozilla.org/jobs?repo=try&revision=9cdb28c01c3d5ab6e96ec482b392695976fc9559
- profile build: https://treeherder.mozilla.org/jobs?repo=try&landoCommitID=138900
- LTO build: https://treeherder.mozilla.org/jobs?repo=try&landoCommitID=138902
Description
•