Skip to content

Fix askrene getroutes crash#9217

Open
Lagrang3 wants to merge 2 commits into
ElementsProject:masterfrom
Lagrang3:fix-askrene-getroutes-crash
Open

Fix askrene getroutes crash#9217
Lagrang3 wants to merge 2 commits into
ElementsProject:masterfrom
Lagrang3:fix-askrene-getroutes-crash

Conversation

@Lagrang3

Copy link
Copy Markdown
Collaborator

Fixes #9216.

Don't crash on wrong user input.
Produce an RPC error instead.

Lagrang3 added 2 commits June 15, 2026 13:43
Changelog-None

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
```
cln-askrene: plugins/askrene/child/child.c:40: final_hop: Assertion `tal_count(hops) > 0' failed.
cln-askrene: FATAL SIGNAL 6 (version v26.06-19-g46b039d)
lightningd-1 2026-06-15T12:34:26.296Z DEBUG   plugin-cln-askrene: notify msg debug: Final answer has 1 flows
0x55ab65429902 send_backtrace
	common/daemon.c:38
0x55ab6542998c crashdump
	common/daemon.c:83
0x7fbc84a8bdef ???
	./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x7fbc84ae095c __pthread_kill_implementation
	./nptl/pthread_kill.c:44
0x7fbc84a8bcc1 __GI_raise
	../sysdeps/posix/raise.c:26
0x7fbc84a744ab __GI_abort
	./stdlib/abort.c:77
0x7fbc84a7441f __assert_fail_base
	./assert/assert.c:118
0x55ab6541b60c final_hop
	plugins/askrene/child/child.c:40
0x55ab6541b70d fmt_route
	plugins/askrene/child/child.c:48
0x55ab6541ba5b convert_flows_to_routes
	plugins/askrene/child/child.c:135
0x55ab6541c037 run_child
	plugins/askrene/child/child.c:265
0x55ab65416caa do_getroutes
	plugins/askrene/askrene.c:711
0x55ab65416d28 begin_request
	plugins/askrene/askrene.c:887
0x55ab654170a2 json_getroutes
	plugins/askrene/askrene.c:968
0x55ab654285ec ld_command_handle
	plugins/libplugin.c:2206
0x55ab654287f6 ld_read_json
	plugins/libplugin.c:2282
0x55ab65439261 next_plan
	ccan/ccan/io/io.c:60
0x55ab65439580 do_plan
	ccan/ccan/io/io.c:422
0x55ab65439639 io_ready
	ccan/ccan/io/io.c:439
0x55ab6543a5fc io_loop
	ccan/ccan/io/poll.c:470
0x55ab65428bc4 plugin_main
	plugins/libplugin.c:2481
0x55ab65417491 main
	plugins/askrene/askrene.c:1551
0x7fbc84a75ca7 __libc_start_call_main
	../sysdeps/nptl/libc_start_call_main.h:58
0x7fbc84a75d64 __libc_start_main_impl
	../csu/libc-start.c:360
0x55ab65413920 ???
	_start+0x20:0
0xffffffffffffffff ???
	???:0
```

Changelog-Fixed: askrene-getroutes: don't crash on invalid user input, source==destination

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
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.

getroutes with source==destination crashes CLN v26.06

1 participant