NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.27k stars 14.25k forks source link

hdfview: exit on startup #340048

Open CHN-beta opened 2 months ago

CHN-beta commented 2 months ago

Describe the bug

hdfview could not start on last nixos-unstable

Steps To Reproduce

open hdfview with command HDFView, it will crash with following output:

pure virtual method called
terminate called without an active exception
SLF4J: Class path contains multiple SLF4J providers.
SLF4J: Found provider [org.slf4j.simple.SimpleServiceProvider@51081592]
SLF4J: Found provider [org.slf4j.nop.NOPServiceProvider@7f9a81e8]
SLF4J: See https://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual provider is of type [org.slf4j.simple.SimpleServiceProvider@51081592]
SWT OS.java Error: Failed to load swt-pi3, loading swt-pi4 as fallback.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-pi4-gtk-4956r13 in java.library.path: /nix/store/lw2y1rjpcg9hhsh1c22bzc1xfyasd3ni-hdfview-3.3.1/lib/app
no swt-pi4-gtk in java.library.path: /nix/store/lw2y1rjpcg9hhsh1c22bzc1xfyasd3ni-hdfview-3.3.1/lib/app
no swt-pi4 in java.library.path: /nix/store/lw2y1rjpcg9hhsh1c22bzc1xfyasd3ni-hdfview-3.3.1/lib/app
Can't load library: /home/chn/.swt/lib/linux/x86_64/libswt-pi4-gtk-4956r13.so
Can't load library: /home/chn/.swt/lib/linux/x86_64/libswt-pi4-gtk.so
Can't load library: /home/chn/.swt/lib/linux/x86_64/libswt-pi4.so

at swt/org.eclipse.swt.internal.Library.loadLibrary(Library.java:346)
at swt/org.eclipse.swt.internal.Library.loadLibrary(Library.java:255)
at swt/org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:97)
at swt/org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:209)
at swt/org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:155)
at swt/org.eclipse.swt.widgets.Display.<clinit>(Display.java:169)
at hdf.view.HDFView.main(HDFView.java:2596)

Notify maintainers

@jiegec

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

- system: `"x86_64-linux"`
- host os: `Linux 6.10.6-xanmod1, NixOS, 24.11 (Vicuna), 24.11`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.18.5`
- nixpkgs: `/nix/store/qh6hydm7iai2chzwwswapp9mda3whx33-source`

Add a :+1: reaction to issues you find important.

jiegec commented 2 months ago

Thanks for reporting, I have reproduced the issue. Possibly due to a version mismatch.

jiegec commented 2 months ago

Tried to use swt from nixpkgs, but HDFView requires its own swt version. Tried to fix, but to no avail.

doronbehar commented 1 month ago

This issue has been bothering me too. As suggested by this old upstream help thread, I tried to cp ${swt}/jars/swt.jar to replace the vendored swt.jar used by hdfview.src, but it failed to build due to missing symbols. I suspect this is because our swt is very outdated (See https://github.com/NixOS/nixpkgs/issues/219771 )

Because this issue is open for a long time, and I don't see a solution in the near future, I opened https://github.com/NixOS/nixpkgs/pull/346931 to raise the awareness of this issue.

doronbehar commented 1 month ago

Another thing I tried which didn't work was to run HDFView with CLASSPATH and LD_LIBRARY_PATH pointing to Nixpkgs' swt.jar and other swt shared objects, like how tuxguitar, which is the only package I could find that actually relies on our swt and is actually functional with it. All swt related improvements that help debugging this are available in: