[GH-ISSUE #27] panic: runtime error: invalid memory address or nil pointer dereference #6

Closed
opened 2026-10-13 21:02:08 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @0xinf0 on GitHub (Apr 16, 2024).
Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-go/issues/27

When I try to run the TCP code, after setting the port with this command the code crashes:
wg set wg1 listen-port 443

~/code/git-copy/amneziawg-go# ./amneziawg-go -f wg1
┌──────────────────────────────────────────────────────┐
│ │
│ Running wireguard-go is not required because this │
│ kernel has first class support for WireGuard. For │
│ information on installing the kernel module, │
│ please visit: │
│ https://www.wireguard.com/install/ │
│ │
└──────────────────────────────────────────────────────┘
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x631a26]

goroutine 71 [running]:
github.com/amnezia-vpn/amneziawg-go/conn.(*StdNetEndpoint).DstToString(...)
/root/code/git-copy/amneziawg-go/conn/bind_std.go:119
github.com/amnezia-vpn/amneziawg-go/conn.(*StdNetBindTcp).initTcp(0xc0000883c0)
/root/code/git-copy/amneziawg-go/conn/bind_std_tcp.go:147 +0x26
github.com/amnezia-vpn/amneziawg-go/conn.(*StdNetBindTcp).getConnInternal(0xc0000883c0)
/root/code/git-copy/amneziawg-go/conn/bind_std_tcp.go:198 +0x25
github.com/amnezia-vpn/amneziawg-go/conn.(*StdNetBindTcp).getConn(0xc0000883c0)
/root/code/git-copy/amneziawg-go/conn/bind_std_tcp.go:189 +0x85
github.com/amnezia-vpn/amneziawg-go/conn.(*StdNetBindTcp).Open.(*StdNetBindTcp).makeReceiveFunc.func1({0xc000012240, 0x1, 0xc0003b3d00?}, {0xc0000141f0, 0x1, 0x0?}, {0xc000028300?, 0xc0003b3d88?, 0x416768?})
/root/code/git-copy/amneziawg-go/conn/bind_std_tcp.go:222 +0xb8
github.com/amnezia-vpn/amneziawg-go/device.(*Device).RoutineReceiveIncoming(0xc000004300, 0x1, 0xc0000282d0)
/root/code/git-copy/amneziawg-go/device/receive.go:114 +0x3ab
created by github.com/amnezia-vpn/amneziawg-go/device.(*Device).BindUpdate in goroutine 70
/root/code/git-copy/amneziawg-go/device/device.go:567 +0x3ba

Originally created by @0xinf0 on GitHub (Apr 16, 2024). Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-go/issues/27 When I try to run the TCP code, after setting the port with this command the code crashes: wg set wg1 listen-port 443 ~/code/git-copy/amneziawg-go# ./amneziawg-go -f wg1 ┌──────────────────────────────────────────────────────┐ │ │ │ Running wireguard-go is not required because this │ │ kernel has first class support for WireGuard. For │ │ information on installing the kernel module, │ │ please visit: │ │ https://www.wireguard.com/install/ │ │ │ └──────────────────────────────────────────────────────┘ panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x631a26] goroutine 71 [running]: github.com/amnezia-vpn/amneziawg-go/conn.(*StdNetEndpoint).DstToString(...) /root/code/git-copy/amneziawg-go/conn/bind_std.go:119 github.com/amnezia-vpn/amneziawg-go/conn.(*StdNetBindTcp).initTcp(0xc0000883c0) /root/code/git-copy/amneziawg-go/conn/bind_std_tcp.go:147 +0x26 github.com/amnezia-vpn/amneziawg-go/conn.(*StdNetBindTcp).getConnInternal(0xc0000883c0) /root/code/git-copy/amneziawg-go/conn/bind_std_tcp.go:198 +0x25 github.com/amnezia-vpn/amneziawg-go/conn.(*StdNetBindTcp).getConn(0xc0000883c0) /root/code/git-copy/amneziawg-go/conn/bind_std_tcp.go:189 +0x85 github.com/amnezia-vpn/amneziawg-go/conn.(*StdNetBindTcp).Open.(*StdNetBindTcp).makeReceiveFunc.func1({0xc000012240, 0x1, 0xc0003b3d00?}, {0xc0000141f0, 0x1, 0x0?}, {0xc000028300?, 0xc0003b3d88?, 0x416768?}) /root/code/git-copy/amneziawg-go/conn/bind_std_tcp.go:222 +0xb8 github.com/amnezia-vpn/amneziawg-go/device.(*Device).RoutineReceiveIncoming(0xc000004300, 0x1, 0xc0000282d0) /root/code/git-copy/amneziawg-go/device/receive.go:114 +0x3ab created by github.com/amnezia-vpn/amneziawg-go/device.(*Device).BindUpdate in goroutine 70 /root/code/git-copy/amneziawg-go/device/device.go:567 +0x3ba
Author
Owner

@pokamest commented on GitHub (May 21, 2024):

It's still in active development

<!-- gh-comment-id:2122859697 --> @pokamest commented on GitHub (May 21, 2024): It's still in active development
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amneziawg-go#6
No description provided.