Comments (4)
知道原因了。GlobalData::RegisterService写的就有问题
from apollo.
多线程调用RegisterService的时候,如果service填的还是同一个,出现踩内存的场景,虽然service_id_map_是线程安全的,但是只是Get和Set接口线程安全,在通过Get拿到name后,这个name填的是二级指针,所以name本身就是service_id_map_的value,另一个线程可能会再去修改这个value,造成Get出来的name 会有多线程同时读写的风险,用我上面贴的代码去复现,基本必现。
from apollo.
Will check and feedback soon. I tested it and it will indeed report an error.
from apollo.
Will check and feedback soon. I tested it and it will indeed report an error.
修改方案:
uint64_t GlobalData::RegisterService(const std::string& service) {
auto id = Hash(service);
std::lock_guard<std::mutex> lock(service_id_map_mutex_);
while (service_id_map_.Has(id)) {
std::string* name = nullptr;
service_id_map_.Get(id, &name);
if (service == *name) {
break;
}
++id;
AWARN << "Service name hash collision: " << service << " <=> " << *name;
}
service_id_map_.Set(id, service);
return id;
}
from apollo.
Related Issues (20)
- Apollo9.0 build fail in ORIN,libnvdla_runtime.so,libnvdla_complier.so notfound HOT 1
- too slowly and can't finish compiling project for arm target by using qemu in x86 ubuntu
- 自动泊车时车头无法停入停车位
- I want to change the speed of vehicle in dreamview+. I change the value in the planning.conf and compile but invalid. What wrong??? Thanks!!! HOT 2
- Build the cyber RT errors
- [planning] calculation of cost in gridded_path_time_graph.cc
- How to import my track? I have a .csv file. I want the car to follow my trajectory in Apollo. How to do? Thanks! HOT 8
- Is there GPS and IMU data available for testing localisation modules? I believe they were available at some point of time, but now i cannot find it. HOT 5
- dreamviewer 以前一直都可以用 今天开机后启动失败了 HOT 3
- lidar点云延时阻塞,设别时间戳对不上系统时间 HOT 1
- Unable to launch planning and send routing point from workspace terminal
- Apollo9.0使用华测GCI-430惯导为何使用驱动运行后只有原始数据的节点正常,其他输出节点的FrameRatio很低 HOT 8
- Awesome apollo Q&A
- Apollo9.0编译报错 HOT 2
- Avoiding Lane Closeness in Curved Path Generation
- What is the difference between GetRoadWidth and GetLaneWidth in reference_line.cc? HOT 1
- apollo9.0 运行camera_detection_single_stage报Eigen对齐错误
- A kind reminder: shell-command-injection-from-environment in gen.js
- 请问,这类codeql的提示值得处理吗?
- modules/perception/camera_detection_bev/detector/petr/bev_obstacle_detector.h中的k_data
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 apollo.