JoinMarket-Org / joinmarket

CoinJoin implementation with incentive structure to convince people to take part
398 stars 119 forks source link

Torsocks error "unable to resolve", then segfault on Tails #727

Open griest024 opened 7 years ago

griest024 commented 7 years ago

The bug

Running torify python tumbler.py <address1> <address2> <address3> causes a segfault.

Here is the last few lines of the corresponding log file (scrubbed).

TIMESTAMP_0000000000509 [MCThread    ] [DEBUG]  rpc: gettxout ['TXID_00000000000000000000000000000000000000000000000000000000119', IDX_119, False]
TIMESTAMP_0000000000510 [MCThread    ] [DEBUG]  found good sig at index=11
TIMESTAMP_0000000000511 [MCThread    ] [INFO ]  nick = J54XnAhbL6szyC3D sent all sigs, removing from nonrespondant list
TIMESTAMP_0000000000512 [MCThread    ] [INFO ]  all makers have sent their signatures
TIMESTAMP_0000000000513 [MCThread    ] [DEBUG]  
TXHEX_0000000001_0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000
TIMESTAMP_0000000000514 [MCThread    ] [INFO ]  txid = SEND_TXID_000000000000000000000000000000000000000000000000000001
TIMESTAMP_0000000000515 [MCThread    ] [DEBUG]  rpc: sendrawtransaction ['SENT_RAW_TX_0000000001_0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000+0000000000000000000000000000000000000000
TIMESTAMP_0000000000516 [MCThread    ] [DEBUG]  rpc: getaccount ['1ADDRESS_00000000000000000000011']

Immediately following the txid = line in the terminal is this:

1490779859 ERROR torsocks[2818]: Unable to resolve. Status reply: 4 (in socks5_recv_resolve_ptr_reply() at socks5.c:829)
Segmentation fault

Environment info:

Tails 2.11 Joinmarket 0.2.2 Bitcoin core 0.13.2

Running a full node with the blockchain source set to bitcoin-rpc.

wallet-tool.py and sendpayment.py -N 0 complete without errors.

AdamISZ commented 7 years ago

Btw i was googling this error message earlier today and it seems to be associated with a gethostbyname call, see e.g. https://ubuntuforums.org/showthread.php?t=2250324

Also this one is from the same error: https://labs.riseup.net/code/issues/11736

Might just be noise but in case it's helpful.

Also spent some time with @griest024 on this and the error seems to be intermittent, seems some transactions did complete. Which makes it especially hard to know how to progress.

griest024 commented 7 years ago

I should note that I do have AllowOutboundLocalHost 1 set. Setting it to 2 did not appear to help, but this is tricky to debug because I lose a little bit in fees every time I test something.

Setting rpc_host = 127.0.0.1 (as tailsjoin does, instead of localhost) does not resolve the bug.

chris-belcher commented 7 years ago

So this actually causes python itself to crash?

griest024 commented 7 years ago

@chris-belcher that is correct. program execution ends and I am returned to the prompt.