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

listtransactions crash #3231

Closed
darosior opened this issue Nov 1, 2019 · 4 comments · Fixed by #3256
Closed

listtransactions crash #3231

darosior opened this issue Nov 1, 2019 · 4 comments · Fixed by #3256

Comments

@darosior
Copy link
Collaborator

darosior commented Nov 1, 2019

2019-11-01T01:11:43.170Z **BROKEN** lightningd(646): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.170Z **BROKEN** lightningd(646): Accessing a null column 3 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.170Z **BROKEN** lightningd(646): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.170Z **BROKEN** lightningd(646): Accessing a null column 3 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.170Z **BROKEN** lightningd(646): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.170Z **BROKEN** lightningd(646): Accessing a null column 3 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.170Z **BROKEN** lightningd(646): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.170Z **BROKEN** lightningd(646): Accessing a null column 3 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.170Z **BROKEN** lightningd(646): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.170Z **BROKEN** lightningd(646): Accessing a null column 3 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.170Z **BROKEN** lightningd(646): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.170Z **BROKEN** lightningd(646): Accessing a null column 3 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.170Z **BROKEN** lightningd(646): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.170Z **BROKEN** lightningd(646): Accessing a null column 3 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.170Z **BROKEN** lightningd(646): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.171Z **BROKEN** lightningd(646): Accessing a null column 3 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.171Z **BROKEN** lightningd(646): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.171Z **BROKEN** lightningd(646): Accessing a null column 3 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.171Z **BROKEN** lightningd(646): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.171Z **BROKEN** lightningd(646): Accessing a null column 3 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.171Z **BROKEN** lightningd(646): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.171Z **BROKEN** lightningd(646): Accessing a null column 3 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.171Z **BROKEN** lightningd(646): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.171Z **BROKEN** lightningd(646): Accessing a null column 3 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.171Z **BROKEN** lightningd(646): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.171Z **BROKEN** lightningd(646): Accessing a null column 3 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.171Z **BROKEN** lightningd(646): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): FATAL SIGNAL 11 (version v0.7.2.1-571-g0985c6e)
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: common/daemon.c:46 (send_backtrace) 0x55b0253de361
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: common/daemon.c:54 (crashdump) 0x55b0253de3b1
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: (null):0 ((null)) 0x7f73734e383f
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: wallet/walletrpc.c:997 (json_transaction_details) 0x55b02541fda0
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: wallet/walletrpc.c:1085 (json_listtransactions) 0x55b0254202e5
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: lightningd/jsonrpc.c:645 (parse_request) 0x55b0253b017e
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: lightningd/jsonrpc.c:743 (read_json) 0x55b0253b05a8
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: ccan/ccan/io/io.c:59 (next_plan) 0x55b02542b342
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: ccan/ccan/io/io.c:407 (do_plan) 0x55b02542bebf
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: ccan/ccan/io/io.c:417 (io_ready) 0x55b02542befd
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: ccan/ccan/io/poll.c:445 (io_loop) 0x55b02542e0b7
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: lightningd/io_loop_with_timers.c:24 (io_loop_with_timers) 0x55b0253ac5c1
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: lightningd/lightningd.c:859 (main) 0x55b0253b2aef
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: (null):0 ((null)) 0x7f73734d009a
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: (null):0 ((null)) 0x55b025398a59
2019-11-01T01:11:43.317Z **BROKEN** lightningd(646): backtrace: (null):0 ((null)) 0xffffffffffffffff

I was trying to check the confirmation status of a funding transaction, which is actually unconfirmed.

@niftynei
Copy link
Collaborator

niftynei commented Nov 3, 2019

Another listtransactions crash. I suspect it's the same root cause; the line number is different, but I'm running v0.7.3.

2019-11-03T21:24:36.961Z **BROKEN** lightningd(20033): FATAL SIGNAL 6 (version v0.7.3)
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: common/daemon.c:46 (send_backtrace) 0x564e2cfadbe3
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: common/daemon.c:54 (crashdump) 0x564e2cfadc33
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: (null):0 ((null)) 0x7f43c1d46f1f
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: (null):0 ((null)) 0x7f43c1d46e97
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: (null):0 ((null)) 0x7f43c1d48800
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: ccan/ccan/tal/tal.c:93 (call_error) 0x564e2d00664e
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: ccan/ccan/tal/tal.c:165 (check_bounds) 0x564e2d006816
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: ccan/ccan/tal/tal.c:173 (to_tal_hdr) 0x564e2d00683d
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: ccan/ccan/tal/tal.c:186 (to_tal_hdr_or_null) 0x564e2d0068d6
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: ccan/ccan/tal/tal.c:632 (tal_bytelen) 0x564e2d0077be
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: lightningd/json.c:377 (json_add_hex_talarr) 0x564e2cf7dcc7
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: wallet/walletrpc.c:1001 (json_transaction_details) 0x564e2cfeb909
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: wallet/walletrpc.c:1085 (json_listtransactions) 0x564e2cfebdf5
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: lightningd/jsonrpc.c:645 (parse_request) 0x564e2cf80415
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: lightningd/jsonrpc.c:743 (read_json) 0x564e2cf8083f
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: ccan/ccan/io/io.c:59 (next_plan) 0x564e2cff69cf
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: ccan/ccan/io/io.c:407 (do_plan) 0x564e2cff754c
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: ccan/ccan/io/io.c:417 (io_ready) 0x564e2cff758a
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: ccan/ccan/io/poll.c:445 (io_loop) 0x564e2cff9750
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: lightningd/io_loop_with_timers.c:24 (io_loop_with_timers) 0x564e2cf7ca76
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: lightningd/lightningd.c:859 (main) 0x564e2cf82d89
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: (null):0 ((null)) 0x7f43c1d29b96
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: (null):0 ((null)) 0x564e2cf68c09
2019-11-03T21:24:36.962Z **BROKEN** lightningd(20033): backtrace: (null):0 ((null)) 0xffffffffffffffff

@darosior
Copy link
Collaborator Author

@m-schmoock A wild guess, but maybe ORDER BY blockheight, for a non-existent blockheight isn't opti

@m-schmoock
Copy link
Collaborator

m-schmoock commented Nov 11, 2019

Yes, when a fresh channel is being funded and still unconfirmed, the SQL related log messages appear:

2019-11-11T22:44:22.504Z **BROKEN** lightningd(2455): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC

... but it does not crash for me just yet, maybe because the resulting struct is uncleared memory that contained some other valid enough stuff.

@m-schmoock
Copy link
Collaborator

m-schmoock commented Nov 11, 2019

Now it finally crashed for me on master:

lightningd(15253): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
lightningd(15253): Accessing a null column 2 in query SELECT  t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM  transactions t LEFT JOIN  transaction_annotations a ON (a.txid = t.id) LEFT JOIN  channels c ON (a.channel = c.id) LEFT JOIN  channels c2 ON (t.channel_id = c2.id) ORDER BY blockheight, txindex ASC
lightningd(15253): FATAL SIGNAL 11 (version v0.7.3-45-g6427ccb)
lightningd(15253): backtrace: common/daemon.c:46 (send_backtrace) 0x5570f6b075bf
lightningd(15253): backtrace: common/daemon.c:54 (crashdump) 0x5570f6b0760f
lightningd(15253): backtrace: (null):0 ((null)) 0x7fd236fabfaf
lightningd(15253): backtrace: wallet/walletrpc.c:997 (json_transaction_details) 0x5570f6b48e46
lightningd(15253): backtrace: wallet/walletrpc.c:1085 (json_listtransactions) 0x5570f6b491d5
lightningd(15253): backtrace: lightningd/jsonrpc.c:589 (command_exec) 0x5570f6ad8ba7
lightningd(15253): backtrace: lightningd/jsonrpc.c:635 (rpc_command_hook_callback) 0x5570f6ad8d8d
lightningd(15253): backtrace: lightningd/plugin_hook.c:118 (plugin_hook_call_) 0x5570f6afd966
lightningd(15253): backtrace: lightningd/jsonrpc.c:695 (plugin_hook_call_rpc_command) 0x5570f6ad915d
lightningd(15253): backtrace: lightningd/jsonrpc.c:702 (call_rpc_command_hook) 0x5570f6ad918a
lightningd(15253): backtrace: common/timeout.c:39 (timer_expired) 0x5570f6b13bfb
lightningd(15253): backtrace: lightningd/io_loop_with_timers.c:32 (io_loop_with_timers) 0x5570f6ad5140
lightningd(15253): backtrace: lightningd/lightningd.c:859 (main) 0x5570f6adbde2
lightningd(15253): backtrace: (null):0 ((null)) 0x7fd236f97152
lightningd(15253): backtrace: (null):0 ((null)) 0x5570f6ac138d
lightningd(15253): backtrace: (null):0 ((null)) 0xffffffffffffffff

It is caused by accessing the first transaction in the list returned by wallet.c SQL

struct wally_tx *wtx = tx->tx->wtx;

In this case the middle tx is random memory.
I think I can fix this...

m-schmoock added a commit to m-schmoock/lightning that referenced this issue Nov 14, 2019
m-schmoock added a commit to m-schmoock/lightning that referenced this issue Nov 14, 2019
rustyrussell pushed a commit that referenced this issue Nov 15, 2019
Changelog-Fixed: #3231 listtransactions crash
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

Successfully merging a pull request may close this issue.

3 participants