Skip to content

fix: 修复 curl 测速异常输出导致的段错误 - #385

Merged
ccmywish merged 2 commits into
RubyMetric:devfrom
JIAFALSEDREAM:fix/cargo-speed-measure-crash
Sep 1, 2026
Merged

fix: 修复 curl 测速异常输出导致的段错误#385
ccmywish merged 2 commits into
RubyMetric:devfrom
JIAFALSEDREAM:fix/cargo-speed-measure-crash

Conversation

@JIAFALSEDREAM

@JIAFALSEDREAM JIAFALSEDREAM commented Sep 1, 2026

Copy link
Copy Markdown

问题

测速遇到 curl 异常输出时会发生段错误:

- 中国科学技术大学开源软件镜像 ... 442.00 Byte/s | HTTP码 403
- 重庆大学开源软件镜像站 ... Segmentation fault

xy_strcat() 声明了 3 个参数,实际只传入 2 个,导致读取无效指针。

修复

将该处改为 xy_2strcat()。修复后异常输出会被正常提示,测速可继续进行:

- 中国科学技术大学开源软件镜像 ... 442.00 Byte/s | HTTP码 403
- 重庆大学开源软件镜像站 ... 错误 curl 输出: 000

Fixes #386

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Hi @JIAFALSEDREAM

❤️ 感谢你的贡献!我们将在最少半小时,最多5天内阅读此 PR 并回复你

@JIAFALSEDREAM
JIAFALSEDREAM force-pushed the fix/cargo-speed-measure-crash branch from a5d1c8e to d9c85ac Compare September 1, 2026 04:07
@JIAFALSEDREAM

Copy link
Copy Markdown
Author

已按建议将改动收敛为 xy_strcat(3, msg, curl_buf)xy_2strcat(msg, curl_buf),并重新通过 make testjust test 和真实 Cargo 测速。

@JIAFALSEDREAM JIAFALSEDREAM changed the title fix: 修复测速无响应导致的崩溃与错误选源 fix: 修复 curl 测速异常输出导致的段错误 Sep 1, 2026
@ccmywish

ccmywish commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@JIAFALSEDREAM

最后可参考文档内容: 第一次贡献者

chsrc-main.c 中注册你的贡献者信息,然后在你这次 PR 相关的文件(source.c)的文件头加入你的 @name 就行了(按贡献时间顺序,放在 @Mikachu2333 下面)

@ccmywish ccmywish added this to the v0.2.8 milestone Sep 1, 2026
@JIAFALSEDREAM
JIAFALSEDREAM force-pushed the fix/cargo-speed-measure-crash branch from c151522 to d9c85ac Compare September 1, 2026 05:19
@ccmywish
ccmywish merged commit 1d55f85 into RubyMetric:dev Sep 1, 2026
@ccmywish

ccmywish commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

👍👍👍

@JIAFALSEDREAM 欢迎成为贡献者!Happy Changing source~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants