iroh icon indicating copy to clipboard operation
iroh copied to clipboard

Using PkarrPublisher on the macOS platform in release mode causes a segmentation fault.

Open zh522130 opened this issue 1 year ago • 0 comments

Environment:

  • Operating System: macOS
  • Architecture: x64_64
  • Rust Version: 1.82.0 (This probably doesn't matter, as the issue existed before the upgrade)

How to reproduce?

Use .discovery_n0() in Endpoint::builder() for any iroh-net example, and run the example in release mode on macOS.

Commenting out the following code in discovery_n0 avoids the segmentation fault:

self.discovery.push(Box::new(|secret_key| {
    Some(Box::new(PkarrPublisher::n0_dns(secret_key.clone())))
}));

Log

Log information when a segmentation fault occurs while running with lldb:

Process 14835 stopped
* thread #15, name = 'tokio-runtime-worker', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
    frame #0: 0x000000010091c30f listen`_$LT$simple_dns..dns..rdata..RData$u20$as$u20$simple_dns..dns..packet_part..PacketPart$GT$::parse::hf633f606481706d4 at macros.rs:172:13 [opt]
   169                  TYPE::Unknown(rdatatype) => RData::NULL(rdatatype, NULL::parse(data, position)?),
   170              };
   171 
-> 172              Ok(rdata)
   173          }
   174 
   175 
Target 0: (listen) stopped.
warning: listen was compiled with optimization - stepping may behave oddly; variables may not be available.

zh522130 avatar Oct 28 '24 01:10 zh522130