Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

term_to_binary/1 and binary_to_term/1 cannot round trip always #377

@KronicDeth

Description

@KronicDeth

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)))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions