AstrBot icon indicating copy to clipboard operation
AstrBot copied to clipboard

[Bug]respond.stage 响应构建阶段因工具返回结果过大导致 SIGSEGV 崩溃

Open DFGHJ43 opened this issue 5 months ago • 7 comments

What happened / 发生了什么

用户询问到一些系统相关信息后,astrbot使用工具进行检索时有几率触发 SIGSEGV (地址边界错误) 被系统终止

Reproduce / 如何复现?

用户询问本地skill时比较容易触发 “看看本地有什么skill?” “调用xxx skill看看”

AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

Astrbot版本:4.25.6 部署方式:Fedora Linux 44 配合 UV部署 使用的LLM提供商:deepseek 消息平台适配器:QQ官方适配器接口

OS

Linux

Logs / 报错日志

Image Image

Are you willing to submit a PR? / 你愿意提交 PR 吗?

  • [ ] Yes!

Code of Conduct

DFGHJ43 avatar Jun 22 '26 13:06 DFGHJ43

只在调用 grep_tool 的时候才会这样吗?可能是 python-ripgrep 库的兼容性问题。

你可以试试单独在你的系统测试一下 python-ripgrep 库能否正常使用。

Soulter avatar Jun 24 '26 14:06 Soulter

另一位网友说得对,我的系统的确没有安装ripgrep这个包,现在装上了正在测试

DFGHJ43 avatar Jun 26 '26 13:06 DFGHJ43

Image 很遗憾,补充上ripgrep后仍会触发这个bug

DFGHJ43 avatar Jun 26 '26 13:06 DFGHJ43

Image 很遗憾,补充上ripgrep后仍会触发这个bug

我的意思是,python-ripgrep 这个 python 第三方库在你的 Fedora 系统上可能有不兼容的情况。

你可以在其他python环境装一下这个库,然后测试一下 这个 库会不会引起这个问题。代码片段:

from python_ripgrep import search

# Perform a simple search, returning a
# list of string results grouped by file.
results = search(
    patterns=["pattern"],
    paths=["path/to/search"],
    globs=["*.py"],
)

# Process the results
for result in results:
    print(result)

不过我确信很大概率是这个库的兼容性问题。

我会在接下来的几个版本中修复这个问题。

Soulter avatar Jul 06 '26 15:07 Soulter

请你附带你运行时使用的python版本,我测试降级到3.13就行了。

LIghtJUNction avatar Jul 06 '26 15:07 LIghtJUNction

https://fedoraproject.org/wiki/Changes/Python3.14

LIghtJUNction avatar Jul 06 '26 15:07 LIghtJUNction

请你附带你运行时使用的python版本,我测试降级到3.13就行了。

I tested on MacOS 26.0.1 + Python 3.14 and successfully reproduced this issue. So it seems like a Python 3.14 incompatibility issue.

The root cause is python-ripgrep at version 0.0.8 uses PyO3 0.22.3, but PyO3 supports Python3.14 on 0.25.0.

The minimum reproduce gist:

uv run --no-project --isolated --python 3.14 \
  --with python-ripgrep==0.0.8 \
  python -X faulthandler -c \
  'from python_ripgrep import search; print(search(patterns=["AstrBot"], paths=["README.md"], line_number=True))'

Soulter avatar Jul 18 '26 08:07 Soulter