Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert tripped in LedgerEntrySet when orders cross #7

Closed
justmoon opened this issue Jan 9, 2013 · 2 comments
Closed

Assert tripped in LedgerEntrySet when orders cross #7

justmoon opened this issue Jan 9, 2013 · 2 comments

Comments

@justmoon
Copy link
Contributor

justmoon commented Jan 9, 2013

Steps to reproduce:

  1. Create a new ledger, no peers.
  2. God creates one order, buy 10 BTC/god for 15 USD/god each.
  3. God creates another order, sell 10 BTC/god for 15 USD/god each.

Expected result:
Either the offers cancel each other with no effect, or perhaps an error stating that god does not have the necessary trust lines to pay himself.

Actual result:
Server stops because of assert.

Stack:

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffeffff700 (LWP 8479)]
0x00007ffff5775425 in __GI_raise (sig=<optimized out>)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff5775425 in __GI_raise (sig=<optimized out>)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007ffff5778b8b in __GI_abort () at abort.c:91
#2  0x00007ffff576e0ee in __assert_fail_base (fmt=<optimized out>, 
    assertion=0x100527c "false", 
    file=0x1005248 "src/cpp/ripple/LedgerEntrySet.cpp", line=<optimized out>, 
    function=<optimized out>) at assert.c:94
#3  0x00007ffff576e192 in __GI___assert_fail (assertion=0x100527c "false", 
    file=0x1005248 "src/cpp/ripple/LedgerEntrySet.cpp", line=96, 
    function=0x1009540 <LedgerEntrySet::entryCache(LedgerEntryType, uint256 const&)::__PRETTY_FUNCTION__> "SerializedLedgerEntry::pointer LedgerEntrySet::entryCache(LedgerEntryType, const uint256&)") at assert.c:103
#4  0x0000000000c1d05b in LedgerEntrySet::entryCache (this=0x150bc70, 
    letType=ltDIR_NODE, index=...) at src/cpp/ripple/LedgerEntrySet.cpp:96
#5  0x0000000000c20f1a in LedgerEntrySet::dirAdd(unsigned long long&, uint256 const&, uint256 const&, boost::function<void (boost::shared_ptr<SerializedLedgerEntry> const&)>) (this=0x150bc70, uNodeDir=@0x7fffefff7038: 4294967296, 
    uRootIndex=..., uLedgerIndex=..., fDescriber=...)
    at src/cpp/ripple/LedgerEntrySet.cpp:532
#6  0x0000000000e39460 in OfferCreateTransactor::doApply (this=0x7fffe0004eb0)
    at src/cpp/ripple/OfferCreateTransactor.cpp:434
#7  0x0000000000e35540 in Transactor::apply (this=0x7fffe0004eb0)
    at src/cpp/ripple/Transactor.cpp:220
#8  0x0000000000cbf0c9 in TransactionEngine::applyTransaction (this=0x150bc68, 
    txn=..., params=(tapNO_CHECK_SIGN | tapOPEN_LEDGER), 
    didApply=@0x7fffefffbd0b: false) at src/cpp/ripple/TransactionEngine.cpp:107
#9  0x0000000000c155ff in LedgerMaster::doTransaction (this=0x150bc40, txn=..., 
    params=(tapNO_CHECK_SIGN | tapOPEN_LEDGER))
    at src/cpp/ripple/LedgerMaster.cpp:123
#10 0x0000000000c7e067 in NetworkOPs::processTransaction(boost::shared_ptr<Transaction>, boost::function<void (boost::shared_ptr<Transaction>, TER)>) (
    this=0x150c060, trans=..., callback=...)
    at src/cpp/ripple/NetworkOPs.cpp:305
#11 0x0000000000c8a362 in NetworkOPs::processTransaction (this=0x150c060, 
    transaction=...) at src/cpp/ripple/NetworkOPs.h:168
#12 0x0000000000c7cfc2 in NetworkOPs::submitTransactionSync (this=0x150c060, 
    tpTrans=...) at src/cpp/ripple/NetworkOPs.cpp:182
#13 0x0000000000b9caac in RPCHandler::doSubmit (this=0x7fffefffe560, 
    jvRequest=...) at src/cpp/ripple/RPCHandler.cpp:1135
#14 0x0000000000ba61bb in RPCHandler::doCommand (this=0x7fffefffe560, 
    jvRequest=..., iRole=2) at src/cpp/ripple/RPCHandler.cpp:2518
#15 0x0000000000e15443 in WSConnection<websocketpp::endpoint<websocketpp::role::server, websocketpp::socket::plain, websocketpp::log::logger> >::invokeCommand (
    this=0x7fffc0022c30, jvRequest=...) at src/cpp/ripple/WSConnection.h:85
#16 0x0000000000e126e5 in WSServerHandler<websocketpp::endpoint<websocketpp::role::server, websocketpp::socket::plain, websocketpp::log::logger> >::do_message (
    this=0x7fffc001d370, cpClient=..., mpMessage=...)
    at src/cpp/ripple/WSHandler.h:201
[...]
justmoon added a commit that referenced this issue Jan 9, 2013
@JoelKatz
Copy link
Collaborator

JoelKatz commented Jan 9, 2013

The LedgerEntrySet code is seeing an existing node deleted and then placed in the cache. That's definitely not legal.

@ahbritto
Copy link
Contributor

Fixed and tested.

wufeipeng pushed a commit to peersafe/rippled that referenced this issue Nov 20, 2017
wufeipeng pushed a commit to peersafe/rippled that referenced this issue Nov 20, 2017
ximinez added a commit to ximinez/rippled that referenced this issue Aug 27, 2019
* Make fee voting safer, so external data can not cause a termination.
* Validate fee voting config data.
* Rename fee json() to jsonClipped() to minimize the chances of it being
  misused.
* Get rid of some snake_case.
* Add special comparison operators for XRPAmount and std::uint64_t,
  because otherwise, uint64's can be silently clipped to XRPAmount, and
  thus int64.
* Some misc cleanups.
ximinez added a commit to ximinez/rippled that referenced this issue Sep 9, 2019
* Make fee voting safer, so external data can not cause a termination.
* Validate fee voting config data.
* Rename fee json() to jsonClipped() to minimize the chances of it being
  misused.
* Get rid of some snake_case.
* Add special comparison operators for XRPAmount and std::uint64_t,
  because otherwise, uint64's can be silently clipped to XRPAmount, and
  thus int64.
* Some misc cleanups.
ximinez added a commit to ximinez/rippled that referenced this issue Oct 2, 2019
* Make fee voting safer, so external data can not cause a termination.
* Validate fee voting config data.
* Rename fee json() to jsonClipped() to minimize the chances of it being
  misused.
* Get rid of some snake_case.
* Add special comparison operators for XRPAmount and std::uint64_t,
  because otherwise, uint64's can be silently clipped to XRPAmount, and
  thus int64.
* Some misc cleanups.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants