profile
viewpoint
Christian Decker cdecker @Blockstream Zurich, Switzerland http://snyke.net

cdecker/btcresearch 98

CABRA — Comprehensive Academic Bitcoin Research Archive

cdecker/lightning-integration 67

Lightning Integration Testing Framework

cdecker/kugelblitz 17

Controlling lightning

cdecker/BitDroid-Network 11

A Bitcoin network protocol implementation

cdecker/lightning 11

Lightning network

cdecker/docker-bitcoin-dev 7

Docker images for Bitcoin developers

cdecker/bips 4

Bitcoin Improvement Proposals

cdecker/bitcoin 4

Bitcoin integration/staging tree

pull request commentElementsProject/lightning

ci: Switch to Github Actions and remove Travis CI

Tried rerunning, and it breaks in different ways every time. I can't see how to run a single job, it only lets me do them all :(

cdecker

comment created time in an hour

PR opened ElementsProject/lightning

connectd: don't crash if connect() fails immediately. bug crash

Took me a while (stressing under valgrind) to reproduce this, then longer to figure out how it happened.

Turns out io_new_conn() can fail if the init function fails. In our case, this can happen if connect() immediately returns an error (inside io_connect). But we've already set the finish function, which (if this was the last address), will free connect, making the assignment connect->conn = ... write to a freed address.

Either way, if it fails, try_connect_one_addr() has taken care to update connect->conn, or free connect, and the caller should not do it.

Here's the valgrind trace:

==384981== Invalid write of size 8
==384981==    at 0x11127C: try_connect_one_addr (connectd.c:880)
==384981==    by 0x112BA1: destroy_io_conn (connectd.c:708)
==384981==    by 0x141459: destroy_conn (poll.c:244)
==384981==    by 0x14147F: destroy_conn_close_fd (poll.c:250)
==384981==    by 0x149EB9: notify (tal.c:240)
==384981==    by 0x149F8B: del_tree (tal.c:402)
==384981==    by 0x14A51A: tal_free (tal.c:486)
==384981==    by 0x140036: io_close (io.c:450)
==384981==    by 0x1400B3: do_plan (io.c:401)
==384981==    by 0x140134: io_ready (io.c:423)
==384981==    by 0x141A57: io_loop (poll.c:445)
==384981==    by 0x112CB0: main (connectd.c:1703)
==384981==  Address 0x4d67020 is 64 bytes inside a block of size 160 free'd
==384981==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==384981==    by 0x14A020: del_tree (tal.c:421)
==384981==    by 0x14A51A: tal_free (tal.c:486)
==384981==    by 0x1110C5: try_connect_one_addr (connectd.c:806)
==384981==    by 0x112BA1: destroy_io_conn (connectd.c:708)
==384981==    by 0x141459: destroy_conn (poll.c:244)
==384981==    by 0x14147F: destroy_conn_close_fd (poll.c:250)
==384981==    by 0x149EB9: notify (tal.c:240)
==384981==    by 0x149F8B: del_tree (tal.c:402)
==384981==    by 0x14A51A: tal_free (tal.c:486)
==384981==    by 0x140036: io_close (io.c:450)
==384981==    by 0x1405DC: io_connect_ (io.c:345)
==384981==  Block was alloc'd at
==384981==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==384981==    by 0x149CF1: allocate (tal.c:250)
==384981==    by 0x14A3C6: tal_alloc_ (tal.c:428)
==384981==    by 0x1114F2: try_connect_peer (connectd.c:1526)
==384981==    by 0x111717: connect_to_peer (connectd.c:1558)
==384981==    by 0x1124F5: recv_req (connectd.c:1627)
==384981==    by 0x1188B2: handle_read (daemon_conn.c:31)
==384981==    by 0x13FBCB: next_plan (io.c:59)
==384981==    by 0x140076: do_plan (io.c:407)
==384981==    by 0x140113: io_ready (io.c:417)
==384981==    by 0x141A57: io_loop (poll.c:445)
==384981==    by 0x112CB0: main (connectd.c:1703)

Signed-off-by: Rusty Russell rusty@rustcorp.com.au Fixes: #4343

+8 -2

0 comment

1 changed file

pr created time in 2 hours

create barnchrustyrussell/lightning

branch : fix-connect-crash

created branch time in 2 hours

issue openedElementsProject/lightning

General protection fault in lightning_connectd after SYN flood warning

Issue and Steps to Reproduce

C-Lightning crashed with a general protection fault in lightning_connectd immediately following a kernel warning about possible SYN flooding on TCP port 9735:

[Wed Jan 27 02:33:38 2021] TCP: request_sock_TCP: Possible SYN flooding on port 9735. Dropping request.  Check SNMP counters.
[Wed Jan 27 02:33:40 2021] traps: lightning_conne[2884] general protection fault ip:7fd3d30276fd sp:7ffe67cc3600 error:0 in libc-2.32.so[7fd3d2fc5000+144000]

Unfortunately, no backtrace was emitted to C-Lightning's log, and no crash log file was generated either. If this happens again, I'll enable core dumps and try to get a backtrace with gdb.

Is it possible that someone has discovered a way to DoS C-Lightning?

getinfo output

{
   "id": "#######",
   "alias": "XXXXXXXX",
   "color": "######",
   "num_peers": ##,
   "num_pending_channels": 1,
   "num_active_channels": ##,
   "num_inactive_channels": 2,
   "address": [
      {
         "type": "ipv4",
         "address": "###.###.###.###",
         "port": 9735
      },
      {
         "type": "ipv6",
         "address": "####:####:####:####:####:####:####:####",
         "port": 9735
      }
   ],
   "binding": [
      {
         "type": "ipv6",
         "address": "::",
         "port": 9735
      },
      {
         "type": "ipv4",
         "address": "0.0.0.0",
         "port": 9735
      }
   ],
   "version": "0.9.3",
   "blockheight": 667919,
   "network": "bitcoin",
   "msatoshi_fees_collected": #####,
   "fees_collected_msat": "#####msat",
   "lightning-dir": "/var/lib/lightning/bitcoin"
}

created time in 10 hours

startedbtcontract/immortan

started time in 10 hours

PR opened lightningd/plugins

Fix reference to gossipd in historian.py

gossipd was referred to as parser resulting in errors.

+3 -3

0 comment

1 changed file

pr created time in 10 hours

Pull request review commentlightningd/plugins

backup: Implement network backup

 #!/usr/bin/env python3-from backup import FileBackend, get_backend, Change+from backends import get_backend+from backend import Change+from server import SocketServer+ import os import click import json+import logging import sqlite3 import sys +root = logging.getLogger()+root.setLevel(logging.INFO)++handler = logging.StreamHandler(sys.stdout)+handler.setLevel(logging.DEBUG)+formatter = logging.Formatter('%(message)s')+handler.setFormatter(formatter)+root.addHandler(handler)  @click.command()-@click.argument("lightning-dir", type=click.Path(exists=True)) @click.argument("backend-url")+@click.option('--lightning-dir', type=click.Path(exists=True), default=None, help='Use an existing lightning directory (default: initialize an empty backup).')

I'm not sure it's that bad. I mean, to get a backup.lock installed in the lightning directory you'd normally want to initialize your socket: backend (on the client side)? It's no different from initializing a file:// backend for use with lightingd.

laanwj

comment created time in 10 hours

PR opened lightningd/plugins

Avoid out of IndexError from `historian-stats`

Fixes a bug where historian-stats would give IndexError when no announcements or updates where recorded yet.

+2 -2

0 comment

1 changed file

pr created time in 10 hours

Pull request review commentlightningd/plugins

backup: Implement network backup

 #!/usr/bin/env python3-from backup import FileBackend, get_backend, Change+from backends import get_backend+from backend import Change+from server import SocketServer+ import os import click import json+import logging import sqlite3 import sys +root = logging.getLogger()+root.setLevel(logging.INFO)++handler = logging.StreamHandler(sys.stdout)+handler.setLevel(logging.DEBUG)+formatter = logging.Formatter('%(message)s')+handler.setFormatter(formatter)+root.addHandler(handler)  @click.command()-@click.argument("lightning-dir", type=click.Path(exists=True)) @click.argument("backend-url")+@click.option('--lightning-dir', type=click.Path(exists=True), default=None, help='Use an existing lightning directory (default: initialize an empty backup).')

It doesn't make an automatic snapshot. I suppose this could be done, but it's not :slightly_smiling_face: It's a manual step right now as documented here, while initializing the socket: backend: https://github.com/lightningd/plugins/blob/7c8e6dcf0dde42a836dd49dd4f49d4c9b1d9e416/backup/remote.md#usage

laanwj

comment created time in 10 hours

Pull request review commentlightningd/plugins

backup: Implement network backup

 #!/usr/bin/env python3-from backup import FileBackend, get_backend, Change+from backends import get_backend+from backend import Change+from server import SocketServer+ import os import click import json+import logging import sqlite3 import sys +root = logging.getLogger()+root.setLevel(logging.INFO)++handler = logging.StreamHandler(sys.stdout)+handler.setLevel(logging.DEBUG)+formatter = logging.Formatter('%(message)s')+handler.setFormatter(formatter)+root.addHandler(handler)  @click.command()-@click.argument("lightning-dir", type=click.Path(exists=True)) @click.argument("backend-url")+@click.option('--lightning-dir', type=click.Path(exists=True), default=None, help='Use an existing lightning directory (default: initialize an empty backup).')

No, it's not required. The whole idea is that you can leave out the option to make an empty backup (without an initial snapshot). This is useful for initializing the file backend on the server side.

laanwj

comment created time in 11 hours

Pull request review commentlightningd/plugins

backup: Implement network backup

+import logging, socket, struct+import json+from typing import Tuple++from backend import Backend+from protocol import PacketType, recvall, PKT_CHANGE_TYPES, change_from_packet, packet_from_change, send_packet, recv_packet++class SocketServer:+    def __init__(self, addr: Tuple[str, int], backend: Backend) -> None:+        self.backend = backend+        self.addr = addr+        self.bind = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+        self.bind.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)+        self.bind.bind(addr)++    def _send_packet(self, typ: int, payload: bytes) -> None:+        send_packet(self.sock, typ, payload)++    def _recv_packet(self) -> Tuple[int, bytes]:+        return recv_packet(self.sock)++    def _handle_conn(self, conn) -> None:+        # Can only handle one connection at a time+        logging.info('Servicing incoming connection')+        self.sock = conn+        while True:+            try:+                (typ, payload) = self._recv_packet()+            except IOError as e:+                logging.info('Connection closed')+                break+            if typ in PKT_CHANGE_TYPES:+                change = change_from_packet(typ, payload)+                if typ == PacketType.CHANGE:+                    logging.info('Received CHANGE {}'.format(change.version))+                else:+                    logging.info('Received SNAPSHOT {}'.format(change.version))+                self.backend.add_change(change)+                self._send_packet(PacketType.ACK, struct.pack("!I", self.backend.version))+            elif typ == PacketType.REWIND:+                logging.info('Received REWIND')+                to_version, = struct.unpack('!I', payload)+                if to_version != self.backend.prev_version:+                    logging.info('Cannot rewind to version {}'.format(to_version))+                    self._send_packet(PacketType.NACK, struct.pack("!I", self.backend.version))+                else:+                    self.backend.rewind()+                    self._send_packet(PacketType.ACK, struct.pack("!I", self.backend.version))+            elif typ == PacketType.REQ_METADATA:+                logging.info('Received REQ_METADATA')+                blob = struct.pack("!IIIQ", 0x01, self.backend.version,+                           self.backend.prev_version,+                           self.backend.version_count)+                self._send_packet(PacketType.METADATA, blob)+            elif typ == PacketType.RESTORE:+                logging.info('Received RESTORE')+                for change in self.backend.stream_changes():+                    (typ, payload) = packet_from_change(change)+                    self._send_packet(typ, payload)+                self._send_packet(PacketType.DONE, b'')+            elif typ == PacketType.COMPACT:+                logging.info('Received COMPACT')+                stats = self.backend.compact()+                self._send_packet(PacketType.COMPACT_RES, json.dumps(stats).encode())+            elif typ == PacketType.ACK:+                logging.info('Received ACK')+            elif typ == PacketType.NACK:+                logging.info('Received NACK')+            elif typ == PacketType.METADATA:+                logging.info('Received METADATA')+            elif typ == PacketType.COMPACT_RES:+                logging.info('Received COMPACT_RES')

Yes, true.

laanwj

comment created time in 11 hours

Pull request review commentlightningd/plugins

backup: Implement network backup

+'''+Socket-based remote backup protocol. This is used to create a connection to a backup backend, and send5 it incremental database updates.+'''+import socket+import struct+from typing import Tuple+import zlib++from backend import Change++class PacketType:+    CHANGE = 0x01+    SNAPSHOT = 0x02+    REWIND = 0x03+    REQ_METADATA = 0x04+    RESTORE = 0x05+    ACK = 0x06+    NACK = 0x07+    METADATA = 0x08+    DONE = 0x09+    COMPACT = 0x0a+    COMPACT_RES = 0x0b++PKT_CHANGE_TYPES = {PacketType.CHANGE, PacketType.SNAPSHOT}++def recvall(sock: socket.socket, n: int) -> bytearray:+    '''Receive exactly n bytes from a socket.'''+    buf = bytearray(n)+    view = memoryview(buf)+    ptr = 0+    while ptr < n:+        count = sock.recv_into(view[ptr:])+        if count == 0:+            raise IOError('Premature end of stream')+        ptr += count+    return buf++def send_packet(sock: socket.socket, typ: int, payload: bytes) -> None:+    sock.sendall(struct.pack('!BI', typ, len(payload)))+    sock.sendall(payload)++def recv_packet(sock: socket.socket) -> Tuple[int, bytes]:+    (typ, length) = struct.unpack('!BI', recvall(sock, 5))+    payload = recvall(sock, length)+    return (typ, payload)++def change_from_packet(typ, payload):+    '''Convert a network packet to a Change object.'''+    if typ == PacketType.CHANGE:+        (version, ) = struct.unpack('!I', payload[0:4])+        payload = zlib.decompress(payload[4:])

Yes, all changes and snapshots are compressed. And yes, the protocol is trusted, both from the client and server side, I don't think you can do much else in a backup protocol. (Authentication is explicitly out of scope)

laanwj

comment created time in 11 hours

issue commentElementsProject/lightning

[Feature request] Wait a while for Bitcoin Core to start instead of crashing immediately

@cdecker I tried to add -rpcwait, but this did not seem to solve the issue in my case. I think rpcwait does not work if the server refuse connection.

NicolasDorier

comment created time in 11 hours

issue commentElementsProject/lightning

[Feature request] Wait a while for Bitcoin Core to start instead of crashing immediately

@laanwj do you think that such a proposal would be welcome in bitcoin/bitcoin, or is there prior discussion on this?

I'm not aware of any prior discussion of this. But sounds good to me.

NicolasDorier

comment created time in 12 hours

PR opened ElementsProject/lightning

Reviewers
feat: chain hook custommsg

This PR will also make the custommsg hook chainable.

Adds: Feature, documentation and tests.

Note: I made the hooks response {'result': 'continue'} mandatory since this is cleaner for a chained hook.

+62 -21

0 comment

5 changed files

pr created time in 13 hours

push eventlightningnetwork/lightning-rfc

Dan Gershony

commit sha b80f8a719406b70f67e4cf7d034e8cd331850173

Add links to section 9 (anchor outputs) (#833)

view details

push time in 17 hours

issue openedlightningnetwork/lightning-rfc

Lightning Specification Meeting 2021/02/01

The meeting will take place on Monday 2021/02/01 at 7pm UTC on IRC #lightning-dev. It is open to the public.

Pending from last meetings

  • [ ] @rustyrussell to validate #539 test vectors in c-lightning
  • [ ] all implementations to correctly set sync_complete as per #826
  • [ ] second implementation of #672 for compatibility testing with c-lightning
  • [ ] second implementation of #824 for compatibility testing with lnd

Pull Request Review

  • [ ] Compression algorithm gossip #825
  • [ ] Warning message #834
  • [ ] TLV in Bolt 11 invoices #837

Issues

Long Term Updates

  • [ ] Discuss the possibility of a BIP-like structure for LN
  • [ ] Trampoline routing #829 and #836 (@t-bast)
  • [ ] Offers #798
  • [ ] Upfront payments / DoS protection
  • [ ] Blinded paths #765 (@t-bast)

Backlog

The following are topics that we should discuss at some point, so if we have time to discuss them great, otherwise they slip to the next meeting.

  • [ ] Github built-in security tab for vulnerability disclosure (@ariard)
  • [ ] Hornet (@cfromknecht)
  • [ ] lnprototest https://github.com/rustyrussell/lnprototest (@rustyrussell)

created time in 17 hours

issue commentElementsProject/lightning

[Feature request] Wait a while for Bitcoin Core to start instead of crashing immediately

@laanwj sadly, docker does not care about when bitcoind returns before starting the dependant services. And actually, bitcoind must run in foreground if hosted in container, so I can't even use -daemonwait

NicolasDorier

comment created time in a day

issue commentElementsProject/lightning

[Feature request] Wait a while for Bitcoin Core to start instead of crashing immediately

@darosior it would be nice to at least wait for 5-10 sec. (actually even 1 would be enough)

That's what our clightning fork is doing https://github.com/btcpayserver/lightning/commit/2ef9f6f0dd6872bac9e7b5a18a40386ac86d3b2a

As I said, the problem is that even if we configure c-lightning to depends on bitcoind at docker level, the fact that in bitcoin 0.21.0 I need to call bitcoin-create make docker start c-lightning start too early.

There is ways to work around that (like my commit above), or by having some boilerplate code in the bash, but then waiting for the warmup become useless, as it is done in the bash script anyway.

NicolasDorier

comment created time in a day

Pull request review commentElementsProject/lightning

ci: Switch to Github Actions and remove Travis CI

+---+name: Continuous Integration+on: [push, pull_request]+jobs:+  build-and-test:+    strategy:+      fail-fast: false+    runs-on: ubuntu-20.04+    steps:+      - name: Checkout+        uses: actions/checkout@v2.0.0+        +      - name: Set up Python 3.6+        uses: actions/setup-python@v2+        with:+          python-version: 3.6++      - name: Install dependencies+        run: |+          export DEBIAN_FRONTEND=noninteractive+          export BITCOIN_VERSION=0.20.1+          export ELEMENTS_VERSION=0.18.1.8+          sudo useradd -ms /bin/bash tester+          sudo apt-get update -qq++          sudo apt-get -qq install --no-install-recommends --allow-unauthenticated -yy \+          autoconf \+          autoconf \+          automake \+          binfmt-support \+          build-essential \+          clang \+          cppcheck \+          docbook-xml \+          eatmydata \+          gcc-aarch64-linux-gnu \+          gcc-arm-linux-gnueabihf \+          gcc-arm-none-eabi \+          gettext \+          git \+          libc6-dev-arm64-cross \+          libc6-dev-armhf-cross \+          libgmp-dev \+          libpq-dev \+          libprotobuf-c-dev \+          libsqlite3-dev \+          libtool \+          libxml2-utils \+          locales \+          net-tools \+          postgresql \+          python-pkg-resources \+          python3 \+          python3-dev \+          python3-pip \+          python3-setuptools \+          qemu \+          qemu-system-arm \+          qemu-user-static \+          shellcheck \+          software-properties-common \+          sudo \+          tcl \+          unzip \+          valgrind \+          wget \+          xsltproc \+          zlib1g-dev++          echo "tester ALL=(root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/tester+          sudo chmod 0440 /etc/sudoers.d/tester++          cd /tmp/ && \+          wget https://storage.googleapis.com/c-lightning-tests/bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.bz2 && \+          wget -q https://storage.googleapis.com/c-lightning-tests/elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.bz2 && \+          tar -xjf bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.bz2 && \+          tar -xjf elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.bz2 && \+          sudo mv bitcoin-$BITCOIN_VERSION/bin/* /usr/local/bin && \+          sudo mv elements-$ELEMENTS_VERSION/bin/* /usr/local/bin && \+          rm -rf \+          bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz \+          bitcoin-$BITCOIN_VERSION \+          elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.bz2 \+          elements-$ELEMENTS_VERSION++      - name: Build+        run: |+          echo Running in $(pwd)+          export ARCH=${ARCH:-64}+          export BOLTDIR=lightning-rfc+          export CC=${COMPILER:-gcc}+          export COMPAT=${COMPAT:-1}+          export TEST_CHECK_DBSTMTS=${TEST_CHECK_DBSTMTS:-0}+          export DEVELOPER=${DEVELOPER:-1}+          export EXPERIMENTAL_FEATURES=${EXPERIMENTAL_FEATURES:-0}+          export PATH=$CWD/dependencies/bin:"$HOME"/.local/bin:"$PATH"+          export PYTEST_OPTS="--maxfail=5 --reruns=2 --suppress-no-test-exit-code ${PYTEST_OPTS}"+          export PYTEST_PAR=${PYTEST_PAR:-10}+          export PYTEST_SENTRY_ALWAYS_REPORT=1+          export SLOW_MACHINE=1+          export TEST_CMD=${TEST_CMD:-"make -j $PYTEST_PAR pytest"}+          export TEST_DB_PROVIDER=${DB:-"sqlite3"}+          export TEST_NETWORK=${NETWORK:-"regtest"}+          export TIMEOUT=900+          export VALGRIND=${VALGRIND:-0}++          env++          pip3 install --user -U \+          -r requirements.txt \+          -r contrib/pyln-client/requirements.txt \+          -r contrib/pyln-proto/requirements.txt \+          -r contrib/pyln-testing/requirements.txt++          # Install utilities that aren't dependencies, but make running+          # tests easier/feasible on CI+          pip3 install --user \+          blinker \+          pytest-sentry \+          pytest-rerunfailures==9.1.1 \+          pytest-test-groups==1.0.3 \+          pytest-custom-exit-code==0.3.0++          git clone https://github.com/lightningnetwork/lightning-rfc.git ../lightning-rfc++          git submodule init+          git submodule update+          (cd external/libwally-core/src/; git submodule init; git submodule update)+          git clone https://github.com/lightningnetwork/lightning-rfc.git

We cloned this into the correct directory above already.

cdecker

comment created time in a day

Pull request review commentElementsProject/lightning

ci: Switch to Github Actions and remove Travis CI

 name: Continuous Integration on: [push, pull_request] jobs:   build-and-test:+    name: Test DEV=${{ matrix.developer }} VAL=${{ matrix.VALGRIND }} EXP=${{ matrix.EXPERIMENTAL_FEATURES }}+    env:

Shouldn't this be matrix. DEVELOPER (upper case)?

cdecker

comment created time in a day

Pull request review commentElementsProject/lightning

ci: Switch to Github Actions and remove Travis CI

 def test_forward_stats(node_factory, bitcoind):     l1, l2, l3, l4, l5 = node_factory.get_nodes(5, opts=[{}] * 4 + [{'may_fail': True}])     node_factory.join_nodes([l1, l2, l3], wait_for_announce=False)     l2.openchannel(l4, 10**6, wait_for_announce=False)-    l2.openchannel(l5, 10**6, wait_for_announce=True)+    l2.openchannel(l5, 10**6, wait_for_announce=False) +    sync_blockheight(bitcoind, [l1, l2, l3, l4, l5])+    bitcoind.generate_block(1)+    sync_blockheight(bitcoind, [l1, l2, l3, l4, l5])

Why sync before and after? I think first one can be omitted.

cdecker

comment created time in a day

Pull request review commentElementsProject/lightning

ci: Switch to Github Actions and remove Travis CI

+---+name: Continuous Integration+on: [push, pull_request]+jobs:+  build-and-test:+    strategy:+      fail-fast: false+    runs-on: ubuntu-20.04+    steps:+      - name: Checkout+        uses: actions/checkout@v2.0.0+        +      - name: Set up Python 3.6+        uses: actions/setup-python@v2+        with:+          python-version: 3.6++      - name: Install dependencies+        run: |+          export DEBIAN_FRONTEND=noninteractive+          export BITCOIN_VERSION=0.20.1+          export ELEMENTS_VERSION=0.18.1.8+          sudo useradd -ms /bin/bash tester+          sudo apt-get update -qq++          sudo apt-get -qq install --no-install-recommends --allow-unauthenticated -yy \+          autoconf \+          autoconf \

So nice, we include it twice!

cdecker

comment created time in a day

issue commentElementsProject/lightning

[Feature request] Wait a while for Bitcoin Core to start instead of crashing immediately

We do wait for bitcoind on startup indefinitely, if it its at least on warmup: https://github.com/ElementsProject/lightning/blob/483579f8b6bee8d48768b9cbf5b11e0c732d5a38/plugins/bcli.c#L817-L871

From your error in https://github.com/ElementsProject/lightning/issues/4352#issue-794033606 it looks like bitcoind has not even be started yet, and i'm not sure it's reasonable to wait with no clue that a bitcoind is actually going to start behind us at some point?

NicolasDorier

comment created time in a day

pull request commentElementsProject/lightning

feat: peer_connected hook chainable

Added tests and they are green also with VALGRIND=1. Undrafting the PR now.

m-schmoock

comment created time in a day

pull request commentElementsProject/lightning

feat: peer_connected hook chainable

@cdecker The tests to this PR run locally just fine. I will now add missing unit tests that test the chaining of this hook specifically. After this I will undraft this PR...

m-schmoock

comment created time in a day

issue commentElementsProject/lightning

Crash after migrating instance from one machine to another

Just in case it helps, I just updated c-lightning to 0.9.3 on both the old and new machine, and tried to do the migration again in the same way as before (shut down, rsync lightning dir, slightly adjust RPC config, start daemon with synced data). The error is still the same AFAICS. Here's the full output from valgrind:

<details> <summary>Stacktrace</summary> <pre> satoshi@bitcoin-2:/var/opt$ valgrind --trace-children=yes -q lightningd --lightning-dir=/var/opt/lightning 2021-01-26T15:49:16.838Z INFO plugin-bcli: bitcoin-cli initialized and connected to bitcoind. 2021-01-26T15:49:24.102Z INFO lightningd: -------------------------------------------------- 2021-01-26T15:49:24.105Z INFO lightningd: Server started with public key 03e26a98ee4d1320d5775fab291580969180592db3679e6d32e360dbd147066ca3, alias ln1.kosmos.org (color #03e26a) and lightningd v0.9.3 2021-01-26T15:49:24.303Z INFO plugin-fetchinvoice: Killing plugin: offers not enabled in config 2021-01-26T15:49:24.314Z INFO plugin-offers: Killing plugin: offers not enabled in config ==2271620== Invalid read of size 8 ==2271620== at 0x113011: destroy_io_conn (connectd.c:703) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Address 0x4d3e238 is 136 bytes inside a block of size 160 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D4EE: allocate (tal.c:250) ==2271620== by 0x14DBC3: tal_alloc_ (tal.c:428) ==2271620== by 0x1119D5: try_connect_peer (connectd.c:1526) ==2271620== by 0x111BFA: connect_to_peer (connectd.c:1558) ==2271620== by 0x1129D8: recv_req (connectd.c:1627) ==2271620== by 0x118FCB: handle_read (daemon_conn.c:31) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== ==2271620== Invalid read of size 8 ==2271620== at 0x113015: destroy_io_conn (connectd.c:703) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Address 0x4d3e220 is 112 bytes inside a block of size 160 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D4EE: allocate (tal.c:250) ==2271620== by 0x14DBC3: tal_alloc_ (tal.c:428) ==2271620== by 0x1119D5: try_connect_peer (connectd.c:1526) ==2271620== by 0x111BFA: connect_to_peer (connectd.c:1558) ==2271620== by 0x1129D8: recv_req (connectd.c:1627) ==2271620== by 0x118FCB: handle_read (daemon_conn.c:31) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== ==2271620== Invalid read of size 8 ==2271620== at 0x113027: destroy_io_conn (connectd.c:703) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Address 0x4d3e228 is 120 bytes inside a block of size 160 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D4EE: allocate (tal.c:250) ==2271620== by 0x14DBC3: tal_alloc_ (tal.c:428) ==2271620== by 0x1119D5: try_connect_peer (connectd.c:1526) ==2271620== by 0x111BFA: connect_to_peer (connectd.c:1558) ==2271620== by 0x1129D8: recv_req (connectd.c:1627) ==2271620== by 0x118FCB: handle_read (daemon_conn.c:31) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== ==2271620== Invalid read of size 4 ==2271620== at 0x12004D: fmt_wireaddr_internal (wireaddr.c:212) ==2271620== by 0x120152: fmt_wireaddr_internal_ (wireaddr.c:231) ==2271620== by 0x11EFE4: type_to_string_ (type_to_string.c:35) ==2271620== by 0x11303D: destroy_io_conn (connectd.c:703) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== Address 0x4d3e060 is 304 bytes inside a block of size 568 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14D7DA: del_tree (tal.c:412) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483DFAF: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14E23A: tal_resize_ (tal.c:699) ==2271620== by 0x110FBD: add_gossip_addrs (connectd.c:1453) ==2271620== by 0x11197E: try_connect_peer (connectd.c:1494) ==2271620== by 0x111BFA: connect_to_peer (connectd.c:1558) ==2271620== by 0x1129D8: recv_req (connectd.c:1627) ==2271620== by 0x118FCB: handle_read (daemon_conn.c:31) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== ==2271620== Invalid read of size 4 ==2271620== at 0x11FEB6: fmt_wireaddr_without_port (wireaddr.c:238) ==2271620== by 0x12001D: fmt_wireaddr (wireaddr.c:261) ==2271620== by 0x1200B2: fmt_wireaddr_internal (wireaddr.c:218) ==2271620== by 0x120152: fmt_wireaddr_internal_ (wireaddr.c:231) ==2271620== by 0x11EFE4: type_to_string_ (type_to_string.c:35) ==2271620== by 0x11303D: destroy_io_conn (connectd.c:703) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== Address 0x4d3e064 is 308 bytes inside a block of size 568 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14D7DA: del_tree (tal.c:412) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483DFAF: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14E23A: tal_resize_ (tal.c:699) ==2271620== by 0x110FBD: add_gossip_addrs (connectd.c:1453) ==2271620== by 0x11197E: try_connect_peer (connectd.c:1494) ==2271620== by 0x111BFA: connect_to_peer (connectd.c:1558) ==2271620== by 0x1129D8: recv_req (connectd.c:1627) ==2271620== by 0x118FCB: handle_read (daemon_conn.c:31) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== ==2271620== Invalid read of size 1 ==2271620== at 0x4B572F0: inet_ntop4 (inet_ntop.c:85) ==2271620== by 0x4B572F0: inet_ntop (inet_ntop.c:57) ==2271620== by 0x11FEE1: fmt_wireaddr_without_port (wireaddr.c:240) ==2271620== by 0x12001D: fmt_wireaddr (wireaddr.c:261) ==2271620== by 0x1200B2: fmt_wireaddr_internal (wireaddr.c:218) ==2271620== by 0x120152: fmt_wireaddr_internal_ (wireaddr.c:231) ==2271620== by 0x11EFE4: type_to_string_ (type_to_string.c:35) ==2271620== by 0x11303D: destroy_io_conn (connectd.c:703) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== Address 0x4d3e06a is 314 bytes inside a block of size 568 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14D7DA: del_tree (tal.c:412) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483DFAF: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14E23A: tal_resize_ (tal.c:699) ==2271620== by 0x110FBD: add_gossip_addrs (connectd.c:1453) ==2271620== by 0x11197E: try_connect_peer (connectd.c:1494) ==2271620== by 0x111BFA: connect_to_peer (connectd.c:1558) ==2271620== by 0x1129D8: recv_req (connectd.c:1627) ==2271620== by 0x118FCB: handle_read (daemon_conn.c:31) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== ==2271620== Invalid read of size 1 ==2271620== at 0x4B572F4: inet_ntop4 (inet_ntop.c:85) ==2271620== by 0x4B572F4: inet_ntop (inet_ntop.c:57) ==2271620== by 0x11FEE1: fmt_wireaddr_without_port (wireaddr.c:240) ==2271620== by 0x12001D: fmt_wireaddr (wireaddr.c:261) ==2271620== by 0x1200B2: fmt_wireaddr_internal (wireaddr.c:218) ==2271620== by 0x120152: fmt_wireaddr_internal_ (wireaddr.c:231) ==2271620== by 0x11EFE4: type_to_string_ (type_to_string.c:35) ==2271620== by 0x11303D: destroy_io_conn (connectd.c:703) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== Address 0x4d3e069 is 313 bytes inside a block of size 568 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14D7DA: del_tree (tal.c:412) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483DFAF: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14E23A: tal_resize_ (tal.c:699) ==2271620== by 0x110FBD: add_gossip_addrs (connectd.c:1453) ==2271620== by 0x11197E: try_connect_peer (connectd.c:1494) ==2271620== by 0x111BFA: connect_to_peer (connectd.c:1558) ==2271620== by 0x1129D8: recv_req (connectd.c:1627) ==2271620== by 0x118FCB: handle_read (daemon_conn.c:31) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== ==2271620== Invalid read of size 1 ==2271620== at 0x4B572FE: inet_ntop4 (inet_ntop.c:85) ==2271620== by 0x4B572FE: inet_ntop (inet_ntop.c:57) ==2271620== by 0x11FEE1: fmt_wireaddr_without_port (wireaddr.c:240) ==2271620== by 0x12001D: fmt_wireaddr (wireaddr.c:261) ==2271620== by 0x1200B2: fmt_wireaddr_internal (wireaddr.c:218) ==2271620== by 0x120152: fmt_wireaddr_internal_ (wireaddr.c:231) ==2271620== by 0x11EFE4: type_to_string_ (type_to_string.c:35) ==2271620== by 0x11303D: destroy_io_conn (connectd.c:703) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== Address 0x4d3e06c is 316 bytes inside a block of size 568 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14D7DA: del_tree (tal.c:412) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483DFAF: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14E23A: tal_resize_ (tal.c:699) ==2271620== by 0x110FBD: add_gossip_addrs (connectd.c:1453) ==2271620== by 0x11197E: try_connect_peer (connectd.c:1494) ==2271620== by 0x111BFA: connect_to_peer (connectd.c:1558) ==2271620== by 0x1129D8: recv_req (connectd.c:1627) ==2271620== by 0x118FCB: handle_read (daemon_conn.c:31) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== ==2271620== Invalid read of size 1 ==2271620== at 0x4B57303: inet_ntop4 (inet_ntop.c:85) ==2271620== by 0x4B57303: inet_ntop (inet_ntop.c:57) ==2271620== by 0x11FEE1: fmt_wireaddr_without_port (wireaddr.c:240) ==2271620== by 0x12001D: fmt_wireaddr (wireaddr.c:261) ==2271620== by 0x1200B2: fmt_wireaddr_internal (wireaddr.c:218) ==2271620== by 0x120152: fmt_wireaddr_internal_ (wireaddr.c:231) ==2271620== by 0x11EFE4: type_to_string_ (type_to_string.c:35) ==2271620== by 0x11303D: destroy_io_conn (connectd.c:703) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== Address 0x4d3e06b is 315 bytes inside a block of size 568 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14D7DA: del_tree (tal.c:412) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483DFAF: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14E23A: tal_resize_ (tal.c:699) ==2271620== by 0x110FBD: add_gossip_addrs (connectd.c:1453) ==2271620== by 0x11197E: try_connect_peer (connectd.c:1494) ==2271620== by 0x111BFA: connect_to_peer (connectd.c:1558) ==2271620== by 0x1129D8: recv_req (connectd.c:1627) ==2271620== by 0x118FCB: handle_read (daemon_conn.c:31) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== ==2271620== Invalid read of size 2 ==2271620== at 0x120023: fmt_wireaddr (wireaddr.c:262) ==2271620== by 0x1200B2: fmt_wireaddr_internal (wireaddr.c:218) ==2271620== by 0x120152: fmt_wireaddr_internal_ (wireaddr.c:231) ==2271620== by 0x11EFE4: type_to_string_ (type_to_string.c:35) ==2271620== by 0x11303D: destroy_io_conn (connectd.c:703) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== Address 0x4d3e08c is 348 bytes inside a block of size 568 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14D7DA: del_tree (tal.c:412) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483DFAF: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14E23A: tal_resize_ (tal.c:699) ==2271620== by 0x110FBD: add_gossip_addrs (connectd.c:1453) ==2271620== by 0x11197E: try_connect_peer (connectd.c:1494) ==2271620== by 0x111BFA: connect_to_peer (connectd.c:1558) ==2271620== by 0x1129D8: recv_req (connectd.c:1627) ==2271620== by 0x118FCB: handle_read (daemon_conn.c:31) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== ==2271620== Invalid read of size 8 ==2271620== at 0x14C9F5: tal_append_vfmt (str.c:102) ==2271620== by 0x14CABE: tal_append_fmt (str.c:111) ==2271620== by 0x112FC1: add_errors_to_error_list (connectd.c:680) ==2271620== by 0x113070: destroy_io_conn (connectd.c:702) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== Address 0x4d3e240 is 144 bytes inside a block of size 160 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D4EE: allocate (tal.c:250) ==2271620== by 0x14DBC3: tal_alloc_ (tal.c:428) ==2271620== by 0x1119D5: try_connect_peer (connectd.c:1526) ==2271620== by 0x111BFA: connect_to_peer (connectd.c:1558) ==2271620== by 0x1129D8: recv_req (connectd.c:1627) ==2271620== by 0x118FCB: handle_read (daemon_conn.c:31) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== ==2271620== Invalid read of size 1 ==2271620== at 0x14CA05: tal_append_vfmt (str.c:102) ==2271620== by 0x14CABE: tal_append_fmt (str.c:111) ==2271620== by 0x112FC1: add_errors_to_error_list (connectd.c:680) ==2271620== by 0x113070: destroy_io_conn (connectd.c:702) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== Address 0x4d3f208 is 40 bytes inside a block of size 128 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14D7DA: del_tree (tal.c:412) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483DFAF: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14E23A: tal_resize_ (tal.c:699) ==2271620== by 0x14C7E0: do_vfmt (str.c:72) ==2271620== by 0x14CA1B: tal_append_vfmt (str.c:102) ==2271620== by 0x14CABE: tal_append_fmt (str.c:111) ==2271620== by 0x112FC1: add_errors_to_error_list (connectd.c:680) ==2271620== by 0x113070: destroy_io_conn (connectd.c:702) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144C19: destroy_conn_close_fd (poll.c:250) ==2271620== by 0x14D6B6: notify (tal.c:240) ==2271620== by 0x14D788: del_tree (tal.c:402) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== ==2271620== Invalid read of size 8 ==2271620== at 0x14E1FF: tal_resize_ (tal.c:694) ==2271620== by 0x14C781: do_vfmt (str.c:60) ==2271620== by 0x14CA1B: tal_append_vfmt (str.c:102) ==2271620== by 0x14CABE: tal_append_fmt (str.c:111) ==2271620== by 0x112FC1: add_errors_to_error_list (connectd.c:680) ==2271620== by 0x113070: destroy_io_conn (connectd.c:702) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== Address 0x4d3e240 is 144 bytes inside a block of size 160 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D4EE: allocate (tal.c:250) ==2271620== by 0x14DBC3: tal_alloc_ (tal.c:428) ==2271620== by 0x1119D5: try_connect_peer (connectd.c:1526) ==2271620== by 0x111BFA: connect_to_peer (connectd.c:1558) ==2271620== by 0x1129D8: recv_req (connectd.c:1627) ==2271620== by 0x118FCB: handle_read (daemon_conn.c:31) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== ==2271620== Invalid read of size 8 ==2271620== at 0x14D2F8: to_tal_hdr (tal.c:174) ==2271620== by 0x14E206: tal_resize_ (tal.c:694) ==2271620== by 0x14C781: do_vfmt (str.c:60) ==2271620== by 0x14CA1B: tal_append_vfmt (str.c:102) ==2271620== by 0x14CABE: tal_append_fmt (str.c:111) ==2271620== by 0x112FC1: add_errors_to_error_list (connectd.c:680) ==2271620== by 0x113070: destroy_io_conn (connectd.c:702) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== Address 0x4d3f1f8 is 24 bytes inside a block of size 128 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14D7DA: del_tree (tal.c:412) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483DFAF: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14E23A: tal_resize_ (tal.c:699) ==2271620== by 0x14C7E0: do_vfmt (str.c:72) ==2271620== by 0x14CA1B: tal_append_vfmt (str.c:102) ==2271620== by 0x14CABE: tal_append_fmt (str.c:111) ==2271620== by 0x112FC1: add_errors_to_error_list (connectd.c:680) ==2271620== by 0x113070: destroy_io_conn (connectd.c:702) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144C19: destroy_conn_close_fd (poll.c:250) ==2271620== by 0x14D6B6: notify (tal.c:240) ==2271620== by 0x14D788: del_tree (tal.c:402) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== ==2271620== Invalid read of size 8 ==2271620== at 0x14D309: to_tal_hdr (tal.c:175) ==2271620== by 0x14E206: tal_resize_ (tal.c:694) ==2271620== by 0x14C781: do_vfmt (str.c:60) ==2271620== by 0x14CA1B: tal_append_vfmt (str.c:102) ==2271620== by 0x14CABE: tal_append_fmt (str.c:111) ==2271620== by 0x112FC1: add_errors_to_error_list (connectd.c:680) ==2271620== by 0x113070: destroy_io_conn (connectd.c:702) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== Address 0x4d3f1e0 is 0 bytes inside a block of size 128 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14D7DA: del_tree (tal.c:412) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483DFAF: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14E23A: tal_resize_ (tal.c:699) ==2271620== by 0x14C7E0: do_vfmt (str.c:72) ==2271620== by 0x14CA1B: tal_append_vfmt (str.c:102) ==2271620== by 0x14CABE: tal_append_fmt (str.c:111) ==2271620== by 0x112FC1: add_errors_to_error_list (connectd.c:680) ==2271620== by 0x113070: destroy_io_conn (connectd.c:702) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144C19: destroy_conn_close_fd (poll.c:250) ==2271620== by 0x14D6B6: notify (tal.c:240) ==2271620== by 0x14D788: del_tree (tal.c:402) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== ==2271620== Invalid read of size 8 ==2271620== at 0x14D312: to_tal_hdr (tal.c:176) ==2271620== by 0x14E206: tal_resize_ (tal.c:694) ==2271620== by 0x14C781: do_vfmt (str.c:60) ==2271620== by 0x14CA1B: tal_append_vfmt (str.c:102) ==2271620== by 0x14CABE: tal_append_fmt (str.c:111) ==2271620== by 0x112FC1: add_errors_to_error_list (connectd.c:680) ==2271620== by 0x113070: destroy_io_conn (connectd.c:702) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== Address 0x4d3f1e8 is 8 bytes inside a block of size 128 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14D7DA: del_tree (tal.c:412) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483DFAF: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14E23A: tal_resize_ (tal.c:699) ==2271620== by 0x14C7E0: do_vfmt (str.c:72) ==2271620== by 0x14CA1B: tal_append_vfmt (str.c:102) ==2271620== by 0x14CABE: tal_append_fmt (str.c:111) ==2271620== by 0x112FC1: add_errors_to_error_list (connectd.c:680) ==2271620== by 0x113070: destroy_io_conn (connectd.c:702) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144C19: destroy_conn_close_fd (poll.c:250) ==2271620== by 0x14D6B6: notify (tal.c:240) ==2271620== by 0x14D788: del_tree (tal.c:402) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== ==2271620== Invalid read of size 8 ==2271620== at 0x14D31B: to_tal_hdr (tal.c:177) ==2271620== by 0x14E206: tal_resize_ (tal.c:694) ==2271620== by 0x14C781: do_vfmt (str.c:60) ==2271620== by 0x14CA1B: tal_append_vfmt (str.c:102) ==2271620== by 0x14CABE: tal_append_fmt (str.c:111) ==2271620== by 0x112FC1: add_errors_to_error_list (connectd.c:680) ==2271620== by 0x113070: destroy_io_conn (connectd.c:702) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== Address 0x4d3f1f0 is 16 bytes inside a block of size 128 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14D7DA: del_tree (tal.c:412) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483DFAF: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14E23A: tal_resize_ (tal.c:699) ==2271620== by 0x14C7E0: do_vfmt (str.c:72) ==2271620== by 0x14CA1B: tal_append_vfmt (str.c:102) ==2271620== by 0x14CABE: tal_append_fmt (str.c:111) ==2271620== by 0x112FC1: add_errors_to_error_list (connectd.c:680) ==2271620== by 0x113070: destroy_io_conn (connectd.c:702) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144C19: destroy_conn_close_fd (poll.c:250) ==2271620== by 0x14D6B6: notify (tal.c:240) ==2271620== by 0x14D788: del_tree (tal.c:402) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== ==2271620== Invalid free() / delete / delete[] / realloc() ==2271620== at 0x483DFAF: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14E23A: tal_resize_ (tal.c:699) ==2271620== by 0x14C781: do_vfmt (str.c:60) ==2271620== by 0x14CA1B: tal_append_vfmt (str.c:102) ==2271620== by 0x14CABE: tal_append_fmt (str.c:111) ==2271620== by 0x112FC1: add_errors_to_error_list (connectd.c:680) ==2271620== by 0x113070: destroy_io_conn (connectd.c:702) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144F55: cleanup_conn_without_close (poll.c:264) ==2271620== by 0x1438FE: io_close_taken_fd (io.c:463) ==2271620== by 0x112EB6: peer_connected (connectd.c:511) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== Address 0x4d3f1e0 is 0 bytes inside a block of size 128 free'd ==2271620== at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14D81D: del_tree (tal.c:421) ==2271620== by 0x14D7DA: del_tree (tal.c:412) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== by 0x1101D3: connected_to_peer (connectd.c:299) ==2271620== by 0x112DB4: peer_connected (connectd.c:481) ==2271620== by 0x1133F9: peer_init_received (peer_exchange_initmsg.c:94) ==2271620== by 0x143365: next_plan (io.c:59) ==2271620== by 0x143810: do_plan (io.c:407) ==2271620== by 0x1438AD: io_ready (io.c:417) ==2271620== by 0x1451F1: io_loop (poll.c:445) ==2271620== by 0x113193: main (connectd.c:1703) ==2271620== Block was alloc'd at ==2271620== at 0x483DFAF: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2271620== by 0x14E23A: tal_resize_ (tal.c:699) ==2271620== by 0x14C7E0: do_vfmt (str.c:72) ==2271620== by 0x14CA1B: tal_append_vfmt (str.c:102) ==2271620== by 0x14CABE: tal_append_fmt (str.c:111) ==2271620== by 0x112FC1: add_errors_to_error_list (connectd.c:680) ==2271620== by 0x113070: destroy_io_conn (connectd.c:702) ==2271620== by 0x144BF3: destroy_conn (poll.c:244) ==2271620== by 0x144C19: destroy_conn_close_fd (poll.c:250) ==2271620== by 0x14D6B6: notify (tal.c:240) ==2271620== by 0x14D788: del_tree (tal.c:402) ==2271620== by 0x14DD17: tal_free (tal.c:486) ==2271620== lightning_connectd: FATAL SIGNAL 6 (version v0.9.3) 0x118e70 send_backtrace common/daemon.c:38 0x118f0a crashdump common/daemon.c:51 0x4a5c20f ??? ???:0 0x4a5c18b ??? ???:0 0x4a3b858 ??? ???:0 0x14d245 call_error ccan/ccan/tal/tal.c:93 0x14e30b tal_resize_ ccan/ccan/tal/tal.c:701 0x14c781 do_vfmt ccan/ccan/tal/str/str.c:60 0x14ca1b tal_append_vfmt ccan/ccan/tal/str/str.c:102 0x14cabe tal_append_fmt ccan/ccan/tal/str/str.c:111 0x112fc1 add_errors_to_error_list connectd/connectd.c:680 0x113070 destroy_io_conn connectd/connectd.c:702 0x144bf3 destroy_conn ccan/ccan/io/poll.c:244 0x144f55 cleanup_conn_without_close ccan/ccan/io/poll.c:264 0x1438fe io_close_taken_fd ccan/ccan/io/io.c:463 0x112eb6 peer_connected connectd/connectd.c:511 0x1133f9 peer_init_received connectd/peer_exchange_initmsg.c:94 0x143365 next_plan ccan/ccan/io/io.c:59 0x143810 do_plan ccan/ccan/io/io.c:407 0x1438ad io_ready ccan/ccan/io/io.c:417 0x1451f1 io_loop ccan/ccan/io/poll.c:445 0x113193 main connectd/connectd.c:1703 0x4a3d0b2 ??? ???:0 0x10e59d ??? ???:0 0xffffffffffffffff ??? ???:0 lightning_connectd: FATAL SIGNAL (version v0.9.3) 0x118e70 send_backtrace common/daemon.c:38 0x11ebcc status_failed common/status.c:206 0x11ecde status_backtrace_exit common/subdaemon.c:25 0x118f10 crashdump common/daemon.c:54 0x4a5c20f ??? ???:0 0x4a5c18b ??? ???:0 0x4a3b858 ??? ???:0 0x14d245 call_error ccan/ccan/tal/tal.c:93 0x14e30b tal_resize_ ccan/ccan/tal/tal.c:701 0x14c781 do_vfmt ccan/ccan/tal/str/str.c:60 0x14ca1b tal_append_vfmt ccan/ccan/tal/str/str.c:102 0x14cabe tal_append_fmt ccan/ccan/tal/str/str.c:111 0x112fc1 add_errors_to_error_list connectd/connectd.c:680 0x113070 destroy_io_conn connectd/connectd.c:702 0x144bf3 destroy_conn ccan/ccan/io/poll.c:244 0x144f55 cleanup_conn_without_close ccan/ccan/io/poll.c:264 0x1438fe io_close_taken_fd ccan/ccan/io/io.c:463 0x112eb6 peer_connected connectd/connectd.c:511 0x1133f9 peer_init_received connectd/peer_exchange_initmsg.c:94 0x143365 next_plan ccan/ccan/io/io.c:59 0x143810 do_plan ccan/ccan/io/io.c:407 0x1438ad io_ready ccan/ccan/io/io.c:417 0x1451f1 io_loop ccan/ccan/io/poll.c:445 0x113193 main connectd/connectd.c:1703 0x4a3d0b2 ??? ???:0 0x10e59d ??? ???:0 0xffffffffffffffff ??? ???:0 </pre> </details>

cdecker

comment created time in a day

Pull request review commentElementsProject/lightning

feat: peer_connected hook chainable

 the cryptographic handshake. The parameters have the following structure if ther } ``` -The hook is sparse on purpose, since the plugin can use the JSON-RPC+The hook is sparse on information, since the plugin can use the JSON-RPC

Well, I did that on purpose, as the 'purpose' of the hook is not sparse, just the 'information' that is sent to the hook ;)

m-schmoock

comment created time in a day

Pull request review commentElementsProject/lightning

feat: peer_connected hook chainable

 no plugin is registered on the hook. ### `peer_connected`  This hook is called whenever a peer has connected and successfully completed-the cryptographic handshake. The parameters have the following structure if there is a channel with the peer:+the cryptographic handshake. The parameters have the following structure:

When reading the doc and reading the code that produces this DTO for the hook, the part "if there is a channel with the peer" seemed wrong to me, as the parameters will always be the same regardless if there is a channel or not. This is why I removed this part.

m-schmoock

comment created time in a day

more