Skip to content
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

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/[email protected]/transport_udp.go:97 +0x18d
github.com/sagernet/sing-dns.(*myTransportAdapter).exchange(0xc0004681a0, {0x15adc10, 0xc00029e330}, 0xc0006a8460, 0xc000418090)
github.com/sagernet/[email protected]/transport_base.go:155 +0x29b
github.com/sagernet/sing-dns.(*myTransportAdapter).Exchange(0xc0004681a0, {0x15adc10, 0xc00029e330}, 0xc000418090)
github.com/sagernet/[email protected]/transport_base.go:134 +0xb7
github.com/sagernet/sing-dns.(*UDPTransport).Exchange(0xc0004681a0, {0x15adc10, 0xc00029e330}, 0xc000418090)
github.com/sagernet/[email protected]/transport_udp.go:56 +0x2d
github.com/sagernet/sing-dns.(*Client).ExchangeWithResponseCheck(0xc00045a3c0, {0x15adc48, 0xc000694190}, {0x15b53b0, 0xc0004681a0}, 0xc000418090, 0x1, 0x0)
github.com/sagernet/[email protected]/client.go:152 +0x92f
github.com/sagernet/sing-dns.(*Client).Exchange(...)
github.com/sagernet/[email protected]/client.go:84
github.com/sagernet/sing-dns.(*Client).lookupToExchange(0xc00045a3c0, {0x15adc48, 0xc000694190}, {0x15b53b0, 0xc0004681a0}, {0xc000680110, 0xf}, 0x1, 0x1, 0x0)
github.com/sagernet/[email protected]/client.go:585 +0x2f3
github.com/sagernet/sing-dns.(*Client).LookupWithResponseCheck.func1({0x15adc48?, 0xc000694190?})
github.com/sagernet/[email protected]/client.go:224 +0x5a
github.com/sagernet/sing/common/task.(*Group).RunContextList.func1()
github.com/sagernet/[email protected]/common/task/task.go:91 +0x107
created by github.com/sagernet/sing/common/task.(*Group).RunContextList in goroutine 38
github.com/sagernet/[email protected]/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/[email protected]/common/buf/buffer.go:136 +0x63
github.com/sagernet/sing-dns.(*UDPTransport).ReadMessage(0x0?, {0x15b7eb0, 0xc0006a8460})
github.com/sagernet/[email protected]/transport_udp.go:74 +0xa5
github.com/sagernet/sing-dns.(*myTransportAdapter).recvLoop.func1({0x0?, 0x0?})
github.com/sagernet/[email protected]/transport_base.go:92 +0x46
github.com/sagernet/sing/common/task.(*Group).RunContextList.func1()
github.com/sagernet/[email protected]/common/task/task.go:91 +0x107
created by github.com/sagernet/sing/common/task.(*Group).RunContextList in goroutine 125
github.com/sagernet/[email protected]/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...

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

No branches or pull requests

1 participant