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
某些情况下导致死锁问题(感谢 冯立夫) #7
Comments
https://github.com/Chuyu-Team/YY-Thunks/releases/tag/v1.0.3-Beta1 已经修复此问题,YY-Thunks将预加载所有try_get函数。 |
是不是只需要确保 kernel32 加载即可 |
解决这个死锁缺少只要加载kernel32 即可。但是在其他场景加载DLL时这任然可能出现其他死锁。 以最坏情况,也只是跟原始行为一样而已。在没有更好的解决方案之前,性能 以及 死锁风险里我选择避免死锁风险。 |
死锁场景:
从这个感觉是不是把 try_get_module 枷锁即可
|
感觉问题的根源在于 Dynamic-Link库最佳做法 以及 https://www.zhihu.com/question/22720399/answer/22401573 |
你是认真的吗? |
最佳实践?我们只能从中选择现在没有遇到问题的路……
|
因为遇到问题了,我有个c++测试程序在win7下,在load pdh.DLL 和 shell32.dll的时候直接蹦了
微软不是有delay laod 机制吗 那个也是在调用的时候才加载的吧, CRT 我看用的是 get module handle 对于 ntdll 和 kernel32,其它的 我至少调试的时候没发现 dllmain 里面有 load dll, |
ucrt 是通过__acrt_eagerly_load_locale_apis 来解决锁的问题,并且在 DllMain里面并没有加载任何库
|
麻烦你调试一下 |
@lygstate
最后我并不是说现在YY-Thunks这样做是合理的,我也不是说你说的没有道理,主要问题在于,延迟加载同样也是不合理的…… 嗯,大致就这样吧。如果YY-Thunks遇到崩溃等问题可以再提Bug。 |
Vsitual Studio 2017 + Windows XP模式 + MT
运行环境:Windows 7 x64
死锁场景:
线程A:Thread创建回调 -->DLL Load锁定 --> tdp初始化 --> 等待locale锁
线程B:locale锁定 --> _Atexit --> EncodePointer(YY-Thunks) --> 等待 DLL Load锁
The text was updated successfully, but these errors were encountered: