SplashScreen segfault when wallet cannot be loaded #604

issue achow101 openend this issue on May 20, 2022
  1. achow101 commented at 7:00 pm on May 20, 2022: member

    Asa reported in https://github.com/bitcoin/bitcoin/issues/25146, when configured to load with a wallet that cannot be loaded, there is a segfault during the shutdown procedure.

    I have been able to trace this segfault to the SplashScreen where the it appears that it is executing an interfaces::Handler that is accessing an object that has already been deleted. This seems to be related to this comment about cleaning up WalletController. Deleting m_splash at the same place appears to resolve the problem. However I am not sure if that is a viable long term fix.

    Note that the segfault does not always occur for me. I believe this is due to deletion order which is not always the same. So sometimes m_splash is deleted before contexts are deleted, and sometimes after those contexts are deleted. I believe the segfault is due to accessing those contexts after deletion.

  2. achow101 added the label Bug on May 20, 2022
  3. hebasto commented at 2:18 pm on May 22, 2022: member

    I believe the segfault is due to accessing those contexts after deletion.

    I can confirm that segfault is due the context object has been deleted before the context.wallet_load_fns.erase(it); call: https://github.com/bitcoin-core/gui/blob/640eb772e55671c5dab29843cebe42ec35cb703f/src/wallet/wallet.cpp#L161-L166

  4. hebasto cross-referenced this on May 22, 2022 from issue Delete splash screen widget early by hebasto
  5. hebasto added the label Wallet on May 22, 2022
  6. fanquake cross-referenced this on Aug 8, 2022 from issue Starting with an unsupported wallet configured leads to a segfault (master only?) by luke-jr
  7. hebasto cross-referenced this on Oct 24, 2022 from issue bitcoin-qt crashes if it can't listen on the port it wants to by dooglus
  8. hebasto closed this on Dec 20, 2022

  9. bitcoin-core locked this on Dec 20, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-23 00:20 UTC

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