Unknown descriptor in wallet crashes #26015

issue luke-jr openend this issue on September 6, 2022
  1. luke-jr commented at 1:54 am on September 6, 2022: member

    Attempting to load a wallet with an unknown descriptor causes a fatal error:

     02022-09-06T01:51:06Z init message: Loading wallet…
     12022-09-06T01:51:06Z [descriptor] Invalid descriptor: Can only have tr at top level: iostream error
     22022-09-06T01:51:06Z [descriptor] Invalid descriptor: Can only have tr at top level: iostream error
     32022-09-06T01:51:06Z [descriptor] Setting spkMan to active: id = 50e6032b4d1d62c020ebb6a4d0c8fafc6f01ea80f4d2a41c1a256086611636e9, type = legacy, internal = false
     42022-09-06T01:51:06Z [descriptor] Setting spkMan to active: id = 7f709abbde61e8c253798375692bf41202e625ed74a65f9474d464be34fb2870, type = p2sh-segwit, internal = false
     52022-09-06T01:51:06Z [descriptor] Setting spkMan to active: id = 2dc6c34099e0ca1235fc990a51042967ecbc8c8ac57062f964739cba2f451be8, type = bech32, internal = false
     62022-09-06T01:51:06Z [descriptor] Setting spkMan to active: id = 8d3c63ea1ac9936e789713dc8bae857d328ff029ab9392e67c716752e9b11b0c, type = bech32m, internal = false
     72022-09-06T01:51:06Z [descriptor] Releasing wallet
     82022-09-06T01:51:06Z 
     9
    10************************
    11EXCEPTION: St12out_of_range       
    12map::at       
    13bitcoin in Runaway exception       
    14
    15
    16
    17************************
    18EXCEPTION: St12out_of_range       
    19map::at       
    20bitcoin in Runaway exception       
    21
    22bitcoin-qt: ./checkqueue.h:204: CCheckQueue<CScriptCheck>::~CCheckQueue() [T = CScriptCheck]: Assertion `m_worker_threads.empty()' failed.
    23Aborted
    

    A fatal error occurred. Bitcoin Core can no longer continue safely and will quit.

    To reproduce, a quick hack:

     0--- a/src/script/descriptor.cpp
     1+++ b/src/script/descriptor.cpp
     2@@ -1408,7 +1408,7 @@ std::unique_ptr<DescriptorImpl> ParseScript(uint32_t& key_exp_index, Span<const
     3         error = "Can only have addr() at top level";
     4         return nullptr;
     5     }
     6-    if (ctx == ParseScriptContext::TOP && Func("tr", expr)) {
     7+    if (ctx == ParseScriptContext::TOP && Func("trx", expr)) {
     8         auto arg = Expr(expr);
     9         auto internal_key = ParsePubkey(key_exp_index, arg, ParseScriptContext::P2TR, out, error);
    10         if (!internal_key) {
    
  2. luke-jr added the label Bug on Sep 6, 2022
  3. MarcoFalke added the label Wallet on Sep 6, 2022
  4. achow101 added this to the milestone 24.0 on Sep 6, 2022
  5. achow101 closed this on Sep 13, 2022

  6. sidhujag referenced this in commit 34db3dc495 on Sep 13, 2022
  7. bitcoin locked this on Sep 13, 2023


luke-jr

Labels
Bug Wallet

Milestone
24.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-19 09:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me