Skip to content

[bug]: panic: runtime error resuming HTLC attempt #9688

@djkazic

Description

@djkazic

Background

On LND 0.19.0 rc2 during startup this panic was observed:

2025-04-08 18:51:38.941 [INF] CRTR: Resuming HTLC attempt 35020 for payment 53a3012ec149f3a478e13a7e16617fca658f87e80f26c8b5ffa7091be9ce34a6
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x19c407e]
goroutine 1191 [running]:
github.com/lightningnetwork/lnd/channeldb.(*HTLCAttemptInfo).attachOnionBlobAndCircuit(0xc00775ca08)
    github.com/lightningnetwork/lnd/channeldb/mp_payment.go:123 +0x1e
github.com/lightningnetwork/lnd/channeldb.(*HTLCAttemptInfo).Circuit(...)
    github.com/lightningnetwork/lnd/channeldb/mp_payment.go:111
github.com/lightningnetwork/lnd/routing.(*paymentLifecycle).collectResult(0xc00509a180, 0xc00775ca08)
    github.com/lightningnetwork/lnd/routing/payment_lifecycle.go:508 +0x11a
github.com/lightningnetwork/lnd/routing.(*paymentLifecycle).collectResultAsync.func1()
    github.com/lightningnetwork/lnd/routing/payment_lifecycle.go:464 +0x31
created by github.com/lightningnetwork/lnd/routing.(*paymentLifecycle).collectResultAsync in goroutine 1068
    github.com/lightningnetwork/lnd/routing/payment_lifecycle.go:463 +0x12a

Line for ref:

    onionBlob, circuit, err := GenerateSphinxPacket(
        &h.Route, h.Hash[:], h.SessionKey(),
    )

Based on the valid memory address, h itself is not nil, so the culprit likely lies in the other fields (i.e. Route, Hash, etc.)

Your environment

  • version of lnd: 0.19 rc2
  • which operating system (uname -a on *Nix): Linux 5.10.225
  • version of btcd, bitcoind, or other backend: bitcoind

Steps to reproduce

Upgrade instance to LND 0.19 rc2.

Expected behaviour

Start up.

Actual behaviour

Runtime panic.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions