Walletwasabi: 1.1.10 consistently crashes on startup on NixOS

Created on 14 Dec 2019  Â·  52Comments  Â·  Source: zkSNACKs/WalletWasabi

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.

debug

Most helpful comment

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.

All 52 comments

Looks like the new Avalonia version is crashing.

Downgrading to 1.1.9.2 crashes on first run

That's ok, it thinks the index file is totally messed up because we replaced it so it crashes and starts over.

@danwalmsley, @jmacato can you look into it?

@molnard with the fix we can give out a backported hotfix release.

Version check hangs for me too, so that's unrelated. Opened an issue for that: https://github.com/zkSNACKs/WalletWasabi/issues/2857

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)

Can someone test the PR? https://github.com/zkSNACKs/WalletWasabi/pull/2891

If it works, then we're ready for backport release.

@hkjn We fixed a few things with this hotfix, try it!
https://github.com/zkSNACKs/WalletWasabi/releases
Good luck!

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...

@jmacato Are you sure you reproduced the same issue on void linux here? https://github.com/zkSNACKs/WalletWasabi/pull/2891

It seems the this and https://github.com/zkSNACKs/WalletWasabi/issues/2836 are not the same, the other one is resolved.

When looking at something else, I came across https://github.com/NixOS/nixpkgs/pull/73262/, which helped a bit in demystifying how dotnet builds works on NixOS for me (I'm not a dotnet dev and also fairly new to NixOS). That PR, which is unmerged at time of writing, makes it possible to use different dotnet-sdk versions for different Nix packages, and shows that the only supported dotnet-sdk version on Nix before that is 2.2.

Since Wasabi uses dotnet-sdk 3.1 now, I was thinking that this could be related to the current issue.

However, trying out the PR and switching Wasabi to 3.1 still leads to the same Avalonia-related NullReferenceException as before. Also, dotnet-sdk isn't actually used to build the wasabiwallet package from source, but rather it is (afaict) required to patch .so files and the wassabee binary that the Nix package fetches from the released tarball, as seen in the wasabiwallet package.

In short, I'm not sure if the dotnet-sdk 2.2 vs 3.1 thing is relevant here. Perhaps @mmahut can shed some light on this as the original author and maintainer of the wasabiwallet Nix package? At any rate following this issue might be useful, so we can figure out how to proceed with Wasabi on Nix.

I'd want to avoid this becoming a drain on Wasabi developers, since you made it clear back in https://github.com/zkSNACKs/WalletWasabi/issues/2130 that the project is not interested in officially supporting Nix packaging at this time.

I don't think .NET Core 3 is relevant here, as the NullReferenceException comes from Avalonia, so you were able to run the .NET Core 3 app. @jmacato said a few things on the dev meeting today. Please share your findings under this issue, too.

Makes sense @nopara73.

@hkjn Hi, i wonder if you can point me to a step by step guide on initializing a nixOS instance in Virtualbox? Preferrably with the same setup that you also have that can repro this issue.

@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

3) Install 1.1.10.1:

nix-env -iA wasabi.wasabiwallet

4) Run wasabiwallet.

I installed a NixOS 19.09.1686 in a VM and followed the instructions provided by @mmahut . It failed immediately with the exact same error:

image

Clearly there is a problem with Avalonia here but it is also important to see that there exist another important issue with Tor.

[demo@nixos:~]$ ls .walletwasabi/client/tor/Tor
libcrypto.so.1.0.0  libevent-2.1.so.6  libgmp.so.10  libssl.so.1.0.0  libstdc++  tor

[demo@nixos:~]$ ls -l .walletwasabi/client/tor/Tor                
total 6716
-rwxr-x--- 1 demo users 2282608 Jan  1  2000 libcrypto.so.1.0.0
-rwxr-x--- 1 demo users  371064 Jan  1  2000 libevent-2.1.so.6
-rwxr-x--- 1 demo users  622427 Jan  1  2000 libgmp.so.10
-rwxr-x--- 1 demo users  486600 Jan  1  2000 libssl.so.1.0.0
drwxr-x--- 2 demo users    4096 Dec 29 04:07 libstdc++
-rwxr-x--- 1 demo users 3102224 Jan  1  2000 tor

[demo@nixos:~]$ ./.walletwasabi/client/tor/Tor/tor
bash: ./.walletwasabi/client/tor/Tor/tor: No such file or directory

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:

You can't usually run binary files in NixOS, they will either need some environment variables set or to be patched with patchElf.

Source: https://unix.stackexchange.com/questions/91577/cannot-execute-binary-in-nixos-no-such-file-or-directory

There is also this issue about wasabi not finding the tor executable in NixOS.


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.


I have checked the wasabi package for NixOS and looks okay, it is maintained by the NixOS community and we could, alternatively, let them to deal with this if they really want to support Wasabi. I mean, I think they would need to patch Tor with patchElf and invoke wasabi with the appropriate LD_LIBRARY_PATH paths (this is what i suspect is making Avalonia to fail, but i am not sure).

that there exist another important issue with Tor.

Fwiw, I'm not seeing this issue with a missing bundled tor binary on my system:

$ file ~/.walletwasabi/client/tor/Tor/tor
/home/user/.walletwasabi/client/tor/Tor/tor: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.26, stripped

This is with wasabi 1.1.9.2, which is the latest version that's functional for me at time of writing. Did you notice your issue around a missing bundled tor binary with that version of wasabi, or on another version?

There is also this issue about wasabi not finding the tor executable in NixOS.

Right, I filed that issue as well. Unless I'm mistaken, the "no such file or directory" errors seen there are about not finding hwi-related files though, not Tor: https://github.com/zkSNACKs/WalletWasabi/issues/2289#issuecomment-532969715

(to complicate matters slightly, there were indeed some Tor-related issues around connectivity for that issue, but that ended up being irrelevant to the "no such file or directory" errors, see https://github.com/zkSNACKs/WalletWasabi/issues/2289#issuecomment-534207288)

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.

Right, as a reference for others, the historical issue that led to the current state of the Wasabi project not officially supporting the community-provided Nix packages is here: https://github.com/zkSNACKs/WalletWasabi/issues/2130

I have checked the wasabi package for NixOS and looks okay, it is maintained by the NixOS community and we could, alternatively, let them to deal with this if they really want to support Wasabi.

Right, it is in my (unofficial, since I'm not in maintainers for this specific package yet it seems) role as NixOS package maintainer that I filed this issue; I'm trying to build a version of Wasabi that I can use: https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/blockchains/wasabiwallet/default.nix. :)

I mean, I think they would need to patch Tor with patchElf and invoke wasabi with the appropriate LD_LIBRARY_PATH paths (this is what i suspect is making Avalonia to fail, but i am not sure).

Via the info above, I think that this shouldn't be necessary, since the Wasabi Tor integration seems to work well in my usage on NixOS to date with version 1.1.9.2 and earlier. We can look into the "missing bundled tor binary" issue you reported above independently, if it can be reproduced.

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.

hey folks, upon looking at avalonia's repo, i found this closed issue:
https://github.com/AvaloniaUI/Avalonia/issues/3020#issuecomment-533881126
seems like it could be useful on this instance, since NixOS apparently doesnt conform to Linux FHS.

https://github.com/NixOS/nixpkgs/issues/61229

Can you attempt to resolve it @jmacato ? Apparently @mtrsk managed to resolve it too: https://github.com/NixOS/nixpkgs/issues/61229#issuecomment-533881308

Also it's similar to the NRE reported here: https://github.com/zkSNACKs/WalletWasabi/issues/2975

@nopara73 I think the ball is in the NixOS wasabi package maintainer hands now, since they need to setup LD_LIBRARY_PATH properly and/or that patchElf thing (not too familiar with that thing I'm afraid) in order to load Xorg, Tor and other native dependencies that wasabi has.

@hkjn this comment could be of help: https://github.com/AvaloniaUI/Avalonia/issues/3020#issuecomment-533881126

@jmacato The goal is Wasabi to work with the .tar.gz on NixOS, since we are not supporting the package and we cannot advise people to use that, although they may choose to do so, as if the maintainer is malicious, then he can steal everyone NixOS user's bitcoins.

For example here's a case when an npm lib maintainer stole bitcoins of many: https://blog.npmjs.org/post/180565383195/details-about-the-event-stream-incident

@nopara73 yes i agree though (Folks more familar with nixOS should correct me with this but) I think the issue is that the library paths for xorg and other stuff seems to be dynamically determined by their build system.. I'm not sure if we could hard-code an environment variable for it. Hopefully I'm wrong on this and that we can make some kind of a bash launcher that setups the necessary environmental variables for each distro.

I'm not sure if we could hard-code an environment variable for it.

Everything is possible. The worse case scenario we can rewrite the lib in C# itself (or even go down to assembly level haha.) Anyhow, if that's the case, then this issue will be open for a while.

However, this raises the question, why was it working before?

However, this raises the question, why was it working before?

Yeah.. I'm not sure either, there is however the transition from using GTK as our Linux backend from Avalonia 0.8 into directly interfacing Xorg itself by Avalonia 0.9. That could have some bearing on this class of issues we're getting.

OK what happens here:
Avalonia gets told window size is 0.
This causes exception in UnmanagedBlob ctor, leaving partially constructed object.
On dispose this throws exception because _plat variable is null.

Can also be repoduced on WSL

OP must be using SW rendering or not have working GPU to produce this.

We can also partially blame my PR https://github.com/AvaloniaUI/Avalonia/pull/3009, apparently some screens on xorg reports zero by zero resolution... :/ need to add more checks before passing the default resolution to the native stuff

Keeping this open til we merge new avalonia to master and get confirmation of the fix from OP

Thanks all for the investigation and fixes!

I agree with keeping the issue open until new Avalonia version can be bundled up in a Wasabi release, and would be happy to verify the fix, and continue maintaining Nix packages for Wasabi as long as it's feasible.

However for now, I have resorted to running Wasabi on a Debian Stretch VM, where my full node's bitcoin-p2p socket (tcp/8333) has been forwarded to the VM, which Wasabi then detects and connects to as 127.0.0.1:8333. This allows me to run version 1.1.10.2, and also has the effect of somewhat sandboxing Wasabi away from other software on the system.

Here we go again. Can you try the master branch from code? https://github.com/zkSNACKs/WalletWasabi/pull/2988

Here we go again. Can you try the master branch from code? #2988

Thanks @nopara73. Could you also creating a release? (on your own fork of the repo is fine)

(The current Nix package for Wasabi just unpacks the released .tar.gz and patches the wassabee binary and .so files. https://github.com/NixOS/nixpkgs/pull/73262/ did land, so in theory we could switch the Nix package to build using dotnet-sdk 3.1, but I don't know how much time I can spend on looking into that, so testing from a released .tar.gz would speed things up.)

@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. :pray:

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.

@hkjn glad to hear this! Thanks for your assistance and patience on this issue. I will close the issue now.

@danwalmsley Should we really close it before we solve the issue that the fix created? https://github.com/zkSNACKs/WalletWasabi/issues/2939#issuecomment-577151061

I'm running into this exact problem on Ubuntu LTS 14.04

Wasabi Client Version: 1.1.10.2
Compatible Coordinator Version: 3
Compatible Bitcoin Core Version: 0.19.0.1
Compatible Hardware Wallet Interface Version: 1.0.3

2020-02-28 06:08:09 INFO Program (44) Wasabi GUI started (1303fc53-1773-43ad-8b35-e73fbf63e0b7).
2020-02-28 06:08:11 INFO Global (164) Config is successfully initialized.
2020-02-28 06:08:11 INFO IndexStore (43) InitializeAsync finished in 24 milliseconds.
2020-02-28 06:08:11 INFO TransactionStore (28) MempoolStore.InitializeAsync finished in 14 milliseconds.
2020-02-28 06:08:11 INFO TransactionStore (28) ConfirmedStore.InitializeAsync finished in 3 milliseconds.
2020-02-28 06:08:11 INFO Global (422) AddressManager did not exist at /home/k/.walletwasabi/client/AddressManager/AddressManagerMain.dat. Initializing new one.
2020-02-28 06:08:11 INFO AllTransactionStore (27) InitializeAsync finished in 18 milliseconds.
2020-02-28 06:08:11 INFO BitcoinStore (39) InitializeAsync finished in 37 milliseconds.
2020-02-28 06:08:11 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()

@claimlu thank you for your report. Maybe it is not NixOS only. Reopening the issue and investigate more.

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

@claimlu Can you try it from source code? Not sure if the fix is shipped already or not: https://github.com/zkSNACKs/WalletWasabi#build-from-source-code

Yes I successfully installed dotnet SDK, built, and run wasabi, however it's still failing when run wassabee from the prebuilt

Thank you!

@danwalmsley @jmacato would you mind taking a look at this?

Also maybe @MaxHillebrand with your new monster, can you fire up a lubuntu vm?

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

VirtualBox_ubuntu_01_03_2020_20_17_19

aaand fixed on master :)
VirtualBox_ubuntu_01_03_2020_23_06_39

@jmacato can you try the backport branch? If not good, what is the fix? We should make sure it's backported.

@molnard we should give out a silent release soon.

@nopara73 im sure that the newest Avalonia fixed it, not sure if it's on backport but i'll test it

@nopara73 Backport branch works as well
VirtualBox_ubuntu_02_03_2020_19_17_00

I think what @claimlu meant was that he built wasabi from source in lubuntu and it worked. The package from the website however didnt.

Awesome! Closing. Will try to release silently tomorrow.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

molnard picture molnard  Â·  3Comments

MaxHillebrand picture MaxHillebrand  Â·  3Comments

trading2835 picture trading2835  Â·  3Comments

gabridome picture gabridome  Â·  3Comments

2pac1 picture 2pac1  Â·  3Comments