Skip to content

Segmentation Fault .ReadFrom #276

Description

@danijelk00

Your environment.

  • Version: github.com/pion/mdns/v2 v2.1.0, golang.org/x/net v0.54.0
  • OS: Windows (MSYS2/UCRT64)
  • Go version: (built with C:/msys64/ucrt64/lib/go)
  • Other Information: Long-running WebRTC video stream; crash occurs after several hours of uptime. Full stack trace attached below.

What did you do?

Created a WebRTC video stream using pion. The service ran normally for several hours (goroutine 1 shows ~1354 minutes in select). Under sustained load (~48,000 active goroutines), the process eventually crashed with a fatal signal.

What did you expect?

The mDNS read loop to continue running indefinitely without crashing.

What happened?

After several hours, the process crashed with a segmentation fault inside runtime.(*pinner).unpin while the mDNS read loop was processing a UDP packet via Windows IOCP:

unexpected fault address 0x1c31ea4008
fatal error: fault
[signal 0xc0000005 code=0x0 addr=0x1c31ea4008 pc=0x7ff79e7a32df]

goroutine 48341 [running]:
runtime.(*pinner).unpin(0x1c31ea4000)
        pinner.go:116
runtime.(*Pinner).Unpin(0x16de321fe248)
        pinner.go:87
internal/poll.(*FD).execIO.deferwrap1()
        fd_windows.go:256
internal/poll.(*FD).execIO(...)
        fd_windows.go:332
internal/poll.(*FD).ReadFromInet4(...)
        fd_windows.go:773
net.(*UDPConn).readFrom(...)
golang.org/x/net/ipv4.(*payloadHandler).ReadFrom(...)
        ipv4/payload_nocmsg.go:19
github.com/pion/mdns/v2.(*Conn).readLoop(...)
        conn.go:929
github.com/pion/mdns/v2.(*Conn).start.func2()
        conn.go:1211

Question: Is there a known mitigation or fix for this? Has anyone reproduced this on Windows with long-running mDNS connections?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions