Rusty Russell
1e8cbf2645
lightningd: don't access after free on plugin crash
tests/test_plugin.py::test_important_plugin does this, and it's inelegant:
```
lightningd-1 2024-11-18T07:33:09.433Z **BROKEN** plugin-fail_by_itself.py: Plugin marked as important, shutting down lightningd!
lightningd-1 2024-11-18T07:33:09.451Z DEBUG lightningd: io_break: lightningd_exit
lightningd-1 2024-11-18T07:33:09.533Z DEBUG connectd: REPLY WIRE_CONNECTD_START_SHUTDOWN_REPLY with 0 fds
lightningd-1 2024-11-18T07:33:09.575Z DEBUG lightningd: io_break: connectd_start_shutdown_reply
lightningd-1 2024-11-18T07:33:09.802Z DEBUG lightningd: Looking for [autoclean,failedforwards,num]
{'github_repository': 'ElementsProject/lightning', 'github_sha': '0729de783e95c5208b1706f7d27b23904596bb71', 'github_ref': 'refs/pull/7835/merge', 'github_ref_name': 'HEAD', 'github_run_id': 11887300979, 'github_head_ref': 'guilt/fix-flakes8', 'github_run_number': 11566, 'github_base_ref': 'master', 'github_run_attempt': '1', 'testname': 'test_important_plugin', 'start_time': 1731915163, 'end_time': 1731915190, 'outcome': 'fail'}
----------------------------- Captured stderr call -----------------------------
No plugin for askrene-create-layer ?
Lost connection to the RPC socket.Reading JSON input: Connection reset by peerReading JSON input: Connection reset by peerReading JSON input: Connection reset by peerReading JSON input: Connection reset by peer
--------------------------- Captured stdout teardown ---------------------------
------------------------------- Valgrind errors --------------------------------
Valgrind error file: valgrind-errors.28639
==28639== Invalid read of size 8
==28639== at 0x168310: command_exec (jsonrpc.c:808)
==28639== by 0x168A98: rpc_command_hook_final (jsonrpc.c:954)
==28639== by 0x1AD48C: plugin_hook_call_next (plugin_hook.c:196)
==28639== by 0x1AD407: plugin_hook_callback (plugin_hook.c:183)
==28639== by 0x1A6074: plugin_response_handle (plugin.c:663)
==28639== by 0x1A62F0: plugin_read_json_one (plugin.c:775)
==28639== by 0x1A652D: plugin_read_json (plugin.c:826)
==28639== by 0x390200: next_plan (io.c:60)
==28639== by 0x390E56: do_plan (io.c:422)
==28639== by 0x390EBD: io_ready (io.c:439)
==28639== by 0x3932F1: io_loop (poll.c:455)
==28639== by 0x1ABBE4: shutdown_plugins (plugin.c:2588)
==28639== Address 0x5d25a20 is 48 bytes inside a block of size 88 free'd
==28639== at 0x484B27F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==28639== by 0x3A31FB: del_tree (tal.c:456)
==28639== by 0x3A317B: del_tree (tal.c:447)
==28639== by 0x3A34DC: tal_free (tal.c:532)
==28639== by 0x1ABAF3: shutdown_plugins (plugin.c:2575)
==28639== by 0x16E0D3: main (lightningd.c:1514)
==28639== Block was alloc'd at
==28639== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==28639== by 0x3A2BCA: allocate (tal.c:256)
==28639== by 0x3A3252: tal_alloc_ (tal.c:473)
==28639== by 0x1A815E: plugin_rpcmethod_add (plugin.c:1425)
==28639== by 0x1A83F9: plugin_rpcmethods_add (plugin.c:1470)
==28639== by 0x1A965A: plugin_parse_getmanifest_response (plugin.c:1850)
==28639== by 0x1A971F: plugin_manifest_cb (plugin.c:1872)
==28639== by 0x1A6074: plugin_response_handle (plugin.c:663)
==28639== by 0x1A62F0: plugin_read_json_one (plugin.c:775)
==28639== by 0x1A652D: plugin_read_json (plugin.c:826)
==28639== by 0x390200: next_plan (io.c:60)
==28639== by 0x390E56: do_plan (io.c:422)
==28639==
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-11-19 17:51:18 +10:30
..
2024-11-17 16:04:06 +10:30
2024-11-17 20:27:13 +10:30
2024-06-24 17:26:11 +09:30
2024-06-24 17:26:11 +09:30
2024-08-13 07:25:02 -07:00
2024-06-24 17:26:11 +09:30
2024-11-17 20:27:13 +10:30
2024-06-19 15:54:24 +09:30
2024-08-12 16:30:29 +09:30
2024-01-31 14:47:33 +10:30
2024-09-21 06:20:18 +09:30
2024-11-13 14:44:03 +10:30
2024-11-13 14:44:03 +10:30
2024-09-19 12:16:53 +09:30
2024-01-31 14:47:33 +10:30
2024-11-17 16:04:06 +10:30
2024-11-17 16:04:06 +10:30
2024-07-23 09:54:47 +09:30
2024-11-13 08:49:55 +10:30
2024-08-12 16:30:29 +09:30
2024-07-10 13:34:00 +02:00
2024-07-31 14:42:58 +09:30
2024-11-17 20:27:13 +10:30
2024-06-19 15:54:24 +09:30
2024-03-25 15:02:35 +10:30
2024-10-26 09:51:20 +02:00
2024-11-13 14:44:03 +10:30
2024-01-31 14:47:33 +10:30
2024-07-23 09:54:47 +09:30
2024-03-20 13:51:48 +10:30
2024-08-01 12:31:48 +09:30
2024-10-16 07:14:32 +10:30
2024-10-16 07:14:32 +10:30
2024-10-27 13:57:50 +11:00
2024-10-27 13:57:50 +11:00
2024-11-17 14:21:23 +10:30
2024-11-18 11:03:26 +10:30
2024-07-31 14:42:58 +09:30
2024-11-12 10:44:10 +01:00
2024-11-18 10:42:54 +01:00
2024-08-10 15:20:59 +09:30
2024-05-08 21:05:49 -05:00
2024-08-01 12:31:48 +09:30
2024-08-04 11:47:54 +02:00
2024-05-17 13:03:12 -05:00
2024-05-17 13:03:12 -05:00
2024-08-11 11:27:10 +09:30
2024-11-17 20:27:13 +10:30
2024-11-18 11:03:26 +10:30
2024-05-09 16:14:23 -05:00
2024-11-17 20:27:13 +10:30
2024-06-19 15:54:24 +09:30
2024-11-18 10:42:54 +01:00
2024-11-18 11:03:26 +10:30
2024-10-27 13:57:50 +11:00
2024-11-17 16:04:06 +10:30
2024-07-29 17:08:33 +02:00
2024-11-12 10:44:10 +01:00
2024-10-27 13:57:50 +11:00
2024-07-31 14:42:58 +09:30
2024-11-18 11:03:26 +10:30
2024-05-08 21:05:49 -05:00
2024-11-19 17:51:18 +10:30
2024-05-06 20:51:19 -05:00
2024-09-19 12:16:53 +09:30
2024-08-01 12:31:48 +09:30
2024-07-31 14:42:58 +09:30
2024-11-17 22:36:04 +10:30
2024-11-13 14:44:03 +10:30
2024-07-31 14:42:58 +09:30
2024-08-13 07:25:02 -07:00
2024-08-13 07:25:02 -07:00