-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix core caused by concurrent use of non-thread-safe gethostbyname #1611
Conversation
core/common/MachineInfoUtil.cpp
Outdated
#endif | ||
if (i == 0) { | ||
firstIp = tmp; | ||
#if defined(__linux__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
宏的嵌套比之前复杂了很多,感觉还是之前linux windows整体分开更清晰些,虽然会多一些外围的循环。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1、windows是怎么测试的
2、这个问题自己是否能复现,并发是怎么测试的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- windows目前没有测试,会记一个todo等windows那边能编译后再测试
- yitao的机器在特定输入下有大概率复现,lingzhu之前的dns core问题目前看也是这个导致的,两个场景可以复现。代码修复后多次运行没有再出现core。
commit c8385ca Author: henryzhx8 <zhhxjack8@aliyun.com> Date: Fri Jul 19 09:42:31 2024 +0800 fix core caused by concurrent use of non-thread-safe gethostbyname (alibaba#1611) * fix core caused by concurrent use of non-thread-safe gethostbyname commit 8fc252e Author: Qiu Fengshuo <alph000@163.com> Date: Thu Jul 18 09:42:06 2024 +0800 speedup CI UT job (alibaba#1606) * Split the original UT CI job into two separate jobs: one with SPL and one without SPL * fix: change design. Build .a and .so at the same CI UT job * fix * fix * fix * fix * fix * fix * fix
…1611) * fix core caused by concurrent use of non-thread-safe gethostbyname
…1611) * fix core caused by concurrent use of non-thread-safe gethostbyname
排查下来大概率是由于定时检查ip变没变时调用的非可重入版本gethostbyname,与同步发送时curl使用的gethostbyname函数发生了data race。