ElementsProject / lightning

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

pytest macos fail #6438

Open rustyrussell opened 1 year ago

rustyrussell commented 1 year ago

Looks like separate IPv6 and IPv4 listening sockets don't work as expected (fd 6 is the listening IPv4 socket):

**BROKEN**: connectd: dev_report_fds: 5 open but unowned?

Reported-by: @adi2011

rustyrussell commented 1 year ago

Hmm, I thought this must be an ipv4 & ipv6 socket thing (on Linux binding ipv6 does ipv4 too, by default), but when I turned that off using echo 1 | sudo tee /proc/sys/net/ipv6/bindv6only, it still worked:

lightningd-1 2023-07-27T04:36:23.979Z INFO    connectd: dev_report_fds: 3 -> hsm fd
lightningd-1 2023-07-27T04:36:23.979Z INFO    connectd: dev_report_fds: 4 -> gossipd fd
lightningd-1 2023-07-27T04:36:23.979Z INFO    connectd: dev_report_fds: 5 -> listener (connection_in)
lightningd-1 2023-07-27T04:36:23.979Z INFO    connectd: dev_report_fds: 5 name IPv6 socket :::34571
lightningd-1 2023-07-27T04:36:23.979Z INFO    connectd: dev_report_fds: 6 -> listener (connection_in)
lightningd-1 2023-07-27T04:36:23.979Z INFO    connectd: dev_report_fds: 6 name IPv4 socket 0.0.0.0:34571

So this will need direct investigation! Probably by: mv lightningd/lightning_connectd{,.real} && echo 'exec strace -o /tmp/out.$$ "$0.real" "$@"' > lightningd/lightning_connectd which replaces connectd with a wrapper. Run a simple test like: "tests/test_invoices.py::test_invoice_zeroval" and send the value of /tmp/out.$$ which should appear. Then we'll know what fd 5 is...