Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Style::onSpriteError is apparently sometimes called with a null exception_ptr #4369

Closed
jfirebaugh opened this issue Mar 17, 2016 · 4 comments
Labels
archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl

Comments

@jfirebaugh
Copy link
Contributor

Style::onSpriteError, and probably other on*Error methods, are apparently sometimes called with a null std::exception_ptr. This conclusion is based primarily on the fact that adding a guard clause for this solved the crash in #4330.

We expect on*Error methods to be called only when there is a legitimate error to report, so something is off here and needs to be investigated.

This may also be the root cause of the mysterious crashes reported in #3280. (If so, it would be a relief to know that the cause isn't related to RTTI.)

@jfirebaugh
Copy link
Contributor Author

I'm not seeing how this is possible, unless there's a libc++ bug. Either std::make_exception_ptr would have to return a null std::exception_ptr, or std::current_exception() would, when called inside a catch block.

@jfirebaugh
Copy link
Contributor Author

Some log output from when this occurs, from #4382 (comment):

W/com.mapbox.mapboxsdk.http.HTTPRequest(14356): [HTTP] Request could not be executed: Failed to connect to /192.168.0.4:8080
W/com.mapbox.mapboxsdk.http.HTTPRequest(14356): [HTTP] Request could not be executed: Failed to connect to /192.168.0.4:8080
E/mbgl    (14356): {Map}[Setup]: loading style failed: Failed to connect to /192.168.0.4:8080
E/mbgl    (14356): {Map}[Style]: Failed to load sprite: (null)
E/mbgl    (14356): {Map}[Style]: Failed to load sprite: (null)

@jfirebaugh jfirebaugh added the Core The cross-platform C++ core, aka mbgl label Jun 14, 2016
@brunoabinader
Copy link
Member

I grabbed a similar situation while running the Android test app via simulator. Unfortunately I can't reproduce the issue anymore after upgrading my Android Studio, but I was using a x86 build running on a x86_64 simulator environment - Nexus 4 API 22 (Android 5.1.1). I got the following output when trying to open any of the activities from the test app:

com.mapbox.mapboxsdk.testapp A/libc: ../../include/mbgl/util/string.hpp:38: std::string mbgl::util::toString(std::exception_ptr): assertion "error" failed
com.mapbox.mapboxsdk.testapp A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 3038 ()

@stale stale bot added the archived Archived because of inactivity label Nov 18, 2018
@stale
Copy link

stale bot commented Nov 20, 2018

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Nov 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests

2 participants