diff --git a/channeld/test/run-commit_tx.c b/channeld/test/run-commit_tx.c index ab14e222c..5f0a636bd 100644 --- a/channeld/test/run-commit_tx.c +++ b/channeld/test/run-commit_tx.c @@ -13,6 +13,7 @@ static bool print_superverbose; #include #include #include +#include #include #include #include @@ -34,6 +35,9 @@ void fromwire_node_id(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct n /* Generated stub for pubkey_from_node_id */ bool pubkey_from_node_id(struct pubkey *key UNNEEDED, const struct node_id *id UNNEEDED) { fprintf(stderr, "pubkey_from_node_id called!\n"); abort(); } +/* Generated stub for send_backtrace */ +void send_backtrace(const char *why UNNEEDED) +{ fprintf(stderr, "send_backtrace called!\n"); abort(); } /* Generated stub for status_fmt */ void status_fmt(enum log_level level UNNEEDED, const struct node_id *peer UNNEEDED, diff --git a/channeld/test/run-full_channel.c b/channeld/test/run-full_channel.c index f36572a8a..95757e8de 100644 --- a/channeld/test/run-full_channel.c +++ b/channeld/test/run-full_channel.c @@ -9,6 +9,7 @@ #include "../full_channel.c" #include "../commit_tx.c" #include +#include #include /* AUTOGENERATED MOCKS START */ @@ -27,6 +28,9 @@ void memleak_scan_htable(struct htable *memtable UNNEEDED, const struct htable * /* Generated stub for pubkey_from_node_id */ bool pubkey_from_node_id(struct pubkey *key UNNEEDED, const struct node_id *id UNNEEDED) { fprintf(stderr, "pubkey_from_node_id called!\n"); abort(); } +/* Generated stub for send_backtrace */ +void send_backtrace(const char *why UNNEEDED) +{ fprintf(stderr, "send_backtrace called!\n"); abort(); } /* Generated stub for status_failed */ void status_failed(enum status_failreason code UNNEEDED, const char *fmt UNNEEDED, ...) diff --git a/cli/test/run-human-mode.c b/cli/test/run-human-mode.c index 6c3d3177a..4f2af64e5 100644 --- a/cli/test/run-human-mode.c +++ b/cli/test/run-human-mode.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -92,6 +93,9 @@ bool log_level_parse(const char *levelstr UNNEEDED, size_t len UNNEEDED, /* Generated stub for pubkey_from_node_id */ bool pubkey_from_node_id(struct pubkey *key UNNEEDED, const struct node_id *id UNNEEDED) { fprintf(stderr, "pubkey_from_node_id called!\n"); abort(); } +/* Generated stub for send_backtrace */ +void send_backtrace(const char *why UNNEEDED) +{ fprintf(stderr, "send_backtrace called!\n"); abort(); } /* Generated stub for towire_amount_msat */ void towire_amount_msat(u8 **pptr UNNEEDED, const struct amount_msat msat UNNEEDED) { fprintf(stderr, "towire_amount_msat called!\n"); abort(); } diff --git a/cli/test/run-large-input.c b/cli/test/run-large-input.c index 51a9b3f6b..3b8742d6c 100644 --- a/cli/test/run-large-input.c +++ b/cli/test/run-large-input.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -92,6 +93,9 @@ bool log_level_parse(const char *levelstr UNNEEDED, size_t len UNNEEDED, /* Generated stub for pubkey_from_node_id */ bool pubkey_from_node_id(struct pubkey *key UNNEEDED, const struct node_id *id UNNEEDED) { fprintf(stderr, "pubkey_from_node_id called!\n"); abort(); } +/* Generated stub for send_backtrace */ +void send_backtrace(const char *why UNNEEDED) +{ fprintf(stderr, "send_backtrace called!\n"); abort(); } /* Generated stub for towire_amount_msat */ void towire_amount_msat(u8 **pptr UNNEEDED, const struct amount_msat msat UNNEEDED) { fprintf(stderr, "towire_amount_msat called!\n"); abort(); } diff --git a/cli/test/run-remove-hint.c b/cli/test/run-remove-hint.c index e31d8b2f6..908621dd9 100644 --- a/cli/test/run-remove-hint.c +++ b/cli/test/run-remove-hint.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -95,6 +96,9 @@ bool log_level_parse(const char *levelstr UNNEEDED, size_t len UNNEEDED, /* Generated stub for pubkey_from_node_id */ bool pubkey_from_node_id(struct pubkey *key UNNEEDED, const struct node_id *id UNNEEDED) { fprintf(stderr, "pubkey_from_node_id called!\n"); abort(); } +/* Generated stub for send_backtrace */ +void send_backtrace(const char *why UNNEEDED) +{ fprintf(stderr, "send_backtrace called!\n"); abort(); } /* Generated stub for towire_amount_msat */ void towire_amount_msat(u8 **pptr UNNEEDED, const struct amount_msat msat UNNEEDED) { fprintf(stderr, "towire_amount_msat called!\n"); abort(); } diff --git a/common/msg_queue.c b/common/msg_queue.c index 432bb21ff..b4475a0c7 100644 --- a/common/msg_queue.c +++ b/common/msg_queue.c @@ -2,10 +2,13 @@ #include #include #include +#include #include #include #include +static bool warned_once; + struct msg_queue { bool fd_passing; MEMBUF(const u8 *) mb; @@ -60,6 +63,12 @@ static void do_enqueue(struct msg_queue *q, const u8 *add TAKES) *msg = tal_dup_talarr(q, u8, add); + if (!warned_once && msg_queue_length(q) > 100000) { + /* Can cause re-entry, so set flag first! */ + warned_once = true; + send_backtrace("excessive queue length"); + } + /* In case someone is waiting */ io_wake(q); } diff --git a/lightningd/test/run-check_node_announcement.c b/lightningd/test/run-check_node_announcement.c index 26c801708..c41bc1b76 100644 --- a/lightningd/test/run-check_node_announcement.c +++ b/lightningd/test/run-check_node_announcement.c @@ -2,6 +2,7 @@ #include "../gossip_generation.c" #include #include +#include #include #include #include @@ -35,6 +36,9 @@ int node_id_cmp(const struct node_id *a UNNEEDED, const struct node_id *b UNNEED /* Generated stub for pubkey_from_node_id */ bool pubkey_from_node_id(struct pubkey *key UNNEEDED, const struct node_id *id UNNEEDED) { fprintf(stderr, "pubkey_from_node_id called!\n"); abort(); } +/* Generated stub for send_backtrace */ +void send_backtrace(const char *why UNNEEDED) +{ fprintf(stderr, "send_backtrace called!\n"); abort(); } /* Generated stub for towire_bigsize */ void towire_bigsize(u8 **pptr UNNEEDED, const bigsize_t val UNNEEDED) { fprintf(stderr, "towire_bigsize called!\n"); abort(); } diff --git a/lightningd/test/run-find_my_abspath.c b/lightningd/test/run-find_my_abspath.c index de1449701..0c2039df7 100644 --- a/lightningd/test/run-find_my_abspath.c +++ b/lightningd/test/run-find_my_abspath.c @@ -230,6 +230,9 @@ struct runes *runes_early_init(struct lightningd *ld UNNEEDED) /* Generated stub for runes_finish_init */ void runes_finish_init(struct runes *runes UNNEEDED) { fprintf(stderr, "runes_finish_init called!\n"); abort(); } +/* Generated stub for send_backtrace */ +void send_backtrace(const char *why UNNEEDED) +{ fprintf(stderr, "send_backtrace called!\n"); abort(); } /* Generated stub for setup_color_and_alias */ void setup_color_and_alias(struct lightningd *ld UNNEEDED) { fprintf(stderr, "setup_color_and_alias called!\n"); abort(); } diff --git a/lightningd/test/run-invoice-select-inchan.c b/lightningd/test/run-invoice-select-inchan.c index 1a0b4bce0..fe8e12595 100644 --- a/lightningd/test/run-invoice-select-inchan.c +++ b/lightningd/test/run-invoice-select-inchan.c @@ -3,6 +3,7 @@ #include "../peer_control.c" #include "../routehint.c" #include +#include #include #include #include @@ -920,6 +921,9 @@ void report_subd_memleak(struct leak_detect *leak_detect UNNEEDED, struct subd * void resolve_close_command(struct lightningd *ld UNNEEDED, struct channel *channel UNNEEDED, bool cooperative UNNEEDED, const struct bitcoin_tx *close_tx UNNEEDED) { fprintf(stderr, "resolve_close_command called!\n"); abort(); } +/* Generated stub for send_backtrace */ +void send_backtrace(const char *why UNNEEDED) +{ fprintf(stderr, "send_backtrace called!\n"); abort(); } /* Generated stub for shachain_get_secret */ bool shachain_get_secret(const struct shachain *shachain UNNEEDED, u64 commit_num UNNEEDED, diff --git a/lightningd/test/run-jsonrpc.c b/lightningd/test/run-jsonrpc.c index 4975d66b3..f337c24e3 100644 --- a/lightningd/test/run-jsonrpc.c +++ b/lightningd/test/run-jsonrpc.c @@ -3,6 +3,7 @@ #include "../../common/json_stream.c" #include "../jsonrpc.c" #include "../feerate.c" +#include #include #include @@ -160,6 +161,9 @@ bool plugin_hook_call_(struct lightningd *ld UNNEEDED, /* Generated stub for pubkey_from_node_id */ bool pubkey_from_node_id(struct pubkey *key UNNEEDED, const struct node_id *id UNNEEDED) { fprintf(stderr, "pubkey_from_node_id called!\n"); abort(); } +/* Generated stub for send_backtrace */ +void send_backtrace(const char *why UNNEEDED) +{ fprintf(stderr, "send_backtrace called!\n"); abort(); } /* Generated stub for towire_bigsize */ void towire_bigsize(u8 **pptr UNNEEDED, const bigsize_t val UNNEEDED) { fprintf(stderr, "towire_bigsize called!\n"); abort(); } diff --git a/lightningd/test/run-log-pruning.c b/lightningd/test/run-log-pruning.c index 7e2c27565..e20154e86 100644 --- a/lightningd/test/run-log-pruning.c +++ b/lightningd/test/run-log-pruning.c @@ -1,5 +1,6 @@ #include "config.h" #include "../log.c" +#include #include /* AUTOGENERATED MOCKS START */ @@ -99,6 +100,9 @@ bool param(struct command *cmd UNNEEDED, const char *buffer UNNEEDED, /* Generated stub for pubkey_from_node_id */ bool pubkey_from_node_id(struct pubkey *key UNNEEDED, const struct node_id *id UNNEEDED) { fprintf(stderr, "pubkey_from_node_id called!\n"); abort(); } +/* Generated stub for send_backtrace */ +void send_backtrace(const char *why UNNEEDED) +{ fprintf(stderr, "send_backtrace called!\n"); abort(); } /* Generated stub for towire_bigsize */ void towire_bigsize(u8 **pptr UNNEEDED, const bigsize_t val UNNEEDED) { fprintf(stderr, "towire_bigsize called!\n"); abort(); } diff --git a/lightningd/test/run-log_filter.c b/lightningd/test/run-log_filter.c index 1d373cbd2..e39f589f6 100644 --- a/lightningd/test/run-log_filter.c +++ b/lightningd/test/run-log_filter.c @@ -1,4 +1,5 @@ #include "config.h" +#include #include #include #include @@ -91,6 +92,9 @@ void notify_warning(struct lightningd *ld UNNEEDED, struct log_entry *l UNNEEDED bool param(struct command *cmd UNNEEDED, const char *buffer UNNEEDED, const jsmntok_t params[] UNNEEDED, ...) { fprintf(stderr, "param called!\n"); abort(); } +/* Generated stub for send_backtrace */ +void send_backtrace(const char *why UNNEEDED) +{ fprintf(stderr, "send_backtrace called!\n"); abort(); } /* Generated stub for towire_bigsize */ void towire_bigsize(u8 **pptr UNNEEDED, const bigsize_t val UNNEEDED) { fprintf(stderr, "towire_bigsize called!\n"); abort(); } diff --git a/lightningd/test/run-shuffle_fds.c b/lightningd/test/run-shuffle_fds.c index e56927c67..0a2e1c018 100644 --- a/lightningd/test/run-shuffle_fds.c +++ b/lightningd/test/run-shuffle_fds.c @@ -37,6 +37,7 @@ static int test_fcntl(int fd, int cmd, ... /* arg */ ) } #include "../subd.c" +#include #include #include @@ -104,6 +105,9 @@ struct peer_fd *new_peer_fd_arr(const tal_t *ctx UNNEEDED, const int *fd UNNEEDE /* Generated stub for pubkey_from_node_id */ bool pubkey_from_node_id(struct pubkey *key UNNEEDED, const struct node_id *id UNNEEDED) { fprintf(stderr, "pubkey_from_node_id called!\n"); abort(); } +/* Generated stub for send_backtrace */ +void send_backtrace(const char *why UNNEEDED) +{ fprintf(stderr, "send_backtrace called!\n"); abort(); } /* Generated stub for subdaemon_path */ const char *subdaemon_path(const tal_t *ctx UNNEEDED, const struct lightningd *ld UNNEEDED, const char *name UNNEEDED) { fprintf(stderr, "subdaemon_path called!\n"); abort(); } diff --git a/wallet/test/run-wallet.c b/wallet/test/run-wallet.c index af2196d3e..15664715b 100644 --- a/wallet/test/run-wallet.c +++ b/wallet/test/run-wallet.c @@ -737,7 +737,7 @@ enum watch_result onchaind_funding_spent(struct channel *channel UNNEEDED, /* Generated stub for onion_decode */ struct onion_payload *onion_decode(const tal_t *ctx UNNEEDED, const struct route_step *rs UNNEEDED, - const struct pubkey *blinding UNNEEDED, + const struct pubkey *path_key UNNEEDED, const u64 *accepted_extra_tlvs UNNEEDED, struct amount_msat amount_in UNNEEDED, u32 cltv_expiry UNNEEDED, @@ -1036,7 +1036,7 @@ u8 *towire_channeld_got_commitsig_reply(const tal_t *ctx UNNEEDED) u8 *towire_channeld_got_revoke_reply(const tal_t *ctx UNNEEDED) { fprintf(stderr, "towire_channeld_got_revoke_reply called!\n"); abort(); } /* Generated stub for towire_channeld_offer_htlc */ -u8 *towire_channeld_offer_htlc(const tal_t *ctx UNNEEDED, struct amount_msat amount_msat UNNEEDED, u32 cltv_expiry UNNEEDED, const struct sha256 *payment_hash UNNEEDED, const u8 onion_routing_packet[1366] UNNEEDED, const struct pubkey *blinding UNNEEDED) +u8 *towire_channeld_offer_htlc(const tal_t *ctx UNNEEDED, struct amount_msat amount_msat UNNEEDED, u32 cltv_expiry UNNEEDED, const struct sha256 *payment_hash UNNEEDED, const u8 onion_routing_packet[1366] UNNEEDED, const struct pubkey *path_key UNNEEDED) { fprintf(stderr, "towire_channeld_offer_htlc called!\n"); abort(); } /* Generated stub for towire_channeld_sending_commitsig_reply */ u8 *towire_channeld_sending_commitsig_reply(const tal_t *ctx UNNEEDED)