Rusty Russell
5e6b0f9445
lightningd: fix crash if we abort after enabling notifications.
The rpc_command hook means that we have a delay between receiving
a JSON command and actually calling the handler. In this case, the
caller can go away:
```
==1348== Invalid write of size 1
==1348== at 0x130EA6: json_notifications (jsonrpc.c:1350)
==1348== by 0x12EE9E: command_exec (jsonrpc.c:636)
==1348== by 0x12F3C6: rpc_command_hook_callback (jsonrpc.c:752)
==1348== by 0x15AA08: plugin_hook_callback (plugin_hook.c:210)
==1348== by 0x155C9D: plugin_response_handle (plugin.c:398)
==1348== by 0x155E84: plugin_read_json_one (plugin.c:504)
==1348== by 0x15603D: plugin_read_json (plugin.c:548)
==1348== by 0x1D4AB3: next_plan (io.c:59)
==1348== by 0x1D5630: do_plan (io.c:407)
==1348== by 0x1D566E: io_ready (io.c:417)
==1348== by 0x1D7834: io_loop (poll.c:445)
==1348== by 0x12CFAC: io_loop_with_timers (io_loop_with_timers.c:24)
==1348== Address 0x58 is not stack'd, malloc'd or (recently) free'd
==1348==
lightningd: FATAL SIGNAL 11 (version v0.9.1-266-ga4df315)
0x180f7e send_backtrace
common/daemon.c:38
0x181024 crashdump
common/daemon.c:51
0x5bd7fcf ???
???:0
0x130ea6 json_notifications
lightningd/jsonrpc.c:1350
0x12ee9e command_exec
lightningd/jsonrpc.c:636
0x12f3c6 rpc_command_hook_callback
lightningd/jsonrpc.c:752
0x15aa08 plugin_hook_callback
lightningd/plugin_hook.c:210
0x155c9d plugin_response_handle
lightningd/plugin.c:398
0x155e84 plugin_read_json_one
lightningd/plugin.c:504
0x15603d plugin_read_json
lightningd/plugin.c:548
0x1d4ab3 next_plan
ccan/ccan/io/io.c:59
0x1d5630 do_plan
ccan/ccan/io/io.c:407
0x1d566e io_ready
ccan/ccan/io/io.c:417
0x1d7834 io_loop
ccan/ccan/io/poll.c:445
0x12cfac io_loop_with_timers
lightningd/io_loop_with_timers.c:24
0x132825 main
lightningd/lightningd.c:1016
0x5bbab96 ???
???:0
0x1159e9 ???
???:0
0xffffffffffffffff ???
???:0
Log dumped in crash.log.20201106001723
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-11-06 14:05:44 -06:00
..
2020-10-23 13:53:16 +10:30
2020-09-09 19:54:20 +09:30
2020-10-23 13:53:16 +10:30
2020-09-09 12:38:19 +09:30
2020-09-23 13:52:49 +09:30
2020-09-09 12:38:19 +09:30
2020-10-21 09:04:32 +10:30
2020-10-20 12:50:31 +10:30
2019-06-30 16:41:30 +09:30
2020-10-22 12:14:34 +10:30
2020-10-21 09:04:32 +10:30
2020-09-23 15:51:13 +09:30
2019-06-04 01:29:39 +00:00
2020-09-09 19:54:20 +09:30
2020-05-12 15:46:58 +09:30
2020-09-11 21:27:45 +09:30
2020-04-03 13:13:21 +10:30
2020-11-04 14:29:22 -06:00
2020-09-09 19:54:20 +09:30
2020-09-08 09:42:00 +09:30
2019-09-25 04:01:56 +00:00
2020-05-20 11:36:13 +02:00
2020-05-07 08:44:58 +09:30
2020-08-25 12:53:13 +09:30
2020-06-11 13:13:13 +02:00
2020-05-12 15:46:58 +09:30
2020-09-08 09:42:00 +09:30
2020-10-28 12:03:14 +01:00
2020-09-08 09:42:00 +09:30
2020-09-24 09:24:14 +09:30
2020-09-08 09:42:00 +09:30
2019-07-24 16:16:53 +02:00
2019-05-31 17:57:10 +02:00
2020-09-02 09:46:37 +09:30
2020-08-11 08:39:24 +09:30
2020-11-06 14:05:44 -06:00
2020-10-23 13:53:16 +10:30
2020-10-28 14:32:35 -05:00
2020-10-20 12:50:31 +10:30
2020-08-25 12:53:13 +09:30
2019-11-18 04:50:22 +00:00
2020-10-23 13:53:16 +10:30
2019-11-18 04:50:22 +00:00
2020-10-27 10:42:48 +10:30
2020-09-23 13:52:49 +09:30
2019-02-07 20:33:50 +00:00
2020-10-21 09:04:32 +10:30
2020-10-21 09:04:32 +10:30
2020-09-09 19:54:20 +09:30
2020-08-25 12:53:13 +09:30
2020-09-02 09:46:37 +09:30
2020-04-02 14:32:38 +10:30
2020-10-20 12:50:31 +10:30
2020-10-20 12:50:31 +10:30
2020-10-20 12:50:31 +10:30
2020-09-17 10:12:08 +09:30
2020-10-26 21:31:24 -05:00
2019-11-23 22:42:34 +00:00
2020-09-24 09:24:14 +09:30
2020-05-04 18:56:33 +09:30
2020-10-23 13:53:16 +10:30
2020-10-20 12:50:31 +10:30
2020-10-14 16:08:05 +10:30
2020-09-23 15:51:13 +09:30
2020-08-25 12:53:13 +09:30
2018-09-14 22:11:23 +02:00
2020-09-18 12:08:07 +09:30
2020-05-05 13:45:17 +09:30
2020-10-23 13:53:16 +10:30
2020-05-05 13:45:17 +09:30
2020-10-23 13:53:16 +10:30
2020-08-21 09:52:33 +09:30
2020-09-08 19:47:11 +09:30
2020-09-08 19:47:11 +09:30
2020-08-25 12:53:13 +09:30
2020-08-31 21:33:26 -05:00
2019-11-18 04:50:22 +00:00
2020-01-02 16:56:42 +01:00
2019-06-28 03:31:43 +00:00