WalletWasabi: 1.1.10 consistently crashes on startup on NixOS

General Description

I tried building version 1.1.10 for NixOS, but found that the program crashes on startup, consistently. In the included logs below, the first run is after an upgrade from 1.1.9.2, then I attempt to show the version (wasabiwallet --version command seems to hang indefinitely and I ^C it eventually). The second (and third, …) run still crashes, but without the messages around Old Index file, presumably because those were deleted during the first run. If I downgrade to 1.1.9.2 at this point, that version of the software also crashes, with a different stacktrace included below. However, on subsequent runs, 1.1.9.2 manages to start, and gets to work re-downloading the block filters, so the situation can be managed by not upgrading for now.

How To Reproduce?

  1. Launch wasabiwallet on NixOS

Operating System

NixOS 20.03.git.5de7286 (Markhor)

Logs

After upgrade from 1.1.9.2

$ wasabiwallet
2019-12-14 08:57:00 INFO        Program (44)    Wasabi GUI started (f3ba122e-7fd1-450c-86ab-f0a1cd18e708).
2019-12-14 08:57:04 INFO        Global (158)    Config is successfully initialized.
2019-12-14 08:57:04 WARNING     IndexStore (111)        Old Index file detected. Deleting it.
2019-12-14 08:57:04 INFO        TransactionStore (28)   ConfirmedStore.InitializeAsync finished in 3 milliseconds.
2019-12-14 08:57:04 INFO        TransactionStore (28)   MempoolStore.InitializeAsync finished in 26 milliseconds.
2019-12-14 08:57:04 INFO        TorProcessManager (249) Starting Tor monitor...
2019-12-14 08:57:04 INFO        Global (220)    TorProcessManager is initialized.
2019-12-14 08:57:04 WARNING     IndexStore (114)        Successfully deleted old Index file.
2019-12-14 08:57:04 WARNING     Program (95)    System.NullReferenceException: Object reference not set to an instance of an object.
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.DoDispose()
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.Finalize()
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.DoDispose()
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.Finalize()
Aborted (core dumped)

Checking for version seems to hang

$ wasabiwallet --version
Wasabi Client Version: 1.1.10.0
Compatible Coordinator Version: 3
Compatible Bitcoin Core Version: 0.18.1
Compatible Hardware Wallet Interface Version: 1.0.3

^C
$

Attempting to run again still crashes

$ wasabiwallet
2019-12-14 08:57:39 INFO        Program (44)    Wasabi GUI started (180e0f20-25fc-463b-9385-52ee5e9e69d5).
2019-12-14 08:57:43 INFO        Global (158)    Config is successfully initialized.
2019-12-14 08:57:43 INFO        IndexStore (43) InitializeAsync finished in 52 milliseconds.
2019-12-14 08:57:43 INFO        TransactionStore (28)   MempoolStore.InitializeAsync finished in 24 milliseconds.
2019-12-14 08:57:43 INFO        TransactionStore (28)   ConfirmedStore.InitializeAsync finished in 4 milliseconds.
2019-12-14 08:57:43 INFO        TorProcessManager (249) Starting Tor monitor...
2019-12-14 08:57:43 INFO        Global (220)    TorProcessManager is initialized.
2019-12-14 08:57:43 INFO        TorProcessManager (66)  Tor is already running.
2019-12-14 08:57:43 INFO        AllTransactionStore (27)        InitializeAsync finished in 436 milliseconds.
2019-12-14 08:57:43 INFO        BitcoinStore (39)       InitializeAsync finished in 481 milliseconds.
2019-12-14 08:57:43 INFO        Global (394)    Loaded AddressManager from `/home/user/.walletwasabi/client/AddressManager/AddressManagerMain.dat`.
2019-12-14 08:57:43 INFO        HostedServices (49)     Started Software Update Checker.
2019-12-14 08:57:43 INFO        MainWindow.xaml (74)    UiConfig is successfully initialized.
2019-12-14 08:57:43 INFO        Global (329)    Start connecting to nodes...
2019-12-14 08:57:43 INFO        Global (351)    Start synchronizing filters...
2019-12-14 08:57:49 WARNING     Program (95)    System.NullReferenceException: Object reference not set to an instance of an object.
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.DoDispose()
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.Finalize()
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.DoDispose()
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.Finalize()
Aborted (core dumped)

Downgrading to 1.1.9.2 crashes on first run

2019-12-14 09:04:37 INFO        Program (43)    Wasabi GUI started (7a7895b2-ec7d-469b-9627-de3872333306).
2019-12-14 09:04:43 INFO        Global (142)Config is successfully initialized.
2019-12-14 09:04:43 ERROR       IndexStore (125)     An index file got corrupted. Deleting index files...
2019-12-14 09:04:43 INFO        HwiProcessManager (240)      Updating HWI...
2019-12-14 09:04:43 INFO        HwiProcessManager (270)      Extracted /nix/store/24g50jpfpqqham13b542pak236mk073r-wasabiwallet-1.1.9.2/opt/wasabiwallet/Hwi/Software/hwi-linux64.zip to `/home/user/.walletwasabi/client/hwi`.
2019-12-14 09:04:43 INFO        HwiProcessManager (282)      Shell command executed: chmod -R 750 /home/user/.walletwasabi/client/hwi.
2019-12-14 09:04:43 INFO        TorProcessManager (253)      Starting Tor monitor...
2019-12-14 09:04:43 INFO        Global (203)TorProcessManager is initialized.
2019-12-14 09:04:43 CRITICAL    Program (66)System.FormatException: Invalid hex length
   at NBitcoin.uint256..ctor(String str)
   at WalletWasabi.Backend.Models.FilterModel.FromHeightlessLine(String line, Height height)
   at WalletWasabi.Stores.IndexStore.InitializeFiltersAsync()
   at WalletWasabi.Stores.IndexStore.InitializeAsync(String workFolderPath, Network network, HashChain hashChain)
   at WalletWasabi.Stores.BitcoinStore.InitializeAsync(String workFolderPath, Network network)
   at WalletWasabi.Gui.Global.InitializeNoWalletAsync()
   at WalletWasabi.Gui.Program.<>c__DisplayClass1_0.<<Main>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority)
   at Avalonia.X11.X11PlatformThreading.CheckSignaled()
   at Avalonia.X11.X11PlatformThreading.RunLoop(CancellationToken cancellationToken)
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
   at Avalonia.Application.Run(Window mainWindow)
   at WalletWasabi.Gui.Program.Main(String[] args)
2019-12-14 09:04:43 INFO        Global (620)UpdateChecker is stopped.
2019-12-14 09:04:43 INFO        Global (626)Synchronizer is stopped.
2019-12-14 09:04:43 INFO        TorProcessManager (66)       Tor is already running.
^C2019-12-14 09:06:44 WARNING   Global (173)    Process was signaled for killing.

^C2019-12-14 09:08:08 WARNING   Global (173)    Process was signaled for killing.
^C2019-12-14 09:08:10 WARNING   Global (173)    Process was signaled for killing.
$

Wasabi Version

Which wasabi release are you using? Where did you download it from?

1.1.10.0, installed via NixOS package.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 52 (35 by maintainers)

Most upvoted comments

I’m happy to report that the v1.1.10.2-200122 build does not crash on startup on NixOS, and as far as I can tell in some basic testing seems to have no major issues, so the Avalonia fixes seem to have helped.

@jmacato sure:

  1. Download the VirtualBox image at https://nixos.org/nixos/download.html
  2. Once booted, add the channel that has the change:
nix-channel --add https://github.com/mmahut/nixpkgs/archive/wasabi.tar.gz wasabi
nix-channel --update
  1. Install 1.1.10.1:
nix-env -iA wasabi.wasabiwallet
  1. Run wasabiwallet.

Awesome! Closing. Will try to release silently tomorrow.

aaand fixed on master 😃 VirtualBox_ubuntu_01_03_2020_23_06_39

Confirmed on Lubuntu 14.04 VM with the current release (1.1.10.2).

VirtualBox_ubuntu_01_03_2020_20_17_19

It’s actually Lubuntu (a light version of Ubuntu). Not sure any differences

@molnard as we also need a packaged binary for testing on tails, it would really be great if you can make both .deb and .tar.gz in your own fork and provide a download link. 🙏

NixOS cannot find tor even when it is there. I found that this same problem is affecting other projects too and this is a relevant answer in StackOverflow:

This is usually from the binary not able to find a library that it’s linked against. If you do ldd .walletwasabi/client/tor/Tor/tor you’ll see that it couldn’t a few things. Alternatively, a binary might do dlopen in which you wouldn’t see it ldd, even though a particular library is needed. If you’re setting a runpath with patchelf, then you’ll want to keep $ORIGIN in the runpath so that it’s able to pick up other binaries in the same directory (E.g. --set-rpath ‘$ORIGIN:${rpath}’)

Apparently NixOS is a bit different that other linux distros and we have to decide if we want to support it officially because it will require further investigation, changes and testing specially focused on this distro.

NixOS is very different as it doesn’t conform to FHS:

[11:47:03] jon@jon-workstation ~/projects/nixpkgs (master)
$ tree /bin/
/bin/
└── sh -> /nix/store/m7v6p7yxqyhnc4sxp49zp857cjamp996-bash-interactive-4.4-p23/bin/sh

0 directories, 1 file
[11:47:08] jon@jon-workstation ~/projects/nixpkgs (master)
$ tree /usr
/usr
└── bin
    └── env -> /nix/store/gnw6yrqy249n62r4q8vy12ispviv3dav-coreutils-8.31/bin/env

All packages are installed in /nix/store/ at hashed paths (hash is based on all dependencies and configuration settings), so the only way they can run is if they reference their dependencies exactly, this allows for greater reproducibility of builds, as well allows for a way to gracefully add or remove packages from an environment. Example:

[11:52:44] jon@jon-workstation ~/projects/nixpkgs (master)
$ ruby
The program ‘ruby’ is currently not installed. It is provided by
several packages. You can install it by typing one of the following:
  nix-env -iA nixos.jruby
  nix-env -iA nixos.logstash6-oss
  nix-env -iA nixos.logstash7-oss
  nix-env -iA nixos.ruby
  nix-env -iA nixos.rubyMinimal
  nix-env -iA nixos.ruby_2_4
  nix-env -iA nixos.ruby_2_5
  nix-env -iA nixos.ruby_2_7
[11:53:15] jon@jon-workstation ~/projects/nixpkgs (master)
$ nix-shell -p ruby
these paths will be fetched (3.80 MiB download, 17.93 MiB unpacked):
  /nix/store/ngc0m5s0qrfv821h74nwscvia64iwmq2-ruby-2.6.5
copying path '/nix/store/ngc0m5s0qrfv821h74nwscvia64iwmq2-ruby-2.6.5' from 'https://cache.nixos.org'...

[nix-shell:~/projects/nixpkgs]$ ruby --help
Usage: ruby [switches] [--] [programfile] [arguments]
...
[nix-shell:~/projects/nixpkgs]$ exit
[11:54:30] jon@jon-workstation ~/projects/nixpkgs (master)
$ ruby --help
The program ‘ruby’ is currently not installed. It is provided by
several packages. You can install it by typing one of the following:
  nix-env -iA nixos.jruby
  nix-env -iA nixos.logstash6-oss
  nix-env -iA nixos.logstash7-oss
  nix-env -iA nixos.ruby
  nix-env -iA nixos.rubyMinimal
  nix-env -iA nixos.ruby_2_4
  nix-env -iA nixos.ruby_2_5
  nix-env -iA nixos.ruby_2_7

you can add or remove packages from a given environment without affecting your global system.

Thanks for the fix, but v1.1.10.1 seems to still have the issue reported here on NixOS (the hang on --version does appear to be fixed though):

$ wasabiwallet --version
Wasabi Client Version: 1.1.10.1
Compatible Coordinator Version: 3
Compatible Bitcoin Core Version: 0.18.1
Compatible Hardware Wallet Interface Version: 1.0.3

$ wasabiwallet
2019-12-23 03:40:14 INFO        Program (44)    Wasabi GUI started (ac132b16-1f34-4c8b-a709-43b9e2237d14).
2019-12-23 03:40:17 INFO        Global (163)    Config is successfully initialized.
2019-12-23 03:40:17 WARNING     IndexStore (111)        Old Index file detected. Deleting it.
2019-12-23 03:40:17 WARNING     IndexStore (114)        Successfully deleted old Index file.
2019-12-23 03:40:17 INFO        TransactionStore (28)   MempoolStore.InitializeAsync finished in 22 milliseconds.
2019-12-23 03:40:18 INFO        TorProcessManager (249) Starting Tor monitor...
2019-12-23 03:40:18 INFO        Global (225)    TorProcessManager is initialized.
2019-12-23 03:40:18 INFO        IndexStore (43) InitializeAsync finished in 160 milliseconds.
2019-12-23 03:40:18 INFO        TorProcessManager (66)  Tor is already running.
2019-12-23 03:40:18 INFO        TransactionStore (28)   ConfirmedStore.InitializeAsync finished in 502 milliseconds.
2019-12-23 03:40:18 INFO        Global (399)    Loaded AddressManager from `/home/user/.walletwasabi/client/AddressManager/AddressManagerMain.dat`.
2019-12-23 03:40:18 INFO        MainWindow.xaml (74)    UiConfig is successfully initialized.
2019-12-23 03:40:18 INFO        AllTransactionStore (27)        InitializeAsync finished in 848 milliseconds.
2019-12-23 03:40:18 INFO        BitcoinStore (39)       InitializeAsync finished in 893 milliseconds.
2019-12-23 03:40:18 INFO        HostedServices (49)     Started Software Update Checker.
2019-12-23 03:40:19 INFO        Global (334)    Start connecting to nodes...
2019-12-23 03:40:19 INFO        Global (356)    Start synchronizing filters...
2019-12-23 03:40:19 WARNING     Program (95)    System.NullReferenceException: Object reference not set to an instance of an object.
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.DoDispose()
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.Finalize()
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.DoDispose()
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.Finalize()
Aborted (core dumped)

$ wasabiwallet
2019-12-23 03:40:38 INFO        Program (44)    Wasabi GUI started (d57f7806-6b7a-4cc8-8078-2afe277ede5f).
2019-12-23 03:40:41 INFO        Global (163)    Config is successfully initialized.
2019-12-23 03:40:42 INFO        IndexStore (43) InitializeAsync finished in 54 milliseconds.
2019-12-23 03:40:42 INFO        TransactionStore (28)   MempoolStore.InitializeAsync finished in 27 milliseconds.
2019-12-23 03:40:42 INFO        TorProcessManager (249) Starting Tor monitor...
2019-12-23 03:40:42 INFO        Global (225)    TorProcessManager is initialized.
2019-12-23 03:40:42 INFO        TorProcessManager (66)  Tor is already running.
2019-12-23 03:40:42 INFO        TransactionStore (28)   ConfirmedStore.InitializeAsync finished in 484 milliseconds.
2019-12-23 03:40:42 INFO        AllTransactionStore (27)        InitializeAsync finished in 517 milliseconds.
2019-12-23 03:40:42 INFO        BitcoinStore (39)       InitializeAsync finished in 563 milliseconds.
2019-12-23 03:40:42 INFO        Global (399)    Loaded AddressManager from `/home/user/.walletwasabi/client/AddressManager/AddressManagerMain.dat`.
2019-12-23 03:40:42 INFO        HostedServices (49)     Started Software Update Checker.
2019-12-23 03:40:42 INFO        MainWindow.xaml (74)    UiConfig is successfully initialized.
2019-12-23 03:40:42 INFO        Global (334)    Start connecting to nodes...
2019-12-23 03:40:42 INFO        Global (356)    Start synchronizing filters...
2019-12-23 03:40:47 WARNING     Program (95)    System.NullReferenceException: Object reference not set to an instance of an object.
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.DoDispose()
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.Finalize()
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.DoDispose()
   at Avalonia.Shared.PlatformSupport.StandardRuntimePlatform.UnmanagedBlob.Finalize()
Aborted (core dumped)

oh okay, seems someone also encountered this on Avalonia 0.9 (via Arch Linux). This PR should hopefully fix this: https://github.com/AvaloniaUI/Avalonia/pull/3363

and Chromium seems to have stumbled upon this bug 10 months ago: https://r882-11cdd11fc1da-maruel-dot-chromiumcodereview.appspot.com/1707283002/ (credits to: @PJB3005)