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

old version maybe fixed now #2

Open
Saibato opened this issue Mar 21, 2018 · 0 comments
Open

old version maybe fixed now #2

Saibato opened this issue Mar 21, 2018 · 0 comments

Comments

@Saibato
Copy link
Owner

Saibato commented Mar 21, 2018

Issue and Steps to Reproduce

getinfo output

4ad8c18ff42054b3fbecb172103a6f6f4e89d7d754dcfc98d55b0ff51b30bdb917dc7446dfc0eb00560aaa81ea552aed0d4d020: 25 error code: -25?error message:?Missing inputs?
2018-03-21T02:04:11.444Z lightningd(6181): Broadcasting tx 02000000000101443e08abdf785a11ca77adf1d407f244cd26f37276fa4869a7dd0a1acaa973dc00000000006e95e8800115d90100000000001600146e2e1c85a9f458177ed6f1bfdb5b9d451739d8ba040047304402206c0472f382170b0452eb7a5f9d07882b4106cf739dfe18795d2e2a2ad396c98b02206be76d3df9589e553f2bb85a6c59caf4654397ea7d4e5953709c7fe9c0297911014730440220077c36df61b82aab7141abda90ded973af5486042f8fc5e200f2486772b270ea02200a03c66d67557dd1be1a412936b899c4a7cde0a9121fc2021dc1157a00c212dd014752210369872251109337f2ea0288031588b434bd1cf0d104ad8c18ff42054b3fbecb172103a6f6f4e89d7d754dcfc98d55b0ff51b30bdb917dc7446dfc0eb00560aaa81ea552aed0d4d020: 25 error code: -25?error message:?Missing inputs?
2018-03-21T02:04:11.472Z lightningd(6181): 02b240dc248b6351142d4f8ce94652a2942ccfbd9a735ba7a720e3e6183689469c chan ElementsProject#18: onchaind complete, forgetting peer
2018-03-21T05:25:12.532Z lightningd(6181): lightning_channeld-03ac27acff678ce4a2f25756612d3a83e2cb4d7552db168d3bb15482b92c80215f chan ElementsProject#16: Peer connection lost
2018-03-21T05:25:12.572Z lightningd(6181): 03ac27acff678ce4a2f25756612d3a83e2cb4d7552db168d3bb15482b92c80215f chan ElementsProject#16: Peer transient failure in CHANNELD_NORMAL: lightning_channeld: Owning subdaemon lightning_channeld died (62208)
2018-03-21T05:25:12.577Z lightning_gossipd(6189): No address known for 03ac27acff678ce4a2f25756612d3a83e2cb4d7552db168d3bb15482b92c80215f, giving up
lightningd: common/pseudorand.c:36: pseudorand: Assertion `max' failed.
2018-03-21T06:47:29.617Z lightningd(6181): FATAL SIGNAL 6 RECEIVED
2018-03-21T06:47:30.149Z lightningd(6181): FATAL SIGNAL 11 RECEIVED
lightning_channeld: lightning_channeld: Writing out status 65522Writing out status 65522: : Broken pipe
Broken pipe

Saibato pushed a commit that referenced this issue Jun 17, 2018
2018-06-14T01:09:03.495Z lightningd(23766): HSM: created new hsm_secret file
==23785== Syscall param socketcall.bind(my_addr.sin6_flowinfo) points to uninitialised byte(s)
==23785==    at 0x5731877: bind (syscall-template.S:78)
==23785==    by 0x11767C: make_listen_fd (gossip.c:2405)
==23785==    by 0x117DA2: handle_wireaddr_listen (gossip.c:2558)
==23785==    by 0x1183B7: setup_listeners (gossip.c:2653)
==23785==    by 0x118E86: gossip_activate (gossip.c:2871)
==23785==    by 0x11AC42: recv_req (gossip.c:3543)
==23785==    by 0x143FF1: next_plan (io.c:59)
==23785==    by 0x144AEE: do_plan (io.c:387)
==23785==    by 0x144B2C: io_ready (io.c:397)
==23785==    by 0x146719: io_loop (poll.c:310)
==23785==    by 0x11B0B0: main (gossip.c:3687)
==23785==  Address 0x1ffeffffa4 is on thread 1's stack
==23785==  in frame #2, created by handle_wireaddr_listen (gossip.c:2539)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Saibato pushed a commit that referenced this issue Jul 30, 2018
==1224== Uninitialised byte(s) found during client check request
==1224==    at 0x152CAD: memcheck_ (mem.h:247)
==1224==    by 0x152D18: towire (towire.c:17)
==1224==    by 0x152DA1: towire_u16 (towire.c:28)
==1224==    by 0x142189: towire_failed_htlc (htlc_wire.c:29)
==1224==    by 0x16343F: towire_channel_init (gen_channel_wire.c:596)
==1224==    by 0x115C2C: peer_start_channeld (channel_control.c:249)
==1224==    by 0x131701: peer_connected (peer_control.c:503)
==1224==    by 0x117820: gossip_msg (gossip_control.c:182)
==1224==    by 0x139D97: sd_msg_read (subd.c:500)
==1224==    by 0x139676: read_fds (subd.c:327)
==1224==    by 0x179D52: next_plan (io.c:59)
==1224==    by 0x17A84F: do_plan (io.c:387)
==1224==  Address 0x1ffefffabe is on thread 1's stack
==1224==  in frame #2, created by towire_u16 (towire.c:26)

Followed by:

2018-06-18T21:53:04.129Z lightningd(1224): 03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134 chan #1: Peer permanent failure in CHANNELD_NORMAL: lightning_channeld: received ERROR channel d0101486543e1a8b6871556a4fe1fba4ad4d83ce7f6f92919fd17bd1545d2fd5: UpdateFailMalformedHtlc message doesn't have BADONION bit set

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Saibato pushed a commit that referenced this issue Apr 22, 2019
Don't do this:
  (gdb) bt
  #0  0x00007f37ae667c40 in ?? () from /lib/x86_64-linux-gnu/libz.so.1
  #1  0x00007f37ae668b38 in ?? () from /lib/x86_64-linux-gnu/libz.so.1
  #2  0x00007f37ae669907 in deflate () from /lib/x86_64-linux-gnu/libz.so.1
  #3  0x00007f37ae674c65 in compress2 () from /lib/x86_64-linux-gnu/libz.so.1
  ElementsProject#4  0x000000000040cfe3 in zencode_scids (ctx=0xc1f118, scids=0x2599bc49 "\a\325{", len=176320) at gossipd/gossipd.c:218
  ElementsProject#5  0x000000000040d0b3 in encode_short_channel_ids_end (encoded=0x7fff8f98d9f0, max_bytes=65490) at gossipd/gossipd.c:236
  ElementsProject#6  0x000000000040dd28 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17290511, number_of_blocks=8) at gossipd/gossipd.c:576
  ElementsProject#7  0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17290511, number_of_blocks=16) at gossipd/gossipd.c:595
  ElementsProject#8  0x000000000040ddee in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17290495, number_of_blocks=32) at gossipd/gossipd.c:596
  ElementsProject#9  0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17290495, number_of_blocks=64) at gossipd/gossipd.c:595
  ElementsProject#10 0x000000000040ddee in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17290431, number_of_blocks=128) at gossipd/gossipd.c:596
  ElementsProject#11 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17290431, number_of_blocks=256) at gossipd/gossipd.c:595
  ElementsProject#12 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17290431, number_of_blocks=512) at gossipd/gossipd.c:595
  ElementsProject#13 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17290431, number_of_blocks=1024) at gossipd/gossipd.c:595
  ElementsProject#14 0x000000000040ddee in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17289408, number_of_blocks=2047) at gossipd/gossipd.c:596
  ElementsProject#15 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17289408, number_of_blocks=4095) at gossipd/gossipd.c:595
  ElementsProject#16 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17289408, number_of_blocks=8191) at gossipd/gossipd.c:595
  ElementsProject#17 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17289408, number_of_blocks=16382) at gossipd/gossipd.c:595
  ElementsProject#18 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17289408, number_of_blocks=32764) at gossipd/gossipd.c:595
  ElementsProject#19 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17289408, number_of_blocks=65528) at gossipd/gossipd.c:595
  ElementsProject#20 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17289408, number_of_blocks=131056) at gossipd/gossipd.c:595
  ElementsProject#21 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17289408, number_of_blocks=262112) at gossipd/gossipd.c:595
  ElementsProject#22 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17289408, number_of_blocks=524225) at gossipd/gossipd.c:595
  ElementsProject#23 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17289408, number_of_blocks=1048450) at gossipd/gossipd.c:595
  ElementsProject#24 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17289408, number_of_blocks=2096900) at gossipd/gossipd.c:595
  ElementsProject#25 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17289408, number_of_blocks=4193801) at gossipd/gossipd.c:595
  ElementsProject#26 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17289408, number_of_blocks=8387603) at gossipd/gossipd.c:595
  ElementsProject#27 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=17289408, number_of_blocks=16775207) at gossipd/gossipd.c:595
  ElementsProject#28 0x000000000040ddee in queue_channel_ranges (peer=0x3868fc8, first_blocknum=514201, number_of_blocks=33550414) at gossipd/gossipd.c:596
  ElementsProject#29 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=514201, number_of_blocks=67100829) at gossipd/gossipd.c:595
  ElementsProject#30 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=514201, number_of_blocks=134201659) at gossipd/gossipd.c:595
  ElementsProject#31 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=514201, number_of_blocks=268403318) at gossipd/gossipd.c:595
  ElementsProject#32 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=514201, number_of_blocks=536806636) at gossipd/gossipd.c:595
  ElementsProject#33 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=514201, number_of_blocks=1073613273) at gossipd/gossipd.c:595
  ElementsProject#34 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=514201, number_of_blocks=2147226547) at gossipd/gossipd.c:595
  ElementsProject#35 0x000000000040ddc6 in queue_channel_ranges (peer=0x3868fc8, first_blocknum=514201, number_of_blocks=4294453094) at gossipd/gossipd.c:595
  ElementsProject#36 0x000000000040df26 in handle_query_channel_range (peer=0x3868fc8, msg=0x37e0678 "\001\ao\342\214\n\266\361\263r\301\246\242F\256c\367O\223\036\203e\341Z\b\234h\326\031") at gossipd/gossipd.c:625

The cause was that converting a block number to an scid truncates it
at 24 bits.  When we look through the index from (truncated number) to
(real end number) we get every channel, which is too large to encode,
so we iterate again.

This fixes both that problem, and also the issue that we'd end up
dividing into many empty sections until we get to the highest block
number.  Instead, we just tack the empty blocks on to then end of the
final query.

(My initial version requested 0xFFFFFFFE blocks, but the dev code
which records what blocks were returned can't make a bitmap that big
on 32 bit).

Reported-by: George Vaccaro
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Saibato pushed a commit that referenced this issue Sep 24, 2019
Direct leak of 1024 byte(s) in 2 object(s) allocated from:
    #0 0x7f4c84ce4448 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10c448)
    #1 0x55d11b782c96 in timer_default_alloc ccan/ccan/timer/timer.c:16
    #2 0x55d11b7832b7 in add_level ccan/ccan/timer/timer.c:166
    #3 0x55d11b783864 in timer_fast_forward ccan/ccan/timer/timer.c:334
    ElementsProject#4 0x55d11b78396a in timers_expire ccan/ccan/timer/timer.c:359
    ElementsProject#5 0x55d11b774993 in io_loop ccan/ccan/io/poll.c:395
    ElementsProject#6 0x55d11b72322f in plugins_init lightningd/plugin.c:1013
    ElementsProject#7 0x55d11b7060ea in main lightningd/lightningd.c:664
    ElementsProject#8 0x7f4c84696b6a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26b6a)

To fix this, we actually make 'ld->timers' a pointer, so we can clean
it up last of all.  We can't free it before ld, because that causes
timers to be destroyed.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Saibato pushed a commit that referenced this issue Sep 24, 2019
Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7f4c84ce4448 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10c448)
    #1 0x55d11b77d270 in strmap_add_ ccan/ccan/strmap/strmap.c:90
    #2 0x55d11b704603 in command_set_usage lightningd/jsonrpc.c:891
    #3 0x55d11b733cb5 in param common/param.c:295
    ElementsProject#4 0x55d11b6f7b37 in json_connect lightningd/connect_control.c:96
    ElementsProject#5 0x55d11b7042ef in setup_command_usage lightningd/jsonrpc.c:841
    ElementsProject#6 0x55d11b70443b in jsonrpc_command_add_perm lightningd/jsonrpc.c:863
    ElementsProject#7 0x55d11b704533 in jsonrpc_setup lightningd/jsonrpc.c:876
    ElementsProject#8 0x55d11b705695 in new_lightningd lightningd/lightningd.c:210
    ElementsProject#9 0x55d11b706062 in main lightningd/lightningd.c:644
    ElementsProject#10 0x7f4c84696b6a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26b6a)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Saibato pushed a commit that referenced this issue Sep 24, 2019
Direct leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f4dc279163e in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10c63e)
    #1 0x564ee8a24bb1 in htable_default_alloc ccan/ccan/htable/htable.c:19
    #2 0x564ee8a2551b in double_table ccan/ccan/htable/htable.c:226
    #3 0x564ee8a259e5 in htable_add_ ccan/ccan/htable/htable.c:331
    ElementsProject#4 0x564ee89a5300 in block_map_add lightningd/chaintopology.h:83
    ElementsProject#5 0x564ee89a6ece in add_tip lightningd/chaintopology.c:626
    ElementsProject#6 0x564ee89a72c3 in have_new_block lightningd/chaintopology.c:694
    ElementsProject#7 0x564ee89a3ab0 in process_rawblock lightningd/bitcoind.c:466
    ElementsProject#8 0x564ee89a2fb4 in bcli_finished lightningd/bitcoind.c:214
    ElementsProject#9 0x564ee8a284d6 in destroy_conn ccan/ccan/io/poll.c:244
    ElementsProject#10 0x564ee8a284f6 in destroy_conn_close_fd ccan/ccan/io/poll.c:250
    ElementsProject#11 0x564ee8a34a0d in notify ccan/ccan/tal/tal.c:235
    ElementsProject#12 0x564ee8a34efc in del_tree ccan/ccan/tal/tal.c:397
    ElementsProject#13 0x564ee8a35288 in tal_free ccan/ccan/tal/tal.c:481
    ElementsProject#14 0x564ee8a26cf5 in io_close ccan/ccan/io/io.c:450
    ElementsProject#15 0x564ee8a28c11 in io_loop ccan/ccan/io/poll.c:449
    ElementsProject#16 0x564ee89b3c3b in io_loop_with_timers lightningd/io_loop_with_timers.c:24
    ElementsProject#17 0x564ee89ba540 in main lightningd/lightningd.c:822
    ElementsProject#18 0x7f4dc2143b6a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26b6a)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Saibato pushed a commit that referenced this issue Sep 24, 2019
Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7f7678ee863e in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10c63e)
    #1 0x55f8c7b0fce5 in htable_default_alloc ccan/ccan/htable/htable.c:19
    #2 0x55f8c7b1064f in double_table ccan/ccan/htable/htable.c:226
    #3 0x55f8c7b10b19 in htable_add_ ccan/ccan/htable/htable.c:331
    ElementsProject#4 0x55f8c7afac63 in scriptpubkeyset_add wallet/txfilter.c:30
    ElementsProject#5 0x55f8c7afafce in txfilter_add_scriptpubkey wallet/txfilter.c:77
    ElementsProject#6 0x55f8c7afb05f in txfilter_add_derkey wallet/txfilter.c:91
    ElementsProject#7 0x55f8c7aa4d67 in init_txfilter lightningd/lightningd.c:482
    ElementsProject#8 0x55f8c7aa52d8 in main lightningd/lightningd.c:721
    ElementsProject#9 0x7f767889ab6a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26b6a)

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7f05f389563e in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10c63e)
    #1 0x55cac1e6bc99 in htable_default_alloc ccan/ccan/htable/htable.c:19
    #2 0x55cac1e6c603 in double_table ccan/ccan/htable/htable.c:226
    #3 0x55cac1e6cacd in htable_add_ ccan/ccan/htable/htable.c:331
    ElementsProject#4 0x55cac1e56e48 in outpointset_add wallet/txfilter.c:61
    ElementsProject#5 0x55cac1e57162 in outpointfilter_add wallet/txfilter.c:116
    ElementsProject#6 0x55cac1e5ea3a in wallet_utxoset_add wallet/wallet.c:2365
    ElementsProject#7 0x55cac1deddc2 in topo_add_utxos lightningd/chaintopology.c:603
    ElementsProject#8 0x55cac1dedeac in add_tip lightningd/chaintopology.c:620
    ElementsProject#9 0x55cac1dee2de in have_new_block lightningd/chaintopology.c:694
    ElementsProject#10 0x55cac1deaab0 in process_rawblock lightningd/bitcoind.c:466
    ElementsProject#11 0x55cac1de9fb4 in bcli_finished lightningd/bitcoind.c:214
    ElementsProject#12 0x55cac1e6f5be in destroy_conn ccan/ccan/io/poll.c:244
    ElementsProject#13 0x55cac1e6f5de in destroy_conn_close_fd ccan/ccan/io/poll.c:250
    ElementsProject#14 0x55cac1e7baf5 in notify ccan/ccan/tal/tal.c:235
    ElementsProject#15 0x55cac1e7bfe4 in del_tree ccan/ccan/tal/tal.c:397
    ElementsProject#16 0x55cac1e7c370 in tal_free ccan/ccan/tal/tal.c:481
    ElementsProject#17 0x55cac1e6dddd in io_close ccan/ccan/io/io.c:450
    ElementsProject#18 0x55cac1e6fcf9 in io_loop ccan/ccan/io/poll.c:449
    ElementsProject#19 0x55cac1dfac66 in io_loop_with_timers lightningd/io_loop_with_timers.c:24
    ElementsProject#20 0x55cac1e0156b in main lightningd/lightningd.c:822
    ElementsProject#21 0x7f05f3247b6a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26b6a)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Saibato pushed a commit that referenced this issue Sep 24, 2019
Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7ff02889063e in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10c63e)
    #1 0x555ce2ad8d2e in htable_default_alloc ccan/ccan/htable/htable.c:19
    #2 0x555ce2ad9698 in double_table ccan/ccan/htable/htable.c:226
    #3 0x555ce2ad9b62 in htable_add_ ccan/ccan/htable/htable.c:331
    ElementsProject#4 0x555ce2a638e4 in htlc_in_map_add lightningd/htlc_end.h:113
    ElementsProject#5 0x555ce2a63beb in connect_htlc_in lightningd/htlc_end.c:39
    ElementsProject#6 0x555ce2a85cbc in channel_added_their_htlc lightningd/peer_htlcs.c:1382
    ElementsProject#7 0x555ce2a860e1 in peer_got_commitsig lightningd/peer_htlcs.c:1466
    ElementsProject#8 0x555ce2a5db04 in channel_msg lightningd/channel_control.c:228
    ElementsProject#9 0x555ce2a8d393 in sd_msg_read lightningd/subd.c:474
    ElementsProject#10 0x555ce2ada157 in next_plan ccan/ccan/io/io.c:59
    ElementsProject#11 0x555ce2adacd4 in do_plan ccan/ccan/io/io.c:407
    ElementsProject#12 0x555ce2adad12 in io_ready ccan/ccan/io/io.c:417
    ElementsProject#13 0x555ce2adcd67 in io_loop ccan/ccan/io/poll.c:445
    ElementsProject#14 0x555ce2a67c66 in io_loop_with_timers lightningd/io_loop_with_timers.c:24
    ElementsProject#15 0x555ce2a6e56b in main lightningd/lightningd.c:822
    ElementsProject#16 0x7ff028242b6a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26b6a)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Saibato pushed a commit that referenced this issue Jun 9, 2020
We didn't wait until l2 processed the final state of HTLC #2, so
it might not include it when it drops onchain, leading to us only
getting 3 (not 4) sendrawtx calls.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
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

No branches or pull requests

1 participant