<div dir="ltr"><div>Hi</div><div><br></div><div>We are having problems with sqlite3 and disk while running on iOS. It happens only from time to time. Restarting the application is usually enough.</div><div><br></div><div>The first case returns an sqlite3 error 13: "database or disk is full" <a href="https://sqlite.org/rescode.html#full">https://sqlite.org/rescode.html#full</a></div><div>This is the message (trimmed)</div><div><pre role="code">Fatal Exception: osgeo::proj::io::FactoryException<br>SQLite error [ code = 13, msg = database or disk is full ] on SELECT * FROM (SELECT <br>c.auth_name, c.code, <a href="http://c.name">c.name</a>, c.type, c.deprecated, a.west_lon, a.south_lat, a.east_lon, <br>a.north_lat, a.description, NULL, <a href="http://cb.name">cb.name</a> FROM geodetic_crs c LEFT JOIN usage u ON <br>u.object_table_name = 'geodetic_crs'...<br><br></pre>And this is the stack trace<pre role="code">8 libc++abi.dylib 0x11bdc std::__terminate(void (*)()) + 16
9 libc++abi.dylib 0x15314 __cxa_get_exception_ptr + 86<br>10 libc++abi.dylib 0x152bc __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 90<br>11 proj 0x168434 osgeo::proj::io::SQLiteHandle::run(sqlite3_stmt*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::list<osgeo::proj::io::SQLValues, std::__1::allocator<osgeo::proj::io::SQLValues>> const&, bool) + 1468
12 proj 0x16a6e8 osgeo::proj::io::DatabaseContext::Private::run(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::list<osgeo::proj::io::SQLValues, std::__1::allocator<osgeo::proj::io::SQLValues>> const&, bool) + 1220
13 proj 0x1ad76c osgeo::proj::io::AuthorityFactory::getCRSInfoList() const + 2332<br>...</pre><br></div><div>There is another similar (but different) issue with error 10: "disk I/O error" <a href="https://sqlite.org/rescode.html#ioerr">https://sqlite.org/rescode.html#ioerr</a></div><div></div><div><pre role="code">Fatal Exception: osgeo::proj::io::FactoryException<br>SQLite error [ code = 10, msg = disk I/O error ] on SELECT name FROM "geodetic_datum" WHERE auth_name = ? AND code = ?<br></pre><br></div><div>Stack trace</div><div><br></div><div><pre class="gmail-ndfHFb-c4YZDc-fmcmS-DARUcf" style="font-feature-settings:"liga" 0;font-variant-ligatures:no-contextual;font-family:"Courier New",Courier,monospace,arial,sans-serif;background:rgb(255,255,255);border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;display:block;line-height:normal;white-space:pre-wrap;color:rgb(0,0,0);font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-family:monospace"><font size="2">9 libc++abi.dylib 0x11b80 std::terminate() + 108</font></span></pre></div><div><pre class="gmail-ndfHFb-c4YZDc-fmcmS-DARUcf" style="font-feature-settings:"liga" 0;font-variant-ligatures:no-contextual;font-family:"Courier New",Courier,monospace,arial,sans-serif;background:rgb(255,255,255);border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;display:block;line-height:normal;white-space:pre-wrap;color:rgb(0,0,0);font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-family:monospace"><font size="2">10 proj 0x8270 __clang_call_terminate + 14</font></span><br><span style="font-family:monospace"><font size="2">11 proj 0xad1e8 osgeo::proj::common::IdentifiedObject::_isEquivalentTo(osgeo::proj::common::IdentifiedObject const*, osgeo::proj::util::IComparable::Criterion, std::__1::shared_ptr<osgeo::proj::io::DatabaseContext> const&) const + 234
12 proj 0xe82f4 osgeo::proj::datum::Datum::_isEquivalentTo(osgeo::proj::util::IComparable const*, osgeo::proj::util::IComparable::Criterion, std::__1::shared_ptr<osgeo::proj::io::DatabaseContext> const&) const + 100
13 proj 0xed7ac osgeo::proj::datum::GeodeticReferenceFrame::isEquivalentToNoExactTypeCheck(osgeo::proj::util::IComparable const*, osgeo::proj::util::IComparable::Criterion, std::__1::shared_ptr<osgeo::proj::io::DatabaseContext> const&) const + 96
14 proj 0xc0774 osgeo::proj::crs::SingleCRS::baseIsEquivalentTo(osgeo::proj::util::IComparable const*, osgeo::proj::util::IComparable::Criterion, std::__1::shared_ptr<osgeo::proj::io::DatabaseContext> const&) const + 456
15 proj 0xc8eb0 osgeo::proj::crs::GeographicCRS::_isEquivalentTo(osgeo::proj::util::IComparable const*, osgeo::proj::util::IComparable::Criterion, std::__1::shared_ptr<osgeo::proj::io::DatabaseContext> const&) const + 172
16 proj 0xc627c osgeo::proj::crs::GeodeticCRS::identify(std::__1::shared_ptr<osgeo::proj::io::AuthorityFactory> const&) const + 724
17 proj 0xd072c osgeo::proj::crs::ProjectedCRS::identify(std::__1::shared_ptr<osgeo::proj::io::AuthorityFactory> const&) const + 1184
18 proj 0xd4028 osgeo::proj::crs::ProjectedCRS::_identify(std::__1::shared_ptr<osgeo::proj::io::AuthorityFactory> const&) const + 44<br>...</font></span></pre><br></div><div>Are we writing anything to disk at runtime related to sqlite3? Even a temporary file? Where?</div><div>If yes, would this problem be fixed if we embed proj.db in the library? Currently we are using it as an external file.</div><div><br></div><div>My only guess would be that sqlite3 is creating a temporary file in a folder with very little space (like /tmp), because the phone should have a lot of free space for normal storage.</div><div><br></div><div>Thank you</div><div>Javier.</div></div>