firefly icon indicating copy to clipboard operation
firefly copied to clipboard

term_to_binary/1 and binary_to_term/1 cannot round trip always

Open KronicDeth opened this issue 5 years ago • 1 comments

As seen in https://cirrus-ci.com/task/5041448550662144 and other test runs, otp::erlang::term_to_binary_1::test::roundtrips_through_binary_to_term sometimes fails. For this specific failure it was shrunk to

thread 'otp::erlang::term_to_binary_1::test::roundtrips_through_binary_to_term' panicked at 'called `Result::unwrap()` on an `Err` value: Fail(Reason("assertion failed: `(left == right)` \n  left: `Ok(Box(0x7f66849fa090, literal=false, value=Term(Boxed<liblumen_alloc::erts::term::tuple::Tuple>(Tuple(Term(#PID<0.15629.8176>), Box(0x7f66849fa078, literal=false, value=Term(Boxed<liblumen_alloc::erts::term::pid::ExternalPid>(ExternalPid { header: Header<liblumen_alloc::erts::term::pid::ExternalPid>(0b111000000000000000000000000000000000000000000000010), arc_node: Node { id: 2752935265332143140, name: Mutex { data: Cell { value: :\"@external\" } }, creation: 1363588961 }, pid: Pid(220293369) } at 0x7f66849fa078)))) at 0x7f66849fa090))))`,\n right: `Ok(Box(0x7f66849fa018, literal=false, value=Term(Boxed<liblumen_alloc::erts::term::tuple::Tuple>(Tuple(Term(#PID<0.15629.8176>), Box(0x7f66849fa000, literal=false, value=Term(Boxed<liblumen_alloc::erts::term::pid::ExternalPid>(ExternalPid { header: Header<liblumen_alloc::erts::term::pid::ExternalPid>(0b111000000000000000000000000000000000000000000000010), arc_node: Node { id: 8102711248322546474, name: Mutex { data: Cell { value: :\"@external\" } }, creation: 3801472872 }, pid: Pid(220293369) } at 0x7f66849fa000)))) at 0x7f66849fa018))))` at lumen_runtime/src/otp/erlang/term_to_binary_1/test.rs:25"), (Pid(263518), Box(0x7f66849fa1e8, literal=false, value=Term(Boxed<liblumen_alloc::erts::term::tuple::Tuple>(Tuple(Term(#PID<0.15629.8176>), Box(0x7f66849fa1d0, literal=false, value=Term(Boxed<liblumen_alloc::erts::term::pid::ExternalPid>(ExternalPid { header: Header<liblumen_alloc::erts::term::pid::ExternalPid>(0b111000000000000000000000000000000000000000000000010), arc_node: Node { id: 8102711248322546474, name: Mutex { data: Cell { value: :"@external" } }, creation: 3801472872 }, pid: Pid(220293369) } at 0x7f66849fa1d0)))) at 0x7f66849fa1e8)))))', src/libcore/result.rs:1188:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

Reformatting for clarity:

assertion failed: `(left == right)`

left:

Ok(Box(0x7f66849fa090, literal=false, value=Term(Boxed<liblumen_alloc::erts::term::tuple::Tuple>(Tuple(Term(#PID<0.15629.8176>), Box(0x7f66849fa078, literal=false, value=Term(Boxed<liblumen_alloc::erts::term::pid::ExternalPid>(ExternalPid { header: Header<liblumen_alloc::erts::term::pid::ExternalPid>(0b111000000000000000000000000000000000000000000000010), arc_node: Node { id: 2752935265332143140, name: Mutex { data: Cell { value: :\"@external\" } }, creation: 1363588961 }, pid: Pid(220293369) } at 0x7f66849fa078)))) at 0x7f66849fa090))))

right:

Ok(Box(0x7f66849fa018, literal=false, value=Term(Boxed<liblumen_alloc::erts::term::tuple::Tuple>(Tuple(Term(#PID<0.15629.8176>), Box(0x7f66849fa000, literal=false, value=Term(Boxed<liblumen_alloc::erts::term::pid::ExternalPid>(ExternalPid { header: Header<liblumen_alloc::erts::term::pid::ExternalPid>(0b111000000000000000000000000000000000000000000000010), arc_node: Node { id: 8102711248322546474, name: Mutex { data: Cell { value: :\"@external\" } }, creation: 3801472872 }, pid: Pid(220293369) } at 0x7f66849fa000)))) at 0x7f66849fa018))))` at lumen_runtime/src/otp/erlang/term_to_binary_1/test.rs:25"), (Pid(263518), Box(0x7f66849fa1e8, literal=false, value=Term(Boxed<liblumen_alloc::erts::term::tuple::Tuple>(Tuple(Term(#PID<0.15629.8176>), Box(0x7f66849fa1d0, literal=false, value=Term(Boxed<liblumen_alloc::erts::term::pid::ExternalPid>(ExternalPid { header: Header<liblumen_alloc::erts::term::pid::ExternalPid>(0b111000000000000000000000000000000000000000000000010), arc_node: Node { id: 8102711248322546474, name: Mutex { data: Cell { value: :"@external" } }, creation: 3801472872 }, pid: Pid(220293369) } at 0x7f66849fa1d0)))) at 0x7f66849fa1e8)))))

KronicDeth avatar Jan 10 '20 13:01 KronicDeth

Seen in https://cirrus-ci.com/task/5255725123371008

KronicDeth avatar Jan 16 '20 13:01 KronicDeth