Skip to content
New issue

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

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

Already on GitHub? # to your account

BUG: race condition in go routines #1579

Open
knownasmobin opened this issue Jan 7, 2025 · 0 comments
Open

BUG: race condition in go routines #1579

knownasmobin opened this issue Jan 7, 2025 · 0 comments

Comments

@knownasmobin
Copy link

knownasmobin commented Jan 7, 2025

Describe the problem

Expected behavior:

shouldn't happen anyway

Actual behavior:

stop working and restart the profile then core stop working anyway

How to reproduce

I'm facing this issue on version 4.0.1. just starting a profile

log

Starting profile [Hysteria2] hysteria2-443
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x50 pc=0x6548e3]
goroutine 162 [running]:
github.com/sagernet/sing-dns.(*dnsConnection).Write(0xc0006b1878?, {0xc00003e240?, 0x21?, 0x40?})
:1 +0x23
github.com/sagernet/sing-dns.(*UDPTransport).WriteMessage(0xc0004681a0, {0x15b7eb0, 0xc0006a8460}, 0xc0000ca5a0)
github.com/sagernet/sing-dns@v0.2.3/transport_udp.go:97 +0x18d
github.com/sagernet/sing-dns.(*myTransportAdapter).exchange(0xc0004681a0, {0x15adc10, 0xc00029e330}, 0xc0006a8460, 0xc000418090)
github.com/sagernet/sing-dns@v0.2.3/transport_base.go:155 +0x29b
github.com/sagernet/sing-dns.(*myTransportAdapter).Exchange(0xc0004681a0, {0x15adc10, 0xc00029e330}, 0xc000418090)
github.com/sagernet/sing-dns@v0.2.3/transport_base.go:134 +0xb7
github.com/sagernet/sing-dns.(*UDPTransport).Exchange(0xc0004681a0, {0x15adc10, 0xc00029e330}, 0xc000418090)
github.com/sagernet/sing-dns@v0.2.3/transport_udp.go:56 +0x2d
github.com/sagernet/sing-dns.(*Client).ExchangeWithResponseCheck(0xc00045a3c0, {0x15adc48, 0xc000694190}, {0x15b53b0, 0xc0004681a0}, 0xc000418090, 0x1, 0x0)
github.com/sagernet/sing-dns@v0.2.3/client.go:152 +0x92f
github.com/sagernet/sing-dns.(*Client).Exchange(...)
github.com/sagernet/sing-dns@v0.2.3/client.go:84
github.com/sagernet/sing-dns.(*Client).lookupToExchange(0xc00045a3c0, {0x15adc48, 0xc000694190}, {0x15b53b0, 0xc0004681a0}, {0xc000680110, 0xf}, 0x1, 0x1, 0x0)
github.com/sagernet/sing-dns@v0.2.3/client.go:585 +0x2f3
github.com/sagernet/sing-dns.(*Client).LookupWithResponseCheck.func1({0x15adc48?, 0xc000694190?})
github.com/sagernet/sing-dns@v0.2.3/client.go:224 +0x5a
github.com/sagernet/sing/common/task.(*Group).RunContextList.func1()
github.com/sagernet/sing@v0.4.3/common/task/task.go:91 +0x107
created by github.com/sagernet/sing/common/task.(*Group).RunContextList in goroutine 38
github.com/sagernet/sing@v0.4.3/common/task/task.go:75 +0x198
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x28 pc=0x654423]
goroutine 194 [running]:
github.com/sagernet/sing-dns.(*dnsConnection).Read(0x201?, {0xc0002a4800?, 0xc0002a4800?, 0xce6c78?})
:1 +0x23
github.com/sagernet/sing/common/buf.(*Buffer).ReadOnceFrom(0xc0003803c0, {0x25af9e0e3c0?, 0xc0006a8460?})
github.com/sagernet/sing@v0.4.3/common/buf/buffer.go:136 +0x63
github.com/sagernet/sing-dns.(*UDPTransport).ReadMessage(0x0?, {0x15b7eb0, 0xc0006a8460})
github.com/sagernet/sing-dns@v0.2.3/transport_udp.go:74 +0xa5
github.com/sagernet/sing-dns.(*myTransportAdapter).recvLoop.func1({0x0?, 0x0?})
github.com/sagernet/sing-dns@v0.2.3/transport_base.go:92 +0x46
github.com/sagernet/sing/common/task.(*Group).RunContextList.func1()
github.com/sagernet/sing@v0.4.3/common/task/task.go:91 +0x107
created by github.com/sagernet/sing/common/task.(*Group).RunContextList in goroutine 125
github.com/sagernet/sing@v0.4.3/common/task/task.go:75 +0x198
[Error] Core exits too frequently, stop automatic restart this profile.
Stopping profile [Hysteria2] hysteria2-443
Try to start the config, but the core has not listened to the grpc port, so restart it...

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant