Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apache-directory-studio: fix startup #384524

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bjornfor
Copy link
Contributor

@bjornfor bjornfor commented Feb 23, 2025

Things done

  • apache-directory-studio: add missing glib
  • apache-directory-studio: fix startup by creating /tmp/SWT-GDBusServer
  • apache-directory-studio: remove redundant parenthesis

Fixes #333377.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@bjornfor bjornfor added the backport release-24.11 Backport PR automatically label Feb 23, 2025
Fix loading the SWT library by adding glib to the runtime library
search path.

Before:

  $ ./result/bin/ApacheDirectoryStudio
  ApacheDirectoryStudio:
  An error has occurred. See the log file
  /home/bf/.eclipse/1900982865_linux_gtk_x86_64/configuration/1740319909191.log.

where the log file contains

  !SESSION 2025-02-23 15:11:49.037 -----------------------------------------------
  eclipse.buildId=unknown
  java.version=21.0.5
  java.vendor=N/A
  BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
  Framework arguments:  /studio-rcp/resources/icons/linux/studio.xpm
  Command-line arguments:  -os linux -ws gtk -arch x86_64 /studio-rcp/resources/icons/linux/studio.xpm

  !ENTRY org.eclipse.osgi 4 0 2025-02-23 15:11:49.771
  !MESSAGE Application error
  !STACK 1
  java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
  	no swt-pi4-gtk-4940r23 in java.library.path: /nix/store/l1rnlmalihpfg7aj9lxh4mv5ffnqx6qi-webkitgtk-2.46.6+abi=4.0/lib:/etc/sane-libs:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
  	no swt-pi4-gtk in java.library.path: /nix/store/l1rnlmalihpfg7aj9lxh4mv5ffnqx6qi-webkitgtk-2.46.6+abi=4.0/lib:/etc/sane-libs:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
  	Can't load library: /home/bf/.swt/lib/linux/x86_64/libswt-pi4-gtk-4940r23.so
  	Can't load library: /home/bf/.swt/lib/linux/x86_64/libswt-pi4-gtk.so

  	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:338)
  	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:257)
  	at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:96)
  	at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:209)
  	at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:155)
  	at org.eclipse.swt.widgets.Display.<clinit>(Display.java:163)
  	at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:726)
  	at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:168)
  	at org.apache.directory.studio.Application.start(Application.java:47)
  	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
  	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
  	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
  	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
  	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
  	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
  	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
  	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
  	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
  	at org.eclipse.equinox.launcher.Main.run(Main.java:1461)
  	at org.eclipse.equinox.launcher.Main.main(Main.java:1434)

It's worth noting, that when the program fails to load
libswt-pi4-gtk-*.so, it has libswt-pi3-gtk-*.so available (it is put
there by the application):

  $ tree ~/.swt
  /home/bf/.swt
  └── lib
      └── linux
          └── x86_64
              └── libswt-pi3-gtk-4940r23.so

After:

  (a different runtime error, possibly only seen on some DEs -- will be
  fixed in next commit)
@bjornfor bjornfor force-pushed the fix-apache-directory-studio branch from eb6b58b to e881068 Compare February 23, 2025 14:36
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1 10.rebuild-linux: 1-10 labels Feb 23, 2025
@bjornfor bjornfor requested a review from fabianhjr February 23, 2025 14:39
Before:

  $ ./result/bin/ApacheDirectoryStudio
  SWT WebKitGDBus: error creating DBus server Error binding to address (GUnixSocketAddress): No such file or directory
  SWT WebKit: error initializing DBus server, dBusServer == 0

  (Apache Directory Studio:1218305): GLib-GIO-CRITICAL **: 15:17:33.727: g_dbus_server_get_client_address: assertion 'G_IS_DBUS_SERVER (server)' failed
  #
  # A fatal error has been detected by the Java Runtime Environment:
  #
  #  SIGSEGV (0xb) at pc=0x00007fe033c36f48, pid=1218305, tid=1218306
  #
  # JRE version: OpenJDK Runtime Environment (21.0.5+1) (build 21.0.5+1-nixos)
  # Java VM: OpenJDK 64-Bit Server VM (21.0.5+1-nixos, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
  # Problematic frame:
  # C  [libswt-gtk-4940r23.so+0x36f48]  Java_org_eclipse_swt_internal_C_strlen+0xf
  #
  # Core dump will be written. Default location: Core dumps may be processed with "/nix/store/jz45idky1nhvf3c9gz20ds2py19kdvgf-systemd/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /home/bf/areas/itadmin/nixpkgs/core.1218305)
  #
  # An error report file with more information is saved as:
  # /home/bf/areas/itadmin/nixpkgs/hs_err_pid1218305.log
  [2.073s][warning][os] Loading hsdis library failed
  #
  # If you would like to submit a bug report, please visit:
  #   https://bugreport.java.com/bugreport/crash.jsp
  # The crash happened outside the Java Virtual Machine in native code.
  # See problematic frame for where to report the bug.
  #

After:

  $ ./result/bin/ApacheDirectoryStudio
  ** (WebKitWebProcess:1221467): ERROR **: 15:18:35.064: Failed to create server: Error binding to address (GUnixSocketAddress): No such file or directory

...but the GUI opens and the application seems fine.
Tested on NixOS with GNOME (Wayland).

Fixes NixOS#333377.
@bjornfor bjornfor force-pushed the fix-apache-directory-studio branch from 2b225bd to d5f7e84 Compare February 23, 2025 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 backport release-24.11 Backport PR automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

apache-directory-studio unable to run
1 participant