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

elementsd is crashing on sendtoaddress RPC call on MacOS #987

Closed
stepansnigirev opened this issue Apr 30, 2021 · 3 comments · Fixed by #1001
Closed

elementsd is crashing on sendtoaddress RPC call on MacOS #987

stepansnigirev opened this issue Apr 30, 2021 · 3 comments · Fixed by #1001
Labels

Comments

@stepansnigirev
Copy link

Reproduced on two different machines - mine (MacOS Big Sur 11.2.3) and @ben-kaufman.
elementsd is compiled from the master branch. On Linux everything works fine.

Steps to reproduce:

  • run a fresh elements regtest with 21M free coins
  • create default wallet with createwallet ""
  • rescan to claim free coins rescanblockchain
  • try to send to any confidential or unconfidential address - elementsd crashes with Bus error: 10

Output from the elementsd process before crashing:

2021-04-30T15:21:04Z init message: Loading wallet...
2021-04-30T15:21:04Z [default wallet] Wallet File Version = 10500
2021-04-30T15:21:04Z [default wallet] Keys: 0 plaintext, 0 encrypted, 0 w/ metadata, 0 total. Unknown wallet records: 0
2021-04-30T15:21:05Z [default wallet] keypool added 2000 keys (1000 internal), size=2000 (1000 internal)
2021-04-30T15:21:05Z [default wallet] LegacyScriptPubKeyMan::NewKeyPool rewrote keypool
2021-04-30T15:21:05Z [default wallet] Wallet completed loading in            1530ms
2021-04-30T15:21:05Z [default wallet] setKeyPool.size() = 2000
2021-04-30T15:21:05Z [default wallet] mapWallet.size() = 0
2021-04-30T15:21:05Z [default wallet] m_address_book.size() = 0
2021-04-30T15:21:12Z [default wallet] Rescan started from block 898e095d644c46764aec1eb09767f277ba9beda136f379a1843e7c8460d6f98e...
2021-04-30T15:21:12Z [default wallet] AddToWallet 47a77498aa2d801e08e3144d588171d60dfddf95201641f40ca0fbd095f1d24a  new
2021-04-30T15:21:12Z [default wallet] Rescan completed in               1ms
2021-04-30T15:21:27Z [default wallet] keypool reserve 1001
Bus error: 10

Another attempt with unconfidential address:

...
2021-04-30T15:19:49Z [default wallet] AddToWallet 47a77498aa2d801e08e3144d588171d60dfddf95201641f40ca0fbd095f1d24a  new
2021-04-30T15:19:49Z [default wallet] Rescan completed in               2ms
2021-04-30T15:20:00Z [default wallet] keypool reserve 1001
2021-04-30T15:20:00Z [default wallet] Unblinding change at index 0 due to lack of inputs and other outputs being blinded.
Bus error: 10
@stevenroose stevenroose added the bug label May 6, 2021
@stevenroose
Copy link
Member

I don't have an OSX machine, could you check if this bug also exists on the 0.18.1.x releases?

@stepansnigirev
Copy link
Author

Sorry for a delay, I was away from my mac.
Just checked with v18.1.11 - sendtoaddress works fine.

@mword
Copy link

mword commented May 18, 2021

I've reproduced the error and confirmed that the issue is in the stack checking code ___chkstk_darwin when BlindTransaction is called inside of wallet.cpp and that a work around is to compile with -fno-stack-check. We don't currently know what is happening inside ___chkstk_darwin specifically or if there is some other thing we can do to avoid triggering the issue. We will likely do some further investigation but I'd say for now build elements using the following configure invocation:

./configure CFLAGS='-g -O2 -fno-stack-check' CXXFLAGS='-g -O2 -fno-stack-check' OBJCXXFLAGS='-g -O2 -fno-stack-check'

Note that it is related to issues:
#782
#998

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants