Skip to content

invalid memory address or nil pointer dereference #2987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 of 5 tasks
jinhill opened this issue May 14, 2025 · 0 comments
Open
4 of 5 tasks

invalid memory address or nil pointer dereference #2987

jinhill opened this issue May 14, 2025 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@jinhill
Copy link

jinhill commented May 14, 2025

Operating system

Windows

System version

10.0.22631.5262

Installation type

Original sing-box Command Line

If you are using a graphical client, please provide the version of the client.

No response

Version

sing-box version 1.12.0-beta.13

Environment: go1.24.3 windows/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_acme,with_clash_api,with_tailscale
Revision: 1c36072120b8ac3bae395844d89c92457936236b
CGO: disabled

Description

runtime error: invalid memory address or nil pointer dereference

Reproduction

+0800 2025-05-14 15:45:43 �[36mINFO�[0m network: updated default interface WLAN, index 12
+0800 2025-05-14 15:45:44 �[36mINFO�[0m inbound/tun[0]: started at tun0
+0800 2025-05-14 15:45:44 �[36mINFO�[0m inbound/mixed[1]: tcp server started at 0.0.0.0:1080
+0800 2025-05-14 15:45:45 �[36mINFO�[0m [�[38;5;81m833037121�[0m 0ms] inbound/tun[0]: inbound packet connection from [fd00:172:18::1]:54845
+0800 2025-05-14 15:45:45 �[36mINFO�[0m [�[38;5;81m833037121�[0m 10ms] inbound/tun[0]: inbound packet connection to [xx::2]:53
+0800 2025-05-14 15:45:45 �[36mINFO�[0m [�[38;5;81m833037121�[0m 32ms] outbound/vless[xxx]: outbound connection to 8.8.8.8:443
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0xb31ea6]

goroutine 90 [running]:
github.com/sagernet/sing-box/common/dialer.NewDefault.setMarkWrapper.func15({0xc00033037c, 0x4}, {0xc000330380, 0xc}, {0x1c087f0, 0xc0002060d8})
github.com/sagernet/sing-box/common/dialer/default.go:215 +0xc6
github.com/sagernet/sing-box/common/dialer.NewDefault.Append.func16({0xc00033037c, 0x4}, {0xc000330380, 0xc}, {0x1c087f0, 0xc0002060d8})
github.com/sagernet/[email protected]/common/control/interface.go:22 +0x77
net.(*sysDialer).dialUDP.func1({0xc0003c1140?, 0x1918ab3?}, {0xc00033037c?, 0x1be4338?}, {0xc000330380?, 0x640725?}, {0x1c087f0?, 0xc0002060d8?})
net/udpsock_posix.go:209 +0x43
net.(*netFD).dial(0xc0001cd408, {0x1c0b818, 0xc00041c540}, {0x1c10fc8, 0x0}, {0x1c10fc8, 0xc0003c1140}, 0xc00053ac08)
net/sock_posix.go:102 +0x290
net.socket({0x1c0b818, 0xc00041c540}, {0x1918ab3, 0x3}, 0x2, 0x2, 0x0?, 0x0, {0x1c10fc8, 0x0}, ...)
net/sock_posix.go:70 +0x2af
net.internetSocket({0x1c0b818, 0xc00041c540}, {0x1918ab3, 0x3}, {0x1c10fc8, 0x0}, {0x1c10fc8?, 0xc0003c1140?}, 0x2, 0x0, ...)
net/ipsock_posix.go:167 +0x1e5
net.(*sysDialer).dialUDP(0x612ad9?, {0x1c0b818?, 0xc00041c540?}, 0x16152c0?, 0xc00053acc0?)
net/udpsock_posix.go:212 +0xa7
net.(*sysDialer).dialSingle(0xc0000ea000, {0x1c0b818, 0xc00041c540}, {0x1bfe4d8, 0xc0003c1140})
net/dial.go:725 +0x28b
net.(*sysDialer).dialSerial(0xc0000ea000, {0x1c0b818, 0xc00041c540}, {0xc0000265f0?, 0x1, 0xc0003c10e0?})
net/dial.go:686 +0x24e
net.(*sysDialer).dialParallel(0x0?, {0x1c0b818?, 0xc00041c540?}, {0xc0000265f0?, 0xc00041c540?, 0x1919275?}, {0x0?, 0x1918ab3?, 0xc00033035a?})
net/dial.go:587 +0x3a7
net.(*Dialer).DialContext(0xc0000a9d38, {0x1c0b770, 0xc0003c0f60}, {0x1918ab3, 0x3}, {0xc000330350, 0xc})
net/dial.go:578 +0x6ac
github.com/sagernet/sing-box/common/dialer.(*DefaultDialer).DialContext.func1()
github.com/sagernet/sing-box/common/dialer/default.go:230 +0x1df
github.com/sagernet/sing-box/common/listener.ListenNetworkNamespace[...]({0x0?, 0x0?}, 0xc00053b498?)
github.com/sagernet/sing-box/common/listener/listener.go:167 +0x16e
github.com/sagernet/sing-box/common/dialer.(*DefaultDialer).DialContext(0xc0000a9c08, {0x1c0b770, 0xc0003c0f60}, {0x1918ab3, 0x3}, {{{0x0, 0xffffdf050505}, {0xc000008060}}, 0x35, {0x0, ...}})
github.com/sagernet/sing-box/common/dialer/default.go:226 +0x31c
github.com/sagernet/sing-box/common/dialer.(*resolveDialer).DialContext(0xc00017e780, {0x1c0b770, 0xc0003c0f60}, {0x1918ab3, 0x3}, {{{0x0, 0xffffdf050505}, {0xc000008060}}, 0x35, {0x0, ...}})
github.com/sagernet/sing-box/common/dialer/resolve.go:100 +0x33d
github.com/sagernet/sing-box/protocol/direct.(*Outbound).DialContext(0xc00017e840, {0x1c0b818?, 0xc00041c460?}, {0x1918ab3, 0x3}, {{{0x0, 0xffffdf050505}, {0xc000008060}}, 0x35, {0x0, ...}})
github.com/sagernet/sing-box/protocol/direct/outbound.go:115 +0x4c5
github.com/sagernet/sing-box/common/dialer.(*DetourDialer).DialContext(0xc0003f37d8?, {0x1c0b818, 0xc00041c460}, {0x1918ab3, 0x3}, {{{0x0, 0xffffdf050505}, {0xc000008060}}, 0x35, {0x0, ...}})
github.com/sagernet/sing-box/common/dialer/detour.go:71 +0x8f
github.com/sagernet/sing-box/dns/transport.(*UDPTransport).open(0xc0001b8620, {0x1c0b818, 0xc00041c460})
github.com/sagernet/sing-box/dns/transport/udp.go:160 +0x16d
github.com/sagernet/sing-box/dns/transport.(*UDPTransport).exchange(0xc0001b8620, {0x1c0b818, 0xc00041c460}, 0xc0000ae2d0)
github.com/sagernet/sing-box/dns/transport/udp.go:100 +0x5f
github.com/sagernet/sing-box/dns/transport.(*UDPTransport).Exchange(0xc0001b8620, {0x1c0b818, 0xc00041c460}, 0xc0000ae2d0)
github.com/sagernet/sing-box/dns/transport/udp.go:88 +0x2b
github.com/sagernet/sing-box/dns.(*Client).Exchange(0xc000103260, {0x1c0b7a8, 0xc000226aa0}, {0x1c11588, 0xc0001b8620}, 0xc0003f3de8?, {{0x1c11588, 0xc0001b8620}, 0x1, 0x0, ...}, ...)
github.com/sagernet/sing-box/dns/client.go:150 +0x81a
github.com/sagernet/sing-box/dns.(*Client).lookupToExchange(0xc000103260, {0x1c0b7a8, 0xc000226aa0}, {0x1c11588, 0xc0001b8620}, {0xc000330310, 0xd}, 0x1c, {{0x1c11588, 0xc0001b8620}, ...}, ...)
github.com/sagernet/sing-box/dns/client.go:406 +0x25e
github.com/sagernet/sing-box/dns.(*Client).Lookup.func2({0x1c0b7a8?, 0xc000226aa0?})
github.com/sagernet/sing-box/dns/client.go:273 +0x85
github.com/sagernet/sing/common/task.(*Group).Run.func1()
github.com/sagernet/[email protected]/common/task/task.go:83 +0x107
created by github.com/sagernet/sing/common/task.(*Group).Run in goroutine 88
github.com/sagernet/[email protected]/common/task/task.go:67 +0x115

Logs

Supporter

Integrity requirements

  • I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
  • I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
  • I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.
@nekohasekai nekohasekai added the bug Something isn't working label May 23, 2025
@nekohasekai nekohasekai added this to the 1.12 Next milestone May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants