Open Allenhe123 opened 4 years ago
The issue caused by croutine context switch. The error take place near code: CRoutine::Resume() { ... ... SwapContext(GetMainStack(), GetStack()); currentroutine = nullptr; return state_; }
any update ?
solution 1: File thirdparty/gpus/crosstools/cc_toolchain_config.bzl.tpl:357 add below 1 line: flags= [ "-g0" "-O2" + "-fPIC" "-ffunction-sections", ......................
solution 2: File thirdparty/gpus/crosstools/cc_toolchain_config.bzl.tpl:328 comment off below lines: #flag_group( # flags= ["-fPIE], # expand_if_not_available = "pic", #),
soultion 3: File toos/bazel.rc, any lines add: build --copt="fPIC" or build --cxxopt="fPIC"
all above 3 solutions can workaround this bug, but I cannot understand:
Test steps: ./apollo.sh build_opt(or build_opt_gpu) ./bazel-bin/cyber/example/listener ./bazel-bin/cyber/example/talk
listener will segmentation fault.
Can appollo guys explain the root cause with my testing?
Describe the bug cyberRT will be segment fault on ARM for compile option O1 O2 O3.
Edit file cyber.pb.conf and let default_proc_num has a value bigger than 1, for example: scheduler_conf { routine_num: 5 default_proc_num:2 }
Then run a talker listener demo, it will crash.
my code as below: using namespace std; using namespace apollo::cyber; apollo::cyber::Init(argv[0]);