Skip to content

openingd: handle dev-memleak while waiting for master replies - #9790

Merged
daywalker90 merged 2 commits into
ElementsProject:masterfrom
daywalker90:fix/openingd-dev-memleak-wait
Dec 1, 2026
Merged

daywalker90 merged 2 commits into
ElementsProject:masterfrom
daywalker90:fix/openingd-dev-memleak-wait

Conversation

@daywalker90

Copy link
Copy Markdown
Collaborator

openingd and dualopend can block in wire_sync_read(REQ_FD) while
a plugin hook (such as openchannel / openchannel2) delays master's
reply. If lightningd sends WIRE_OPENINGD_DEV_MEMLEAK (or
WIRE_DUALOPEND_DEV_MEMLEAK) during that window, the daemon failed
with STATUS_FAIL_MASTER_IO (Error parsing 6105: 1791).

Loop on dev-memleak messages at those wire_sync_read(REQ_FD) call
sites, matching the existing pattern in dualopend.c.

Changelog-None

nGoline
nGoline previously approved these changes Dec 1, 2026
Hold the `openchannel` / `openchannel2` hook on the fundee so
`openingd` / `dualopend` blocks in `wire_sync_read(REQ_FD)`, then
invoke `dev-memleak` before releasing the hook.
`openingd` and `dualopend` can block in `wire_sync_read(REQ_FD)` while
a plugin hook (such as `openchannel` / `openchannel2`) delays master's
reply. If `lightningd` sends `WIRE_OPENINGD_DEV_MEMLEAK` (or
`WIRE_DUALOPEND_DEV_MEMLEAK`) during that window, the daemon failed
with `STATUS_FAIL_MASTER_IO` (`Error parsing 6105: 1791`).

Loop on dev-memleak messages at those `wire_sync_read(REQ_FD)` call
sites, matching the existing pattern in `dualopend.c`.
@daywalker90

Copy link
Copy Markdown
Collaborator Author

Had to disable the test under VALGRIND since dev-memleak is disabled then.

@daywalker90
daywalker90 requested a review from nGoline December 1, 2026 15:55
@daywalker90
daywalker90 merged commit 08a26b2 into ElementsProject:master Dec 1, 2026
89 of 90 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants