angryip / angryip/ipscan

Windows 3.10.0 crashes on startup: UnsatisfiedLinkError - swt-gdip-win32 missing (stripped from build)

Ouverte
#532 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
5.1k
Forks
835
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

## Description

Angry IP Scanner 3.10.0 fails to start on Windows (both the portable `ipscan-3.10.0-win.exe` and the official `ipscan-3.10.0-setup.exe` installer with bundled Java 25). The main window fails to render with an `UnsatisfiedLinkError` because SWT's `swt-gdip-win32-*.dll` cannot be found.

## Steps to reproduce

1. Download `ipscan-3.10.0-win.exe` (or install via `ipscan-3.10.0-setup.exe`) on Windows 10/11 x86_64
2. Run it
3. Application throws `SWTException` / `UnsatisfiedLinkError` while drawing the main window and crashes

## Error

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-gdip-win32-4973r12 in java.library.path: ...
no swt-gdip-win32 in java.library.path: ...
no swt-gdip in java.library.path: ...
Can't load library: C:\Users.swt\lib\win32\x86_64\swt-gdip-win32-4973r12.dll
Can't load library: C:\Users.swt\lib\win32\x86_64\swt-gdip-win32.dll
Can't load library: C:\Users.swt\lib\win32\x86_64\swt-gdip.dll
)
at org.eclipse.swt.SWT.error(SWT.java:4934)
at org.eclipse.swt.SWT.error(SWT.java:4849)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4136)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
at net.azib.ipscan.gui.GUI.showMainWindow(GUI.java:56)
at net.azib.ipscan.Main.main(Main.java:62)
Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
...
at org.eclipse.swt.internal.gdip.Gdip.(Gdip.java:21)
at org.eclipse.swt.internal.gdip.GdiplusStartupInput.(GdiplusStartupInput.java:25)
at org.eclipse.swt.graphics.Device.checkGDIP(Device.java:226)
at org.eclipse.swt.graphics.Transform.(Transform.java:144)
at org.eclipse.swt.graphics.Transform.(Transform.java:75)
at org.eclipse.swt.graphics.GC.drawImage(GC.java:1045)
at org.eclipse.swt.widgets.Label.wmDrawChildImage(Label.java:571)
...

## Root cause

In `build.gradle`, the packaging step strips several native SWT libraries from the shaded jar as apparently-unused, including `swt-gdip-*.dll`:

https://github.com/angryip/ipscan/blob/master/build.gradle

'swt-awt-.dll',
'swt-wgl-.dll',
'swt-gdip-.dll',
'swt-webkit-.dll',

However, SWT 3.134.0 (`org.eclipse.platform:org.eclipse.swt.win32.win32.x86_64:3.134.0`) actually needs `swt-gdip-win32-*.dll` at runtime — `GC.drawImage()` internally creates a `Transform`, which requires GDI+ (`Device.checkGDIP` → `Gdip.`), and that in turn needs the native `swt-gdip-win32` JNI bridge. This is hit unconditionally while drawing a `Label` image in the main window, so every Windows x86_64 user hits this crash on startup.

## Confirmed workaround

Manually extracting `swt-gdip-win32-4973r12.dll` from the official `org.eclipse.swt.win32.win32.x86_64-3.134.0.jar` on Maven Central and placing it into `%USERPROFILE%\.swt\lib\win32\x86_64\` fixes the crash — the app starts and runs normally. This confirms the DLL is simply missing from the distributed exe/jar, not a system-specific issue.

## Suggested fix

Remove `swt-gdip-*.dll` from the strip/exclude list in `build.gradle` so it's bundled in the Windows build, since it's actually required by this SWT version.

## Environment

- ipscan 3.10.0 (win.exe and setup.exe, both reproduce)
- Windows 10, x86_64
- Reproduces with both system Java 21 (Corretto) and the bundled Java 25 (installer)

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.