Comments (4)
🤖
Thank you for providing the detailed information and the code to reproduce the issue. It's clear that you're experiencing a panic due to a data race when using the lookupIPAddr
function for DNS resolving in the Kratos microservices framework.
The error message you provided indicates a segmentation violation, which usually occurs when a program tries to read or write an illegal memory location. This could be due to a nil pointer dereference or an out-of-bounds array index.
You mentioned that you're using Kratos version v2.6.2 and Go version 1.20. The issue seems to be related to the use of the sync.Pool object pool.
To better understand and resolve this issue, could you please provide the following additional information:
- Have you tried updating to the latest version of Kratos (v2.7.1) to see if the issue persists?
- Could you provide the full stack trace of the panic? This could help identify the exact line of code causing the issue.
- Are there any specific conditions under which the panic occurs? For example, does it happen every time you run the server and start 200 threads, or only under certain conditions?
- Have you made any modifications to the Kratos or Go runtime environment that could potentially affect the behavior of the
lookupIPAddr
function or the sync.Pool object pool?
Your answers to these questions will help us better understand the issue and find a solution.
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
from kratos.
🤖
Hello @lyouthzzz,
Nice to meet you! I'm Dosu, a helpful bot designed to assist you with Kratos. While we're waiting for a human maintainer, I'm here to help solve bugs, answer questions, and guide you on how to become a contributor.
I'm currently reviewing your issue and will provide a full answer shortly. Hang tight!
from kratos.
more detail: golang/go#63927
from kratos.
@lyouthzzz I still have this problem after updating to v2.7.2.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x63f1b2]
goroutine 3315105 [running]:
net.(*Resolver).lookupIPAddr(0x3a68320, {0x2316a70?, 0xc007a505a0}, {0x1e6ff2f, 0x3}, {0xc003c8bc20, 0x26})
/opt/hostedtoolcache/go/1.19.13/x64/src/net/lookup.go:346 +0x8b2
net.(*Resolver).internetAddrList(0x2316a70?, {0x2316a70?, 0xc007a505a0?}, {0x1e6ff2f, 0x3}, {0xc003c8bc20?, 0x2b?})
/opt/hostedtoolcache/go/1.19.13/x64/src/net/ipsock.go:288 +0x67a
net.(*Resolver).resolveAddrList(0x3a9db40?, {0x2316a70, 0xc007a505a0}, {0x1e7119f, 0x4}, {0x1e6ff2f?, 0x433a90?}, {0xc003c8bc20, 0x2b}, {0x0, ...})
/opt/hostedtoolcache/go/1.19.13/x64/src/net/dial.go:222 +0x41b
net.(*Dialer).DialContext(0xc0000a22a0, {0x2316a70, 0xc007a505a0}, {0x1e6ff2f, 0x3}, {0xc003c8bc20, 0x2b})
/opt/hostedtoolcache/go/1.19.13/x64/src/net/dial.go:410 +0x448
net/http.(*Transport).dial(0x0?, {0x2316a70?, 0xc007a505a0?}, {0x1e6ff2f?, 0x0?}, {0xc003c8bc20?, 0x8?})
/opt/hostedtoolcache/go/1.19.13/x64/src/net/http/transport.go:1170 +0xda
net/http.(*Transport).dialConn(0x3a4bf40, {0x2316a70, 0xc007a505a0}, {{}, 0x0, {0xc006a357a0, 0x4}, {0xc003c8bc20, 0x2b}, 0x0})
/opt/hostedtoolcache/go/1.19.13/x64/src/net/http/transport.go:1608 +0x83f
net/http.(*Transport).dialConnFor(0xc0041347e0?, 0xc003f138c0)
/opt/hostedtoolcache/go/1.19.13/x64/src/net/http/transport.go:1450 +0xb0
created by net/http.(*Transport).queueForDial
/opt/hostedtoolcache/go/1.19.13/x64/src/net/http/transport.go:1419 +0x3f2
from kratos.
Related Issues (20)
- Request context canceled during graceful shutdown HOT 3
- [Question]How to do unit testing? HOT 5
- [Question] How to make kratos grpc transfer data larger than 4MB in size ? HOT 4
- The service startup error could not be printed correctly HOT 1
- [Question] The rules before and after loading the configuration file are inconsistent. Can they be improved? HOT 8
- How to print out all request routes, including intercepted or intercepted requests without content type HOT 3
- [Feature] Whether to consider supporting Filebeat access HOT 3
- errors had been ignore or covered when too much err happend HOT 1
- proto. When the field of the query string passed by the front end is an empty string, the field parsed by the back end is nil. HOT 3
- Add a scheduled task server, dependency injection error HOT 3
- [Question] In the parameter verification section of the middleware in the official kratos documentation, the makefile instruction "Add the validate command in the Makefile" will report an error when copied. HOT 2
- logging.Server prints a wrong caller path HOT 1
- EncodeURL will ignore some fields if request message contains repeated custom message HOT 11
- [Question] Usage about selector peer HOT 3
- [Question] Why doesn’t Consul use the official watch for monitoring? HOT 4
- [Question] http API returns json parameter name not as expected HOT 7
- In version 1.0.0, Mergo moves to a vanity URL: dario.cat/mergo. Can update to the latest version? HOT 6
- How to configure when dealing with multiple DB instances? Are there any practices?[Question] HOT 5
- [Question]Why kratos load yaml as json and unmarshal to struct HOT 1
- 使用openapiv2,出现protoc-gen-openapiv2/options/annotations.proto: File not found. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kratos.