apache / apache/brpc

gdb_bthread_stack.py not work.

Open
#2,674 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
17.6k
Forks
4.1k
Avg merge
2d 12h
Merged PRs (30d)
69

Description

**Describe the bug (描述bug)**
使用gdb查看bthread报错

```
(gdb) source /home/user/brpc/tools/gdb_bthread_stack.py
(gdb) bthread_begin
Active bthreads: 3, will display 3 bthreads
Python Exception No type "ResourcePool" within class or namespace "butil".:
Error occurred in Python: No type "ResourcePool" within class or namespace "butil".
(gdb) bthread_num
3
```

**To Reproduce (复现方法)**
编译example下的echo_c++/echo_server
执行echo_server
sudo gdb -p {pid}
然后如上面代码所示,加载gdb_bthread_stack.py,执行bthread_begin

**Expected behavior (期望行为)**
能够进入bthread debug mode

**Versions (各种版本)**
OS: ubuntu 20.04
Compiler: clang8
brpc: 1.8.0
protobuf: 3.15.8

**Additional context/screenshots (更多上下文/截图)**

Contributor guide

Open the contributing guide

Research direction

Start with tools/gdb_bthread_stack.py and reproduce the reported failure by running echo_c++/echo_server, attaching gdb, sourcing the script, and executing bthread_begin. Investigate the missing butil::ResourcePool type reported by gdb. Done means bthread_begin enters bthread debug mode without the Python exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.