arvidn / libtorrent

an efficient feature complete C++ bittorrent implementation
http://libtorrent.org
Other
5.2k stars 994 forks source link

BOOST_NO_EXCEPTIONS feature not building #7725

Open XITRIX opened 1 month ago

XITRIX commented 1 month ago

Please provide the following information

libtorrent version (or branch): 2.0.10 and RC_2_0

platform/architecture: iOS/arm64 (should be the same for any platform)

compiler and compiler version: xCode 15 / 16Beta

I try to build LibTorrent with BOOST_NO_EXCEPTIONS feature enabled, but looks like the code cannot be build with it.

At least, load_torrent.cpp has std::make_shared<torrent_info>(torrent_file, cfg); function call, which does not exist if BOOST_NO_EXCEPTIONS flag is enabled

I would like to avoid C++/Boost exceptions because in Crashlytics they have no stack trace and it is impossible to understand where crash happened to fix it

Thanks in advance!

arvidn commented 4 days ago

libtorrent no longer supports building without exceptions. The support there was (many years ago by now) was still somewhat broken, where errors were simply not reported when exceptions were disabled.

If you have an unhandled exception, you definitely have the stack trace in your crash handler. The runtime detects whether the exception is handled or not before unwinding the stack.

Once you catch the exception, it's no longer a crash, but intended behavior.

XITRIX commented 4 days ago

My problem with exceptions is that in Crashlytics they reports like this

image

I've already handled a lot of exceptions when I was able to reproduce them with debugger attached to my phone, but I had to add breakpoints to the places where exceptions was going to happen, but when app was already crashed because of exception, there was no any stacktrace like in the screenshot above.

Not sure what is wrong with c++ exception stacktrace on iOS, but I'm stuck with app crashes and I have no idea where it happens to fix it.

Maybe you have any ideas or suggestions how to find the reasons of this exceptions?