Skip to content

rippled crash on terminate: sqlite_3_soci_error #5786

@Tapanito

Description

@Tapanito

Issue Description

I wrote a script that continuously starts and stops rippled at random intervals with random termination signals, until rippled produces a core dump. rippled produced a new kind of crash:

terminate called after throwing an instance of 'soci::sqlite3_soci_error'
  what():  sqlite3_statement_backend::loadOne: database is locked while fetching data from "SELECT AmendmentHash, AmendmentName, Veto FROM ( SELECT AmendmentHash, AmendmentName, Veto, RANK() OVER (  PARTITION BY AmendmentHash ORDER BY ROWID DESC ) as rnk FROM FeatureVotes ) WHERE rnk = 1".
<!--Provide a summary for your issue/bug.-->

Steps to Reproduce

The issue is tricky to reproduce, as rippled crashed at a random interval shutdown.

Expected Result

rippled shutdown cleanly

Actual Result

rippled crashed, corrupting the sqlite database in the process.

Supporting Files

Backtrace

#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=124010819743104) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=124010819743104) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=124010819743104, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x000070c984a42476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x000070c984a287f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00005603ab0b9ec3 in __gnu_cxx::__verbose_terminate_handler() [clone .cold] ()
#6  0x00005603ab0b855c in __cxxabiv1::__terminate(void (*)()) ()
#7  0x00005603ab0b85c7 in std::terminate() ()
#8  0x00005603ab0b877d in __cxa_rethrow ()
#9  0x00005603aa09d3c6 in soci::details::statement_impl::rethrow_current_exception_with_context (this=0x5603be9da2d0, operation=0x5603a6b14afb "fetching data from") at /home/vtumas/.conan2/p/b/soci754a5526e04b3/b/src/src/core/statement.cpp:824
#10 0x00005603aa09bc8b in soci::details::statement_impl::fetch (this=0x5603be9da2d0) at /home/vtumas/.conan2/p/b/soci754a5526e04b3/b/src/src/core/statement.cpp:441
#11 0x00005603a73ae7a5 in soci::statement::fetch (this=0x7ffc88c49610) at /home/vtumas/.conan2/p/b/soci754a5526e04b3/p/include/soci/statement.h:227
#12 0x00005603a73cefde in ripple::readAmendments(soci::session&, std::function<void (boost::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::optional<ripple::AmendmentVote>)> const&) (session=..., callback=...) at /home/vtumas/workspace/rippled/src/xrpld/app/rdb/detail/Wallet.cpp:282
#13 0x00005603a713ea34 in ripple::AmendmentTableImpl::AmendmentTableImpl (this=0x5603be9fd940, app=..., majorityTime=..., supported=..., enabled=..., vetoed=..., journal=...) at /home/vtumas/workspace/rippled/src/xrpld/app/misc/detail/AmendmentTable.cpp:628
#14 0x00005603a71482b8 in std::make_unique<ripple::AmendmentTableImpl, ripple::Application&, std::chrono::duration<long, std::ratio<1l, 1l> >&, std::vector<ripple::AmendmentTable::FeatureInfo, std::allocator<ripple::AmendmentTable::FeatureInfo> > const&, ripple::Section const&, rippl--Type <RET> for more, q to quit, c to continue without paging--c
e::Section const&, beast::Journal&> () at /usr/include/c++/11/bits/unique_ptr.h:962
#15 0x00005603a7141235 in ripple::make_AmendmentTable (app=..., majorityTime=..., supported=..., enabled=..., vetoed=..., journal=...) at /home/vtumas/workspace/rippled/src/xrpld/app/misc/detail/AmendmentTable.cpp:1080
#16 0x00005603a6fe5dfd in ripple::ApplicationImp::setup (this=0x5603be94efe0, cmdline=...) at /home/vtumas/workspace/rippled/src/xrpld/app/main/Application.cpp:1257
#17 0x00005603a70799f7 in ripple::run (argc=3, argv=0x7ffc88c4c5e8) at /home/vtumas/workspace/rippled/src/xrpld/app/main/Main.cpp:826
#18 0x00005603a707aee0 in main (argc=3, argv=0x7ffc88c4c5e8) at /home/vtumas/workspace/rippled/src/xrpld/app/main/Main.cpp:876

Metadata

Metadata

Assignees

No one assigned

    Labels

    TriagedIssue/PR has been triaged for viability, liveliness, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions