milvus-io / milvus

A cloud-native vector database, storage for next generation AI applications
https://milvus.io
Apache License 2.0
27.28k stars 2.63k forks source link

[Bug]: ParseCTraceContext may be not memory-safe #32742

Open longjiquan opened 2 weeks ago

longjiquan commented 2 weeks ago

Is there an existing issue for this?

Environment

- Milvus version:
- Deployment mode(standalone or cluster):
- MQ type(rocksmq, pulsar or kafka):    
- SDK version(e.g. pymilvus v2.0.0rc2):
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

https://github.com/milvus-io/milvus/blob/5bb672d70da60a9e88dedaec579a4ea3d6723649/internal/querynodev2/segments/trace.go#L34-L44

Expected Behavior

spanID and traceID are local variables inner ParseCTraceContext, they may be garbage collected after return their address, so it's not safe to use them in cgo code.

Steps To Reproduce

No response

Milvus Log

No response

Anything else?

No response

longjiquan commented 2 weeks ago

/unassign @yanliang567 /assign @czs007 @congqixia