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

splitting listpees: closing tests error 2 #2

Closed
vincenzopalazzo opened this issue Aug 25, 2022 · 1 comment
Closed

splitting listpees: closing tests error 2 #2

vincenzopalazzo opened this issue Aug 25, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@vincenzopalazzo
Copy link
Owner

Command run

make -j$(nproc) check DEVELOPER=1 EXPERIMENTAL_DUAL_FUND=0 VALGRIND=0 PYTEST_OPTS="-k test_segwit_shutdown_script --log-cli-level=INFO"

Error receiving

lightningd-33 2022-08-25T18:16:11.403Z INFO    0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-chan#1: Peer transient failure in CHANNELD_AWAITING_LOCKIN: channeld: Owning subdaemon channeld died (62208)
lightningd-37 2022-08-25T18:16:11.487Z DEBUG   gossipd: seeker: no peers, waiting
lightningd-31 2022-08-25T18:16:11.839Z DEBUG   gossipd: seeker: no peers, waiting
lightningd-30 2022-08-25T18:16:11.843Z DEBUG   gossipd: seeker: no peers, waiting
lightningd-1 2022-08-25T18:16:12.386Z INFO    03c359975b2f3791ac3c38c91f827689a3ddf143f8e0910aae3e0fa6d3d9c97dca-chan#6: Owning subdaemon openingd died (62208)
lightningd-1 2022-08-25T18:16:12.390Z DEBUG   plugin-autoclean: Killing plugin: exited during normal operation
lightningd-1 2022-08-25T18:16:12.390Z DEBUG   plugin-bcli: Killing plugin: exited during normal operation
lightningd-1 2022-08-25T18:16:12.390Z DEBUG   plugin-commando: Killing plugin: exited during normal operation
lightningd-1 2022-08-25T18:16:12.391Z DEBUG   plugin-funder: Killing plugin: exited during normal operation
lightningd-1 2022-08-25T18:16:12.391Z DEBUG   plugin-topology: Killing plugin: exited during normal operation
lightningd-1 2022-08-25T18:16:12.391Z DEBUG   plugin-keysend: Killing plugin: exited during normal operation
lightningd-1 2022-08-25T18:16:12.391Z DEBUG   plugin-offers: Killing plugin: exited during normal operation
lightningd-1 2022-08-25T18:16:12.391Z DEBUG   plugin-pay: Killing plugin: exited during normal operation
lightningd-1 2022-08-25T18:16:12.391Z DEBUG   plugin-txprepare: Killing plugin: exited during normal operation
lightningd-1 2022-08-25T18:16:12.391Z DEBUG   plugin-spenderp: Killing plugin: exited during normal operation
lightningd-1 2022-08-25T18:16:12.392Z DEBUG   plugin-chanbackup: Killing plugin: exited during normal operation
lightningd-1 2022-08-25T18:16:12.392Z DEBUG   lightningd: io_break: destroy_plugin
----------------------------------------------------------- Captured stderr call -----------------------------------------------------------
bookkeeper: FATAL SIGNAL 11 (version v0.12.0-17-g149cf25)
0x5636ccaa5a2a send_backtrace
	common/daemon.c:33
0x5636ccaa5ad4 crashdump
	common/daemon.c:46
0x7f28980f708f ???
	/build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x5636cca7e1cc new_missed_channel_account
	plugins/bkpr/bookkeeper.c:637
0x5636cca7edec listpeers_multi_done
	plugins/bkpr/bookkeeper.c:880
0x5636cca8c845 handle_rpc_reply
	plugins/libplugin.c:695
0x5636cca8d325 rpc_read_response_one
	plugins/libplugin.c:868
0x5636cca8d45b rpc_conn_read_response
	plugins/libplugin.c:888
0x5636ccb32479 next_plan
	ccan/ccan/io/io.c:59
0x5636ccb33081 do_plan
	ccan/ccan/io/io.c:407
0x5636ccb330c3 io_ready
	ccan/ccan/io/io.c:417
0x5636ccb353b6 io_loop
	ccan/ccan/io/poll.c:453
0x5636cca90107 plugin_main
	plugins/libplugin.c:1710
0x5636cca819cf main
	plugins/bkpr/bookkeeper.c:1869
0x7f28980d8082 __libc_start_main
	../csu/libc-start.c:308
0x5636cca7a34d ???
	???:0
0xffffffffffffffff ???
	???:0
bookkeeper: FATAL SIGNAL 11 (version v0.12.0-17-g149cf25)
0x5626300a5a2a send_backtrace
	common/daemon.c:33
0x5626300a5ad4 crashdump
	common/daemon.c:46
0x7fc482d7b08f ???
	/build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x56263007e1cc new_missed_channel_account
	plugins/bkpr/bookkeeper.c:637
0x56263007edec listpeers_multi_done
	plugins/bkpr/bookkeeper.c:880
0x56263008c845 handle_rpc_reply
	plugins/libplugin.c:695
0x56263008d325 rpc_read_response_one
	plugins/libplugin.c:868
0x56263008d45b rpc_conn_read_response
	plugins/libplugin.c:888
0x562630132479 next_plan
	ccan/ccan/io/io.c:59
0x562630133081 do_plan
	ccan/ccan/io/io.c:407
0x5626301330c3 io_ready
	ccan/ccan/io/io.c:417
0x5626301353b6 io_loop
	ccan/ccan/io/poll.c:453
0x562630090107 plugin_main
	plugins/libplugin.c:1710
0x5626300819cf main
	plugins/bkpr/bookkeeper.c:1869
0x7fc482d5c082 __libc_start_main
	../csu/libc-start.c:308
0x56263007a34d ???
	???:0
0xffffffffffffffff ???
	???:0
bookkeeper: FATAL SIGNAL 11 (version v0.12.0-17-g149cf25)
0x55c0be24ca2a send_backtrace
	common/daemon.c:33
0x55c0be24cad4 crashdump
	common/daemon.c:46
0x7effa0f0f08f ???
	/build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x55c0be2251cc new_missed_channel_account
	plugins/bkpr/bookkeeper.c:637
0x55c0be225dec listpeers_multi_done
	plugins/bkpr/bookkeeper.c:880
0x55c0be233845 handle_rpc_reply
	plugins/libplugin.c:695
0x55c0be234325 rpc_read_response_one
	plugins/libplugin.c:868
0x55c0be23445b rpc_conn_read_response
	plugins/libplugin.c:888
0x55c0be2d9479 next_plan
	ccan/ccan/io/io.c:59
0x55c0be2da081 do_plan
	ccan/ccan/io/io.c:407
0x55c0be2da0c3 io_ready
	ccan/ccan/io/io.c:417
0x55c0be2dc3b6 io_loop
	ccan/ccan/io/poll.c:453
0x55c0be237107 plugin_main
	plugins/libplugin.c:1710
0x55c0be2289cf main
	plugins/bkpr/bookkeeper.c:1869
0x7effa0ef0082 __libc_start_main
	../csu/libc-start.c:308
0x55c0be22134d ???
	???:0
0xffffffffffffffff ???
	???:0
bookkeeper: FATAL SIGNAL 11 (version v0.12.0-17-g149cf25)
0x5639d0955a2a send_backtrace
	common/daemon.c:33
0x5639d0955ad4 crashdump
	common/daemon.c:46
0x7f35be9c408f ???
	/build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x5639d092e1cc new_missed_channel_account
	plugins/bkpr/bookkeeper.c:637
0x5639d092edec listpeers_multi_done
	plugins/bkpr/bookkeeper.c:880
0x5639d093c845 handle_rpc_reply
	plugins/libplugin.c:695
0x5639d093d325 rpc_read_response_one
	plugins/libplugin.c:868
0x5639d093d45b rpc_conn_read_response
	plugins/libplugin.c:888
0x5639d09e2479 next_plan
	ccan/ccan/io/io.c:59
0x5639d09e3081 do_plan
	ccan/ccan/io/io.c:407
0x5639d09e30c3 io_ready
	ccan/ccan/io/io.c:417
0x5639d09e53b6 io_loop
	ccan/ccan/io/poll.c:453
0x5639d0940107 plugin_main
	plugins/libplugin.c:1710
0x5639d09319cf main
	plugins/bkpr/bookkeeper.c:1869
0x7f35be9a5082 __libc_start_main
	../csu/libc-start.c:308
0x5639d092a34d ???
	???:0
0xffffffffffffffff ???
	???:0
bookkeeper: FATAL SIGNAL 11 (version v0.12.0-17-g149cf25)
0x56191fdf1a2a send_backtrace
	common/daemon.c:33
0x56191fdf1ad4 crashdump
	common/daemon.c:46
0x7f2616dd108f ???
	/build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x56191fdca1cc new_missed_channel_account
	plugins/bkpr/bookkeeper.c:637
0x56191fdcadec listpeers_multi_done
	plugins/bkpr/bookkeeper.c:880
0x56191fdd8845 handle_rpc_reply
	plugins/libplugin.c:695
0x56191fdd9325 rpc_read_response_one
	plugins/libplugin.c:868
0x56191fdd945b rpc_conn_read_response
	plugins/libplugin.c:888
0x56191fe7e479 next_plan
	ccan/ccan/io/io.c:59
0x56191fe7f081 do_plan
	ccan/ccan/io/io.c:407
0x56191fe7f0c3 io_ready
	ccan/ccan/io/io.c:417
0x56191fe813b6 io_loop
	ccan/ccan/io/poll.c:453
0x56191fddc107 plugin_main
	plugins/libplugin.c:1710
0x56191fdcd9cf main
	plugins/bkpr/bookkeeper.c:1869
0x7f2616db2082 __libc_start_main
	../csu/libc-start.c:308
0x56191fdc634d ???
	???:0
0xffffffffffffffff ???
	???:0

@vincenzopalazzo vincenzopalazzo added the bug Something isn't working label Aug 25, 2022
@vincenzopalazzo
Copy link
Owner Author

Fixed 9cd6f10

vincenzopalazzo added a commit that referenced this issue Feb 13, 2023
This will fix a crash that I caused on armv7
and by looking inside the coredump with gdb
(by adding an assert on n that must be
different from null) I get the following stacktrace

```
(gdb) bt
\#0  0x00000000 in ?? ()
\#1  0x0043a038 in send_backtrace (why=0xbe9e3600 "FATAL SIGNAL 11") at common/daemon.c:36
\#2  0x0043a0ec in crashdump (sig=11) at common/daemon.c:46
\#3  <signal handler called>
\#4  0x00406d04 in node_announcement (map=0x938ecc, nann_off=495146) at common/gossmap.c:586
\#5  0x00406fec in map_catchup (map=0x938ecc, num_rejected=0xbe9e3a40) at common/gossmap.c:643
\#6  0x004073a4 in load_gossip_store (map=0x938ecc, num_rejected=0xbe9e3a40) at common/gossmap.c:697
\ElementsProject#7  0x00408244 in gossmap_load (ctx=0x0, filename=0x4e16b8 "gossip_store", num_channel_updates_rejected=0xbe9e3a40) at common/gossmap.c:976
\ElementsProject#8  0x0041a548 in init (p=0x93831c, buf=0x9399d4 "\n\n{\"jsonrpc\":\"2.0\",\"id\":\"cln:init#25\",\"method\":\"init\",\"params\":{\"options\":{},\"configuration\":{\"lightning-dir\":\"/home/vincent/.lightning/testnet\",\"rpc-file\":\"lightning-rpc\",\"startup\":true,\"network\":\"te"..., config=0x939cdc) at plugins/topology.c:622
\ElementsProject#9  0x0041e5d0 in handle_init (cmd=0x938934, buf=0x9399d4 "\n\n{\"jsonrpc\":\"2.0\",\"id\":\"cln:init#25\",\"method\":\"init\",\"params\":{\"options\":{},\"configuration\":{\"lightning-dir\":\"/home/vincent/.lightning/testnet\",\"rpc-file\":\"lightning-rpc\",\"startup\":true,\"network\":\"te"..., params=0x939c8c)
    at plugins/libplugin.c:1208
\ElementsProject#10 0x0041fc04 in ld_command_handle (plugin=0x93831c, toks=0x939bec) at plugins/libplugin.c:1572
\ElementsProject#11 0x00420050 in ld_read_json_one (plugin=0x93831c) at plugins/libplugin.c:1667
\ElementsProject#12 0x004201bc in ld_read_json (conn=0x9391c4, plugin=0x93831c) at plugins/libplugin.c:1687
\ElementsProject#13 0x004cb82c in next_plan (conn=0x9391c4, plan=0x9391d8) at ccan/ccan/io/io.c:59
\ElementsProject#14 0x004cc67c in do_plan (conn=0x9391c4, plan=0x9391d8, idle_on_epipe=false) at ccan/ccan/io/io.c:407
\ElementsProject#15 0x004cc6dc in io_ready (conn=0x9391c4, pollflags=1) at ccan/ccan/io/io.c:417
\ElementsProject#16 0x004cf8cc in io_loop (timers=0x9383c4, expired=0xbe9e3ce4) at ccan/ccan/io/poll.c:453
\ElementsProject#17 0x00420af4 in plugin_main (argv=0xbe9e3eb4, init=0x41a46c <init>, restartability=PLUGIN_STATIC, init_rpc=true, features=0x0, commands=0x6167e8 <commands>, num_commands=4, notif_subs=0x0, num_notif_subs=0, hook_subs=0x0, num_hook_subs=0, notif_topics=0x0, num_notif_topics=0) at plugins/libplugin.c:1891
\ElementsProject#18 0x0041a6f8 in main (argc=1, argv=0xbe9e3eb4) at plugins/topology.c:679
```

I do not know if this is a solution because I do not know
when I can parse a node announcement for a node that
it is not longer in the gossip map.

So, I hope this is just usefult for @rustyrussell

Changelog-Fixes: fixes `FATAL SIGNAL 11` on gossmap node announcement parsing.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo added a commit that referenced this issue Feb 13, 2023
This will fix a crash that I caused on armv7
and by looking inside the coredump with gdb
(by adding an assert on n that must be
different from null) I get the following stacktrace

```
(gdb) bt
\#0  0x00000000 in ?? ()
\#1  0x0043a038 in send_backtrace (why=0xbe9e3600 "FATAL SIGNAL 11") at common/daemon.c:36
\#2  0x0043a0ec in crashdump (sig=11) at common/daemon.c:46
\#3  <signal handler called>
\#4  0x00406d04 in node_announcement (map=0x938ecc, nann_off=495146) at common/gossmap.c:586
\#5  0x00406fec in map_catchup (map=0x938ecc, num_rejected=0xbe9e3a40) at common/gossmap.c:643
\#6  0x004073a4 in load_gossip_store (map=0x938ecc, num_rejected=0xbe9e3a40) at common/gossmap.c:697
\ElementsProject#7  0x00408244 in gossmap_load (ctx=0x0, filename=0x4e16b8 "gossip_store", num_channel_updates_rejected=0xbe9e3a40) at common/gossmap.c:976
\ElementsProject#8  0x0041a548 in init (p=0x93831c, buf=0x9399d4 "\n\n{\"jsonrpc\":\"2.0\",\"id\":\"cln:init#25\",\"method\":\"init\",\"params\":{\"options\":{},\"configuration\":{\"lightning-dir\":\"/home/vincent/.lightning/testnet\",\"rpc-file\":\"lightning-rpc\",\"startup\":true,\"network\":\"te"..., config=0x939cdc) at plugins/topology.c:622
\ElementsProject#9  0x0041e5d0 in handle_init (cmd=0x938934, buf=0x9399d4 "\n\n{\"jsonrpc\":\"2.0\",\"id\":\"cln:init#25\",\"method\":\"init\",\"params\":{\"options\":{},\"configuration\":{\"lightning-dir\":\"/home/vincent/.lightning/testnet\",\"rpc-file\":\"lightning-rpc\",\"startup\":true,\"network\":\"te"..., params=0x939c8c)
    at plugins/libplugin.c:1208
\ElementsProject#10 0x0041fc04 in ld_command_handle (plugin=0x93831c, toks=0x939bec) at plugins/libplugin.c:1572
\ElementsProject#11 0x00420050 in ld_read_json_one (plugin=0x93831c) at plugins/libplugin.c:1667
\ElementsProject#12 0x004201bc in ld_read_json (conn=0x9391c4, plugin=0x93831c) at plugins/libplugin.c:1687
\ElementsProject#13 0x004cb82c in next_plan (conn=0x9391c4, plan=0x9391d8) at ccan/ccan/io/io.c:59
\ElementsProject#14 0x004cc67c in do_plan (conn=0x9391c4, plan=0x9391d8, idle_on_epipe=false) at ccan/ccan/io/io.c:407
\ElementsProject#15 0x004cc6dc in io_ready (conn=0x9391c4, pollflags=1) at ccan/ccan/io/io.c:417
\ElementsProject#16 0x004cf8cc in io_loop (timers=0x9383c4, expired=0xbe9e3ce4) at ccan/ccan/io/poll.c:453
\ElementsProject#17 0x00420af4 in plugin_main (argv=0xbe9e3eb4, init=0x41a46c <init>, restartability=PLUGIN_STATIC, init_rpc=true, features=0x0, commands=0x6167e8 <commands>, num_commands=4, notif_subs=0x0, num_notif_subs=0, hook_subs=0x0, num_hook_subs=0, notif_topics=0x0, num_notif_topics=0) at plugins/libplugin.c:1891
\ElementsProject#18 0x0041a6f8 in main (argc=1, argv=0xbe9e3eb4) at plugins/topology.c:679
```

I do not know if this is a solution because I do not know
when I can parse a node announcement for a node that
it is not longer in the gossip map.

So, I hope this is just usefult for @rustyrussell

Changelog-Fix: fixes `FATAL SIGNAL 11` on gossmap node announcement parsing.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo added a commit that referenced this issue Feb 13, 2023
This will fix a crash that I caused on armv7
and by looking inside the coredump with gdb
(by adding an assert on n that must be
different from null) I get the following stacktrace

```
(gdb) bt
\#0  0x00000000 in ?? ()
\#1  0x0043a038 in send_backtrace (why=0xbe9e3600 "FATAL SIGNAL 11") at common/daemon.c:36
\#2  0x0043a0ec in crashdump (sig=11) at common/daemon.c:46
\#3  <signal handler called>
\#4  0x00406d04 in node_announcement (map=0x938ecc, nann_off=495146) at common/gossmap.c:586
\#5  0x00406fec in map_catchup (map=0x938ecc, num_rejected=0xbe9e3a40) at common/gossmap.c:643
\#6  0x004073a4 in load_gossip_store (map=0x938ecc, num_rejected=0xbe9e3a40) at common/gossmap.c:697
\ElementsProject#7  0x00408244 in gossmap_load (ctx=0x0, filename=0x4e16b8 "gossip_store", num_channel_updates_rejected=0xbe9e3a40) at common/gossmap.c:976
\ElementsProject#8  0x0041a548 in init (p=0x93831c, buf=0x9399d4 "\n\n{\"jsonrpc\":\"2.0\",\"id\":\"cln:init#25\",\"method\":\"init\",\"params\":{\"options\":{},\"configuration\":{\"lightning-dir\":\"/home/vincent/.lightning/testnet\",\"rpc-file\":\"lightning-rpc\",\"startup\":true,\"network\":\"te"..., config=0x939cdc) at plugins/topology.c:622
\ElementsProject#9  0x0041e5d0 in handle_init (cmd=0x938934, buf=0x9399d4 "\n\n{\"jsonrpc\":\"2.0\",\"id\":\"cln:init#25\",\"method\":\"init\",\"params\":{\"options\":{},\"configuration\":{\"lightning-dir\":\"/home/vincent/.lightning/testnet\",\"rpc-file\":\"lightning-rpc\",\"startup\":true,\"network\":\"te"..., params=0x939c8c)
    at plugins/libplugin.c:1208
\ElementsProject#10 0x0041fc04 in ld_command_handle (plugin=0x93831c, toks=0x939bec) at plugins/libplugin.c:1572
\ElementsProject#11 0x00420050 in ld_read_json_one (plugin=0x93831c) at plugins/libplugin.c:1667
\ElementsProject#12 0x004201bc in ld_read_json (conn=0x9391c4, plugin=0x93831c) at plugins/libplugin.c:1687
\ElementsProject#13 0x004cb82c in next_plan (conn=0x9391c4, plan=0x9391d8) at ccan/ccan/io/io.c:59
\ElementsProject#14 0x004cc67c in do_plan (conn=0x9391c4, plan=0x9391d8, idle_on_epipe=false) at ccan/ccan/io/io.c:407
\ElementsProject#15 0x004cc6dc in io_ready (conn=0x9391c4, pollflags=1) at ccan/ccan/io/io.c:417
\ElementsProject#16 0x004cf8cc in io_loop (timers=0x9383c4, expired=0xbe9e3ce4) at ccan/ccan/io/poll.c:453
\ElementsProject#17 0x00420af4 in plugin_main (argv=0xbe9e3eb4, init=0x41a46c <init>, restartability=PLUGIN_STATIC, init_rpc=true, features=0x0, commands=0x6167e8 <commands>, num_commands=4, notif_subs=0x0, num_notif_subs=0, hook_subs=0x0, num_hook_subs=0, notif_topics=0x0, num_notif_topics=0) at plugins/libplugin.c:1891
\ElementsProject#18 0x0041a6f8 in main (argc=1, argv=0xbe9e3eb4) at plugins/topology.c:679
```

I do not know if this is a solution because I do not know
when I can parse a node announcement for a node that
it is not longer in the gossip map.

So, I hope this is just usefult for @rustyrussell

Changelog-Fixed: fixes `FATAL SIGNAL 11` on gossmap node announcement parsing.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo added a commit that referenced this issue Feb 22, 2023
This will fix a crash that I caused on armv7
and by looking inside the coredump with gdb
(by adding an assert on n that must be
different from null) I get the following stacktrace

```
(gdb) bt
\#0  0x00000000 in ?? ()
\#1  0x0043a038 in send_backtrace (why=0xbe9e3600 "FATAL SIGNAL 11") at common/daemon.c:36
\#2  0x0043a0ec in crashdump (sig=11) at common/daemon.c:46
\#3  <signal handler called>
\#4  0x00406d04 in node_announcement (map=0x938ecc, nann_off=495146) at common/gossmap.c:586
\#5  0x00406fec in map_catchup (map=0x938ecc, num_rejected=0xbe9e3a40) at common/gossmap.c:643
\#6  0x004073a4 in load_gossip_store (map=0x938ecc, num_rejected=0xbe9e3a40) at common/gossmap.c:697
\ElementsProject#7  0x00408244 in gossmap_load (ctx=0x0, filename=0x4e16b8 "gossip_store", num_channel_updates_rejected=0xbe9e3a40) at common/gossmap.c:976
\ElementsProject#8  0x0041a548 in init (p=0x93831c, buf=0x9399d4 "\n\n{\"jsonrpc\":\"2.0\",\"id\":\"cln:init#25\",\"method\":\"init\",\"params\":{\"options\":{},\"configuration\":{\"lightning-dir\":\"/home/vincent/.lightning/testnet\",\"rpc-file\":\"lightning-rpc\",\"startup\":true,\"network\":\"te"..., config=0x939cdc) at plugins/topology.c:622
\ElementsProject#9  0x0041e5d0 in handle_init (cmd=0x938934, buf=0x9399d4 "\n\n{\"jsonrpc\":\"2.0\",\"id\":\"cln:init#25\",\"method\":\"init\",\"params\":{\"options\":{},\"configuration\":{\"lightning-dir\":\"/home/vincent/.lightning/testnet\",\"rpc-file\":\"lightning-rpc\",\"startup\":true,\"network\":\"te"..., params=0x939c8c)
    at plugins/libplugin.c:1208
\ElementsProject#10 0x0041fc04 in ld_command_handle (plugin=0x93831c, toks=0x939bec) at plugins/libplugin.c:1572
\ElementsProject#11 0x00420050 in ld_read_json_one (plugin=0x93831c) at plugins/libplugin.c:1667
\ElementsProject#12 0x004201bc in ld_read_json (conn=0x9391c4, plugin=0x93831c) at plugins/libplugin.c:1687
\ElementsProject#13 0x004cb82c in next_plan (conn=0x9391c4, plan=0x9391d8) at ccan/ccan/io/io.c:59
\ElementsProject#14 0x004cc67c in do_plan (conn=0x9391c4, plan=0x9391d8, idle_on_epipe=false) at ccan/ccan/io/io.c:407
\ElementsProject#15 0x004cc6dc in io_ready (conn=0x9391c4, pollflags=1) at ccan/ccan/io/io.c:417
\ElementsProject#16 0x004cf8cc in io_loop (timers=0x9383c4, expired=0xbe9e3ce4) at ccan/ccan/io/poll.c:453
\ElementsProject#17 0x00420af4 in plugin_main (argv=0xbe9e3eb4, init=0x41a46c <init>, restartability=PLUGIN_STATIC, init_rpc=true, features=0x0, commands=0x6167e8 <commands>, num_commands=4, notif_subs=0x0, num_notif_subs=0, hook_subs=0x0, num_hook_subs=0, notif_topics=0x0, num_notif_topics=0) at plugins/libplugin.c:1891
\ElementsProject#18 0x0041a6f8 in main (argc=1, argv=0xbe9e3eb4) at plugins/topology.c:679
```

I do not know if this is a solution because I do not know
when I can parse a node announcement for a node that
it is not longer in the gossip map.

So, I hope this is just usefult for @rustyrussell

Changelog-Fixed: fixes `FATAL SIGNAL 11` on gossmap node announcement parsing.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo pushed a commit that referenced this issue Mar 23, 2023
The issue is that common_setup() wasn't called by the fuzz target,
leaving secp256k1_ctx as NULL.

UBSan error:

$ UBSAN_OPTIONS="print_stacktrace=1:halt_on_error=1" \
    ./fuzz-channel_id crash-1575b41ef09e62e4c09c165e6dc037a110b113f2

INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 1153355603
INFO: Loaded 1 modules   (25915 inline 8-bit counters): 25915 [0x563bae7ac3a8, 0x563bae7b28e3),
INFO: Loaded 1 PC tables (25915 PCs): 25915 [0x563bae7b28e8,0x563bae817c98),
./fuzz-channel_id: Running 1 inputs 1 time(s) each.
Running: crash-1575b41ef09e62e4c09c165e6dc037a110b113f2
bitcoin/pubkey.c:22:33: runtime error: null pointer passed as argument 1, which is declared to never be null
external/libwally-core/src/secp256k1/include/secp256k1.h:373:3: note: nonnull attribute specified here
    #0 0x563bae41e3db in pubkey_from_der bitcoin/pubkey.c:19:7
    #1 0x563bae4205e0 in fromwire_pubkey bitcoin/pubkey.c:111:7
    #2 0x563bae46437c in run tests/fuzz/fuzz-channel_id.c:42:3
    #3 0x563bae2f6016 in LLVMFuzzerTestOneInput tests/fuzz/libfuzz.c:23:2
    #4 0x563bae20a450 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long)
    #5 0x563bae1f4c3f in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long)
    #6 0x563bae1fa6e6 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long))
    ElementsProject#7 0x563bae223052 in main (tests/fuzz/fuzz-channel_id+0x181052) (BuildId: f7f56e14ffc06df54ab732d79ea922e773de1f25)
    ElementsProject#8 0x7fa7fa113082 in __libc_start_main
    ElementsProject#9 0x563bae1efbdd in _start

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior bitcoin/pubkey.c:22:33 in
vincenzopalazzo pushed a commit that referenced this issue Jun 7, 2023
The function is tiny and was only used in one location. And that one
location was leaking memory.

Detected by ASan:

==2637667==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 7 byte(s) in 1 object(s) allocated from:
    #0 0x4cd758 in __interceptor_strdup
    #1 0x64c70c in json_stream_log_suppress_for_cmd lightning/lightningd/jsonrpc.c:597:31
    #2 0x68a630 in json_getlog lightning/lightningd/log.c:974:2
    ...

SUMMARY: AddressSanitizer: 7 byte(s) leaked in 1 allocation(s).
vincenzopalazzo pushed a commit that referenced this issue Jun 7, 2023
It is possible for db_column_bytes() to return 0 and for
db_column_blob() to return NULL even when db_column_is_null() returns
false. We need to short circuit in this case.

Detected by UBSan:

  db/bindings.c:479:12: runtime error: null pointer passed as argument 2, which is declared to never be null
  /usr/include/string.h:44:28: note: nonnull attribute specified here

  #0 0x95f117 in db_col_arr_ db/bindings.c:479:2
  #1 0x95ef85 in db_col_channel_type db/bindings.c:459:32
  #2 0x852c03 in wallet_stmt2channel wallet/wallet.c:1483:9
  #3 0x81f396 in wallet_channels_load_active wallet/wallet.c:1749:23
  #4 0x81f03d in wallet_init_channels wallet/wallet.c:1765:9
  #5 0x72f1f9 in load_channels_from_wallet lightningd/peer_control.c:2257:7
  #6 0x672856 in main lightningd/lightningd.c:1121:25
vincenzopalazzo pushed a commit that referenced this issue Jun 7, 2023
Fixes nullability errors detected by UBSan:

wire/fromwire.c:173:46: runtime error: null pointer passed as argument 1, which is declared to never be null
external/libwally-core/src/secp256k1/include/secp256k1.h:432:3: note: nonnull attribute specified here
    #0 0x65214a in fromwire_secp256k1_ecdsa_signature wire/fromwire.c:173:6
    #1 0x659500 in printwire_secp256k1_ecdsa_signature devtools/print_wire.c:331:1
    #2 0x646ba2 in printwire_channel_update wire/peer_printgen.c:1900:7
    #3 0x637182 in printpeer_wire_message wire/peer_printgen.c:128:11
    #4 0x65a097 in main devtools/decodemsg.c:85:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant