简体   繁体   中英

c++ Qt: catching a segfault from dll

I'm loading an external dll with QLibrary. In some cases the dll just crashes (seg. fault). The DLL does not throw exceptions. What is the best way to handle this? I read that I need to run in a separate process/thread. Is this the only option?

cheers, m.

Unfortunately you can't do anything with a segfault, you can try run the crashing code in a separate thread but that has the risk of leaving you with leaking resources or a massive amount of inconsistent state in your application.

If the .dll is yours I'd recommend trying to fix the segfault, if it's not report it as a bug and try work around it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM