Skip to content

bug: Using PkarrPublisher on the macOS platform in release mode causes a segmentation fault #3353

Open
@zormit

Description

@zormit

Describe the bug

The segfault described in #2844 came up again. Given it was fixed in v0.31.0, I would assume it's new instance of the same problem.

The bug only appears in Rust version 1.85 and larger. It only appears in a non-debug build (setting debug=true makes the problem disappear).

Relevant Logs

I didn't yet create a nice minimal example as the previous bug author. I am producing as part of our project, ethersync. For example the current main:

% rust-lldb ../target/release/ethersync
<...snip...>
(lldb) type category enable Rust
(lldb) target create "../target/release/ethersync"
Current executable set to 'target/release/ethersync' (x86_64).
(lldb) run share
Process 19359 launched: 'target/release/ethersync' (x86_64)
...
Process 19359 stopped
* thread #11, name = 'tokio-runtime-worker', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
    frame #0: 0x000000010067707d ethersync`_$LT$simple_dns..dns..rdata..RData$u20$as$u20$simple_dns..dns..wire_format..WireFormat$GT$::parse_after_check::h7b3eb1a098c6668c + 5405
ethersync`_$LT$simple_dns..dns..rdata..RData$u20$as$u20$simple_dns..dns..wire_format..WireFormat$GT$::parse_after_check::h7b3eb1a098c6668c:
->  0x10067707d <+5405>: movaps -0xc8(%rbp), %xmm0
    0x100677084 <+5412>: movaps -0xb8(%rbp), %xmm1
    0x10067708b <+5419>: movaps -0xa8(%rbp), %xmm2
    0x100677092 <+5426>: movaps %xmm0, 0x40(%rdi)
Target 0: (ethersync) stopped.
(lldb) bt
* thread #11, name = 'tokio-runtime-worker', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
  * frame #0: 0x000000010067707d ethersync`_$LT$simple_dns..dns..rdata..RData$u20$as$u20$simple_dns..dns..wire_format..WireFormat$GT$::parse_after_check::h7b3eb1a098c6668c + 5405
    frame #1: 0x00000001006650da ethersync`_$LT$simple_dns..dns..resource_record..ResourceRecord$u20$as$u20$simple_dns..dns..wire_format..WireFormat$GT$::parse_after_check::h2ce3f8587cf8e2e9 + 330
    frame #2: 0x000000010066ac27 ethersync`simple_dns::dns::packet::Packet::parse_section::he496fd603b66ba0a + 215
    frame #3: 0x000000010066a407 ethersync`simple_dns::dns::packet::Packet::parse::h5770048e7073e337 + 679
    frame #4: 0x0000000100659ee3 ethersync`pkarr::signed_packet::SignedPacket::new::hba03dca34a66db24 + 14371
    frame #5: 0x0000000100656640 ethersync`pkarr::signed_packet::SignedPacketBuilder::sign::h057089b83fc64839 + 80
    frame #6: 0x00000001006565de ethersync`pkarr::signed_packet::SignedPacketBuilder::build::hdc07b6cecbf5e0f4 + 14
    frame #7: 0x0000000100624d57 ethersync`iroh_relay::node_info::NodeInfo::to_pkarr_signed_packet::hcd6e3e8ebd82499e + 1991
    frame #8: 0x00000001002a313b ethersync`_$LT$tracing..instrument..Instrumented$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::he66ca4f258cda682 + 2219
    frame #9: 0x000000010037483e 
(lldb)

Expected behavior

Don't segfault.

Platform(s)
Desktop:

  • OS: macOS
  • OS Version: 15.5 (24F74)
  • Processor: x86_64
  • Rust Version 1.85 (it doesn't appear with 1.84!)
  • iroh-base v0.35.0
  • pkarr v3.7.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions