gpt4 book ai didi

gcc - 线程清理器报告数据竞争时如何添加断点?

转载 作者:行者123 更新时间:2023-12-02 16:28:40 28 4
gpt4 key购买 nike

address sanitizers也有类似的问题,但是对于thread sanitizers,它不起作用,我试图打破__sanitizer_print_stack_trace,它也不起作用。

最佳答案

  1. 在GDB下运行程序,在exit_exit上设置断点。在 Linux 上,还设置 catch syscall exit_group
  2. TSAN_OPTIONS 中设置 halt_on_error=1 以请求线程清理程序 exit on first error :
(gdb) set env TSAN_OPTIONS=halt_on_error=1
(gdb) run
... error should be reported and one of the breakpoints should fire.
  1. 利润。

附言当遇到断点时,使用 GDB where 命令查看错误是如何报告的。在可能在堆栈上的某种 __tsan_report_error 上设置断点即使不设置 halt_on_error 也可能会起作用。

关于gcc - 线程清理器报告数据竞争时如何添加断点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63964739/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com