ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.85k stars 901 forks source link

CLN 23.05 crashes when attempting to 'listtransactions' #6267

Closed ctrlbreak- closed 1 year ago

ctrlbreak- commented 1 year ago

Issue and Steps to Reproduce

lightning-cli listtransactions

+388318.952284848 lightningdBROKEN: FATAL SIGNAL 6 (version v23.05-modded)
+388318.952355482 lightningdBROKEN: backtrace: common/daemon.c:38 (send_backtrace) 0x55a23365c992
+388318.952389789 lightningdBROKEN: backtrace: common/daemon.c:75 (crashdump) 0x55a23365cb1c
+388318.952409051 lightningdBROKEN: backtrace: (null):0 ((null)) 0x7f8a87fb1f0f
+388318.952429775 lightningdBROKEN: backtrace: (null):0 ((null)) 0x7f8a87fb1e87
+388318.952446124 lightningdBROKEN: backtrace: (null):0 ((null)) 0x7f8a87fb37f0
+388318.952462705 lightningdBROKEN: backtrace: (null):0 ((null)) 0x7f8a87ffc836
+388318.952478939 lightningdBROKEN: backtrace: (null):0 ((null)) 0x7f8a880038b9
+388318.952499008 lightningdBROKEN: backtrace: (null):0 ((null)) 0x7f8a88003a73
+388318.952515778 lightningdBROKEN: backtrace: (null):0 ((null)) 0x7f8a8800b00a
+388318.952532623 lightningdBROKEN: backtrace: ccan/ccan/tal/tal.c:456 (del_tree) 0x55a23376709f
+388318.952549537 lightningdBROKEN: backtrace: ccan/ccan/tal/tal.c:521 (tal_free) 0x55a23376735d
+388318.952577607 lightningdBROKEN: backtrace: common/setup.c:19 (wally_free) 0x55a233673b4c
+388318.952596788 lightningdBROKEN: backtrace: ../../../libwally-core/src/internal.c:406 (wally_free) 0x55a2336cbfff
+388318.952673290 lightningdBROKEN: backtrace: ../../../libwally-core/src/psbt.c:1119 (wally_psbt_free) 0x55a2336d35ac
+388318.952699377 lightningdBROKEN: backtrace: bitcoin/psbt.c:17 (psbt_destroy) 0x55a23367fba8
+388318.952725837 lightningdBROKEN: backtrace: ccan/ccan/tal/tal.c:246 (notify) 0x55a233766a30
+388318.952748699 lightningdBROKEN: backtrace: ccan/ccan/tal/tal.c:437 (del_tree) 0x55a233766fd0
+388318.952767738 lightningdBROKEN: backtrace: ccan/ccan/tal/tal.c:447 (del_tree) 0x55a23376701f
+388318.952802803 lightningdBROKEN: backtrace: ccan/ccan/tal/tal.c:447 (del_tree) 0x55a23376701f
+388318.952825602 lightningdBROKEN: backtrace: ccan/ccan/tal/tal.c:447 (del_tree) 0x55a23376701f
+388318.952847335 lightningdBROKEN: backtrace: ccan/ccan/tal/tal.c:521 (tal_free) 0x55a23376735d
+388318.952866473 lightningdBROKEN: backtrace: lightningd/jsonrpc.c:458 (command_raw_complete) 0x55a2335ed9c0
+388318.952886423 lightningdBROKEN: backtrace: lightningd/jsonrpc.c:480 (command_success) 0x55a2335eda9c
+388318.952907416 lightningdBROKEN: backtrace: wallet/walletrpc.c:587 (json_listtransactions) 0x55a23364a823
+388318.953933492 lightningdBROKEN: backtrace: lightningd/jsonrpc.c:655 (command_exec) 0x55a2335ee273
+388318.953955519 lightningdBROKEN: backtrace: lightningd/jsonrpc.c:783 (rpc_command_hook_final) 0x55a2335ee866
+388318.953974492 lightningdBROKEN: backtrace: lightningd/plugin_hook.c:288 (plugin_hook_call_) 0x55a23362a287
+388318.953994335 lightningdBROKEN: backtrace: lightningd/jsonrpc.c:871 (plugin_hook_call_rpc_command) 0x55a2335eec6b
+388318.954018841 lightningdBROKEN: backtrace: lightningd/jsonrpc.c:979 (parse_request) 0x55a2335ef1c8
+388318.954036981 lightningdBROKEN: backtrace: lightningd/jsonrpc.c:1084 (read_json) 0x55a2335ef657
+388318.954059330 lightningdBROKEN: backtrace: ccan/ccan/io/io.c:59 (next_plan) 0x55a23375811a
+388318.954076901 lightningdBROKEN: backtrace: ccan/ccan/io/io.c:407 (do_plan) 0x55a233758cba
+388318.954096921 lightningdBROKEN: backtrace: ccan/ccan/io/io.c:417 (io_ready) 0x55a233758cf8
+388318.954114662 lightningdBROKEN: backtrace: ccan/ccan/io/poll.c:453 (io_loop) 0x55a23375af15
+388318.954148677 lightningdBROKEN: backtrace: lightningd/io_loop_with_timers.c:22 (io_loop_with_timers) 0x55a2335ec587
+388318.954189700 lightningdBROKEN: backtrace: lightningd/lightningd.c:1231 (main) 0x55a2335f2e67
+388318.954222784 lightningdBROKEN: backtrace: (null):0 ((null)) 0x7f8a87f94c86
+388318.954240366 lightningdBROKEN: backtrace: (null):0 ((null)) 0x55a2335c2469
+388318.954259781 lightningdBROKEN: backtrace: (null):0 ((null)) 0xffffffffffffffff

getinfo output

{
   "id": "0290fb6ecd5865f7a973e1d48ffbc2612f80f6a2defbd6a188928bd0492bc2847e",
   "alias": "🥒CTRLBREAK🥒",
   "color": "00ff00",
   "num_peers": 33,
   "num_pending_channels": 0,
   "num_active_channels": 30,
   "num_inactive_channels": 1,
   "address": [
      {
         "type": "ipv4",
         "address": "159.2.215.98",
         "port": 9735
      },
      {
         "type": "torv3",
         "address": "m6fpt2z4ipzy7iq5zhf4vdne6ewn4tvtqltmwccnznm3mlcmcmbsroyd.onion",
         "port": 9735
      }
   ],
   "binding": [
      {
         "type": "ipv4",
         "address": "XXXXXXXXXXXXXX",
         "port": XXXX
      }
   ],
   "version": "v23.05-modded",
   "blockheight": 790905,
   "network": "bitcoin",
   "fees_collected_msat": 22047571,
   "lightning-dir": "/home/bitcoin/.lightning/bitcoin",
   "our_features": {
      "init": "08a0000a0269a2",
      "node": "88a0000a0269a2",
      "channel": "",
      "invoice": "02000002024100"
   }
}
instagibbs commented 1 year ago

what commit/version are you running?

ctrlbreak- commented 1 year ago

The tagged version : v23.05

instagibbs commented 1 year ago

looks like it's crashing right here: https://github.com/ElementsProject/libwally-core/blob/9f2f42df357f5b76d6273ab3165fb9ca671841d8/src/psbt.c#L1119

vincenzopalazzo commented 1 year ago

@ctrlbreak- could you add some more love in the issue description?

How do you hit this crash?

ctrlbreak- commented 1 year ago

I'm really not sure what you want by "more love" in the issue description. I literally just attempt to run 'listtransactions' on my CLN node.

I'm willing to try and investigate, and if it needs to be via Github, so be it. It seems absolutely no one discusses anything on IRC anymore.

instagibbs commented 1 year ago

Hi, can you try running https://github.com/ElementsProject/lightning/pull/6275 ? it's possible internally it's working on the wrong psbt version

rustyrussell commented 1 year ago

If this happens for you every time, that's interesting. It implies we don't like something in your db, and I'd really like to see what it is!

This command should give me enough to reproduce (but it will tell your entire onchain history, so maybe send directly to me?)

sqlite3 ~/.lightning/bitcoin/lightningd.sqlite3 '.dump transactions; .dump transaction_annotations'