sparrowwallet / sparrow

Desktop Bitcoin Wallet focused on security and privacy. Free and open source.
https://sparrowwallet.com/
Apache License 2.0
1.36k stars 192 forks source link

Regression: 2.0.0 RPM can't dlopen libcrypt.so.1, 1.9.1 previously worked #1504

Open wtogami opened 2 months ago

wtogami commented 2 months ago

sparrow-2.0.0-1.x86_64.rpm installed on Fedora 40 x86-64 can't dlopen libcrypt.so.1 so HWI does not work.

sparrow-1.9.1-1.x86_64.rpm works fine. Unclear what is different between the two builds.

java.io.IOException: [7751] Error loading Python lib '/tmp/_MEIZJ4eAV/libpython3.9.so.1.0': dlopen: libcrypt.so.1: cannot open shared object file: No such file or directory

    at com.sparrowwallet.sparrow@2.0.0/com.sparrowwallet.sparrow.io.Hwi.getProcessOutput(Unknown Source)
    at com.sparrowwallet.sparrow@2.0.0/com.sparrowwallet.sparrow.io.Hwi.execute(Unknown Source)
    at com.sparrowwallet.sparrow@2.0.0/com.sparrowwallet.sparrow.io.Hwi.enumerateUsb(Unknown Source)
    at com.sparrowwallet.sparrow@2.0.0/com.sparrowwallet.sparrow.io.Hwi.enumerate(Unknown Source)
    at com.sparrowwallet.sparrow@2.0.0/com.sparrowwallet.sparrow.io.Hwi$ScheduledEnumerateService$1.call(Unknown Source)
    at com.sparrowwallet.sparrow@2.0.0/com.sparrowwallet.sparrow.io.Hwi$ScheduledEnumerateService$1.call(Unknown Source)
    at javafx.graphics@22/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at javafx.graphics@22/javafx.concurrent.Service.lambda$executeTask$6(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at javafx.graphics@22/javafx.concurrent.Service.lambda$executeTask$7(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)
2024-09-19 23:38:27,221 ERROR Error executing hwi-3.1.0
craigraw commented 2 months ago

The difference is an upgrade from HWI 3.0.0 to HWI 3.1.0.

Can you try downloading hwi-3.1.0-linux-x86_64.tar.gz from https://github.com/bitcoin-core/HWI/releases/tag/3.1.0. Extract hwi and run

./hwi enumerate
craigraw commented 2 months ago

I managed to reproduce the issue on Fedora 39 and solved it by running

sudo dnf install libxcrypt-compat

(from https://tex.stackexchange.com/questions/493231/biber-missing-libcrypt-so-1-library-on-fedora)

Please let me know if this fixes it on your side.

wtogami commented 2 months ago

rpm spec syntax

Requires: %{_libdir}/libcrypt.so.1

This syntax should automatically pull in necessary libgcrypt or compat package without knowing the package name within your distro.

Where is your rpm spec file? I couldn't find it so I didn't test this spec syntax.

craigraw commented 2 months ago

Where is your rpm spec file?

The rpm spec file for Sparrow is automatically generated, but since this is a dependency for HWI, not Sparrow, it's not included.

wtogami commented 2 months ago

The rpm spec file for Sparrow is automatically generated, but since this is a dependency for HWI, not Sparrow, it's not included.

Your end users don't know the difference between Sparrow and HWI. Your error message could detect this particular HWI failure and tell the user what they're missing, they should read a particular URL or something for instructions on how to fix it.

craigraw commented 2 months ago

Your end users don't know the difference between Sparrow and HWI.

Yes, I'm aware of that - I was just explaining the situation. This appears to be a recent change in HWI. I'm still considering how to address it.

heredia21 commented 2 weeks ago

What was the fix for this? Getting:

[634028] Error loading Python lib '/tmp/_MEIQfozMe/libpython3.9.so.1.0': dlopen: libcrypt.so.1: cannot open shared object file: No such file or directory

Already ran/installed:

sudo dnf install libxcrypt-compat

Running Fedora 41.

craigraw commented 2 weeks ago

Yes, that was/is the fix. Did it install without issues? Here's the Fedora 41 rpm: https://fedora.pkgs.org/41/fedora-x86_64/libxcrypt-compat-4.4.36-7.fc41.i686.rpm.html

heredia21 commented 2 weeks ago

It installed without issue but the error/issue persists.

[634028] Error loading Python lib '/tmp/_MEIQfozMe/libpython3.9.so.1.0': dlopen: libcrypt.so.1: cannot open shared object file: No such file or directory

With libxcrypt-compat installed.

craigraw commented 2 weeks ago

Difficult to say exactly, but it sounds like it there may be an issue loading the library. I recommend trying to find the libcrypt.so.1 file, and then making sure the system can load it with ldd /path/to/libcrypt.so.1.