This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Uncaught exception of type mapbox::sqlite::Exception: FOREIGN KEY constraint failed #4403
Copy link
Copy link
Closed
Description
When deleting an offline pack that is still downloading, an iOS app crashes with: libc++abi.dylib: terminating with uncaught exception of type mapbox::sqlite::Exception: FOREIGN KEY constraint failed
This is reproducible with both v3.2.0b1 and b2.
* thread #6: tid = 0xed491, 0x0000000181bc8140 libsystem_kernel.dylib`__pthread_kill + 8, name = 'DefaultFileSource', stop reason = signal SIGABRT
* frame #0: 0x0000000181bc8140 libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x0000000181c90ef8 libsystem_pthread.dylib`pthread_kill + 112
frame #2: 0x0000000181b39dac libsystem_c.dylib`abort + 140
frame #3: 0x000000018166d3f4 libc++abi.dylib`abort_message + 132
frame #4: 0x0000000181689e80 libc++abi.dylib`default_terminate_handler() + 280
frame #5: 0x0000000181694264 libobjc.A.dylib`_objc_terminate() + 152
frame #6: 0x0000000181694264 libobjc.A.dylib`_objc_terminate() + 152
frame #7: 0x0000000181686f44 libc++abi.dylib`std::__terminate(void (*)()) + 16
frame #8: 0x000000018168685c libc++abi.dylib`__cxa_throw + 136
frame #9: 0x000000010062bb04 Mapbox`mapbox::sqlite::Statement::run() + 156
frame #10: 0x00000001006253c4 Mapbox`mbgl::OfflineDatabase::markUsed(long long, mbgl::Resource const&) + 428
frame #11: 0x0000000100625540 Mapbox`mbgl::OfflineDatabase::putRegionResource(long long, mbgl::Resource const&, mbgl::Response const&) + 68
frame #12: 0x0000000100629bfc Mapbox`std::__1::__function::__func<mbgl::OfflineDownload::ensureResource(mbgl::Resource const&, std::__1::function<void (mbgl::Response)>)::$_1::operator()() const::'lambda'(mbgl::Response), std::__1::allocator<mbgl::OfflineDownload::ensureResource(mbgl::Resource const&, std::__1::function<void (mbgl::Response)>)::$_1::operator()() const::'lambda'(mbgl::Response)>, void (mbgl::Response)>::operator()(mbgl::Response&&) + 324
frame #13: 0x0000000100619af0 Mapbox`mbgl::util::RunLoop::Invoker<auto std::__1::unique_ptr<mbgl::WorkRequest, std::__1::default_delete<std::__1::default_delete> > mbgl::util::RunLoop::invokeWithCallback<auto mbgl::util::Thread<mbgl::OnlineFileSource::Impl>::bind<void (mbgl::OnlineFileSource::Impl::*)(mbgl::FileRequest*, mbgl::Resource, std::__1::function<void (mbgl::Response)>)>(void (mbgl::OnlineFileSource::Impl::*)(mbgl::FileRequest*, mbgl::Resource, std::__1::function<void (mbgl::Response)>))::'lambda'(void (mbgl::OnlineFileSource::Impl::*&&)(mbgl::FileRequest*, mbgl::Resource, std::__1::function<void (mbgl::Response)>)), std::__1::function<void (mbgl::Response)>&, mbgl::OnlineFileSource::request(mbgl::Resource const&, std::__1::function<void (mbgl::Response)>)::OnlineFileRequest*, mbgl::Resource&>(void (mbgl::OnlineFileSource::Impl::*&&)(mbgl::FileRequest*, mbgl::Resource, std::__1::function<void (mbgl::Response)>), std::__1::function<void (mbgl::Response)>&&&, mbgl::OnlineFileSource::request(mbgl::Resource const&, std::__1::function<void (mbgl::Response)>)::OnlineFileRequest*&&, mbgl::Resource&&&)::'lambda'(auto mbgl::util::Thread<mbgl::OnlineFileSource::Impl>::bind<void (mbgl::OnlineFileSource::Impl::*)(mbgl::FileRequest*, mbgl::Resource, std::__1::function<void (mbgl::Response)>)>(void (mbgl::OnlineFileSource::Impl::*)(mbgl::FileRequest*, mbgl::Resource, std::__1::function<void (mbgl::Response)>))::'lambda'(void (mbgl::OnlineFileSource::Impl::*&&)(mbgl::FileRequest*, mbgl::Resource, std::__1::function<void (mbgl::Response)>)))::operator()<mbgl::Response>(auto mbgl::util::Thread<mbgl::OnlineFileSource::Impl>::bind<void (mbgl::OnlineFileSource::Impl::*)(mbgl::FileRequest*, mbgl::Resource, std::__1::function<void (mbgl::Response)>)>(void (mbgl::OnlineFileSource::Impl::*)(mbgl::FileRequest*, mbgl::Resource, std::__1::function<void (mbgl::Response)>))::'lambda'(void (mbgl::OnlineFileSource::Impl::*&&)(mbgl::FileRequest*, mbgl::Resource, std::__1::function<void (mbgl::Response)>))) const::'lambda'(auto mbgl::util::Thread<mbgl::OnlineFileSource::Impl>::bind<void (mbgl::OnlineFileSource::Impl::*)(mbgl::FileRequest*, mbgl::Resource, std::__1::function<void (mbgl::Response)>)>(void (mbgl::OnlineFileSource::Impl::*)(mbgl::FileRequest*, mbgl::Resource, std::__1::function<void (mbgl::Response)>))::'lambda'(void (mbgl::OnlineFileSource::Impl::*&&)(mbgl::FileRequest*, mbgl::Resource, std::__1::function<void (mbgl::Response)>))), std::__1::tuple<mbgl::Response> >::operator()() + 108
frame #14: 0x000000010060c2dc Mapbox`mbgl::util::RunLoop::process() + 320
frame #15: 0x0000000100675bfc Mapbox`uv__async_event(loop=<unavailable>, w=<unavailable>, nevents=<unavailable>) + 80 at async.c:92 [opt]
frame #16: 0x0000000100675dbc Mapbox`uv__async_io(loop=0x000000012e09be00, w=<unavailable>, events=<unavailable>) + 168 at async.c:137 [opt]
frame #17: 0x000000010068180c Mapbox`uv__io_poll(loop=<unavailable>, timeout=<unavailable>) + 1272 at kqueue.c:247 [opt]
frame #18: 0x00000001006762d4 Mapbox`uv_run(loop=0x000000012e09be00, mode=UV_RUN_DEFAULT) + 428 at core.c:341 [opt]
frame #19: 0x0000000100611b10 Mapbox`void mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::run<std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>, 0ul, 1ul>(mbgl::util::ThreadContext, std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>&&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) + 164
frame #20: 0x0000000100611a10 Mapbox`std::__1::__thread_proxy<std::__1::tuple<mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(mbgl::util::ThreadContext const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&, unsigned long long&&&)::'lambda'()> >(void*, void*) + 168
frame #21: 0x0000000181c8fb28 libsystem_pthread.dylib`_pthread_body + 156
frame #22: 0x0000000181c8fa8c libsystem_pthread.dylib`_pthread_start + 156
frame #23: 0x0000000181c8d028 libsystem_pthread.dylib`thread_start + 4
/cc @jfirebaugh @1ec5
Activity