Skip to content
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

多執行序下asio::io_service出現 讀取存取違規 #6

Open
york8817612 opened this issue Jun 13, 2021 · 4 comments
Open

多執行序下asio::io_service出現 讀取存取違規 #6

york8817612 opened this issue Jun 13, 2021 · 4 comments

Comments

@york8817612
Copy link

環境:
Windows 10 Build 21390.co_release.210521-1658
Visual Studio Community 2019 version 16.9.3

將專案升級到VS2019版本,解決編譯時缺少boost lib x64版本後
遇到在Debug Build模式下所有的Server
在執行下面這段時會出現讀取存取違規
std::thread tCenterWorkThread([&] { asio::io_service::work work(*m_pCenterServerService); std::error_code ec; m_pCenterServerService->run(ec); // 這裡出錯 }); tCenterWorkThread.detach();
已嘗試替換boost::thread,但是一樣有問題

@tnsc4502
Copy link
Owner

tnsc4502 commented Aug 7, 2021

可能要檢查下m_pCenterServerService是不是nullptr或者指向一些異常地址?

@york8817612
Copy link
Author

我再看看,因為不是每次都會出現,上次是更動封包標頭時出現的,還有新增新的標頭。

@york8817612
Copy link
Author

york8817612 commented Aug 8, 2021

剛剛確定指向到異常地址了

@tnsc4502
Copy link
Owner

缺少的boost跟asio套件在Library資料夾裡面有附,可能要試試看是不是版本不同的關係?
另外也可以試試看用Release模式跑是不是正常。

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

No branches or pull requests

2 participants