Thanks, I needed something to reproduce your error. In this case, the segv is coming from your program and appears to be an out-of-bound access.
Note the error is not specific to Spark, but occurs on other ARM systems as well as x86.
Compiling with the flags “-O0 -g -Mbounds”, the binary will fail with messages pointing you to the arrays that cause the OOB.
I was able to get it to run after applying the following changes. I’m not sure if I’m correct with the array sizes I used (like setting NMAX=20 instead of 2, given that’s the value of NMAX at the start of the program), so please verify these changes. I’m also not sure if the results are correct or not. I’m guessing there are other issues with this code that you might want to investigate.
Here’s the diff with my changes:
% diff -u WMAT_WO_CONTROL.f WMAT_WO_CONTROL.mod.f
--- WMAT_WO_CONTROL.f 2026-01-11 11:34:29.000000000 -0800
+++ WMAT_WO_CONTROL.mod.f 2026-01-12 08:39:21.859574000 -0800
@@ -990,7 +990,7 @@
RETURN
END
SUBROUTINE CALFUN (N,X,F)
- DIMENSION X(1),F(1)
+ DIMENSION X(2),F(2)
COMPLEX X1,PAR1,AMIEF,EPS,EQUA
COMMON/CARM/PAR1,PAR2,AMIEF,EPS
COMMON/ASTR/D,DELTA,A
@@ -1003,7 +1003,7 @@
SUBROUTINE HYBRI(N,X,F,AJINV,DSTEP,DMAX,ACC,MAXFUN,IPRINT,W,IPCP)
C DIESE SUBROUTINE BENUTZT DAS POWELL-HYBRID-VERFAHREN FUER
C DIE BERECHNUNG DER TRANZENDENTEN GLEICHUNG F(GAMMA).
- DIMENSION X(1),F(1),AJINV(N,N),W(1)
+ DIMENSION X(2),F(2),AJINV(N,N),W(*)
LOGICAL FEHLER
PARAMETER (NMAX=2)
C SETZE VERSCHIEDENE PARAMETER
@@ -1383,7 +1383,7 @@
GO TO 38
1300 END
SUBROUTINE INVE(MAT,N,FEHLER)
- PARAMETER ( NMAX = 2 )
+ PARAMETER ( NMAX = 20 )
REAL MAT(1:NMAX,1:NMAX)
LOGICAL FEHLER
C ..INVERTIERT DIE MATRIX MAT NACH DEM GAUSS-
@@ -1418,7 +1418,7 @@
GOTO 999
ENDIF
ENDIF
- IF ( GEFUND .EQ. .TRUE. ) EXIT
+ IF ( GEFUND .EQV. .TRUE. ) EXIT
ENDDO
C ..MAT(Z,S) IST DAS PIVOTELEMENT
MAT(Z,S) = 1.D0 / MAT(Z,S)
-Mat