Bug 257206

Summary: java/eclipse crashes with SIGSEGV after displaying splash screen on powerpc
Product: Ports & Packages Reporter: Curtis Hamilton <hamiltcl>
Component: Individual Port(s)Assignee: Piotr Kubaj <pkubaj>
Status: Closed FIXED    
Severity: Affects Only Me CC: jonc, pkubaj, powerpc
Priority: --- Keywords: crash, needs-qa
Version: LatestFlags: koobs: maintainer-feedback? (jonc)
koobs: merge-quarterly-
Hardware: powerpc   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254149
Attachments:
Description Flags
Full java crash log
none
Powerpc64 big endian work-around none

Description Curtis Hamilton 2021-07-15 13:59:35 UTC
Created attachment 226484 [details]
Full  java crash log

Using: FreeBSD 13.0-STABLE #5 on PowerPC64

Port builds without error.  However, when run eclipse crashes with SIGSEGV after displaying splash screen, just before loading graphical environment.  Seems to have issues with libswt-pi3-gtk-4934r6.so. 

Note: Build and runs fine on FreeBSD 12.1 powerpc64 and 13.0-STABLE on powerpc64le.

Java crash log attached.
Comment 1 Jonathan Chen 2021-07-15 18:58:15 UTC
Unfortunately, I don't have a powerpc rig to work thru' or test the port. The bug may have been introduce with PR 254149
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2021-07-16 01:33:38 UTC
^Triage: Leave maintainer-feedback open until final resolution, request feedback committer that landed bug 254149
Comment 3 Curtis Hamilton 2021-07-22 17:21:09 UTC
Created attachment 226620 [details]
Powerpc64 big endian work-around

I've discovered the issue.  The architecture has been hard coded in the SWT internals for "ppc64le" as the "os.arch" in the following files:

eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java
eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java

Changing "ppc64le" to "ppc64" (or powerpc64) resolves the SIGSEGV issue on big endian but breaks little endian.

The value of os.arch is set in "./production/testScripts/configuration/sdk.tests/testScripts/test.xml" and it may be possible to change this file to support both big endian and little endian.  I'm still researching and testing.

In the interim, the attached patch is a work-around until a more elegant fix can be provided.
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2021-08-09 03:27:54 UTC
^Triage: Piotr, thanks for resolving. Please self-assign (or assign to committers that resolved), it saves us a ton of time, and we don't see all resolved issues.

Note also that all target (fetch, patch, configure, build, package, run) fixes are:

Approved by: portmgr (blanket: <target> fix)

These don't require maintainer approval, or need to wait for the timeout, and you can set the maintainer-approval flag on attachments on this basis w/ above comment.
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2021-08-09 03:28:32 UTC
^Triage: Not marked or merged to quarterly. Not clear if quarterly is affected