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

SPV causing nodes to randomly segfault #1129

Closed
prasannavl opened this issue Mar 8, 2022 · 3 comments
Closed

SPV causing nodes to randomly segfault #1129

prasannavl opened this issue Mar 8, 2022 · 3 comments
Labels
bug p1 High priority // daily updates

Comments

@prasannavl
Copy link
Member

prasannavl commented Mar 8, 2022

Nodes running with spv enabled (default), has been observed to be crashing over the last few weeks at random times. Restarting the node with spv=0 makes the node continue to work as normal.

This appears due to corruption in the data, that the spv code can't seem to handle. But requires further investigation on why this is being caused in the first place, and hasn't surfaced until now -- since there has been no recent changes to this part of the related areas.

Stack trace:

[Current thread is 1 (Thread 0x7f6a3869b700 (LWP 607982))]
(gdb) bt
#0  0x0000556b8ca8202d in BRPeerSendMessage(BRPeerStruct*, unsigned char const*, unsigned long, char const*) ()
#1  0x0000556b8ca8466a in BRPeerSendGetdata(BRPeerStruct*, UInt256 const*, unsigned long, UInt256 const*, unsigned long) ()
#2  0x0000556b8ca99d04 in _BRPeerManagerRequestUnrelayedTx(BRPeerManagerStruct*, BRPeerStruct*) ()
#3  0x0000556b8ca999bc in _mempoolDone(void*, int) ()
#4  0x0000556b8ca88ee8 in _BRPeerAcceptMessage(BRPeerStruct*, unsigned char const*, unsigned long, char const*) ()
#5  0x0000556b8ca81154 in _peerThreadRoutine(void*) ()
#6  0x0000556b8ca8d65e in boost::detail::thread_data<boost::_bi::bind_t<void*, void* (*)(void*), boost::_bi::list1<boost::_bi::value<BRPeerStruct*> > > >::run() ()
#7  0x0000556b8cb868ba in thread_proxy ()
#8  0x00007f6a954a8609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#9  0x00007f6a95077163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Workaround: Disable spv with -spv=0 flag or spv = 0 in defi.conf.
Current workaround with spv turned on: None.

@prasannavl prasannavl added bug p1 High priority // daily updates labels Mar 8, 2022
@DeFiCh DeFiCh deleted a comment from defichain-bot Mar 8, 2022
@prasannavl
Copy link
Member Author

Status update: The cause has been identified to be a bug in the third party dependency - bread wallet SPV - that uses variable length arrays in the stack. PR #1127 already fixes this for v3.

Back-port in progress.

@prasannavl
Copy link
Member Author

Resolved by #1131

@prasannavl
Copy link
Member Author

v2.6.2 Released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug p1 High priority // daily updates
Projects
None yet
Development

No branches or pull requests

2 participants