I ran into the same crash and traced it. Guido wrote here in August 2022 (post 9) that he would look into it, and OliviaS confirmed it on 2.20 in post 12; it still happens on ccx 2.23 and on master (9ba5d76). Below are a minimal deck, the cause (dyna.c passes NULL work arrays to nonlinmpc) and a possible fix.
The deck of the first post (shellf.inp with its *MODAL DYNAMIC step) crashes on 2.23 with the same backtrace as the deck below (nonlinmpc_ ← dyna, address 0x0). OliviaS’s observation in post 3 was the right lead: the crash comes from the mean-rotation MPCs that the *MODAL DYNAMIC run generates. (The random stops of *STEADY STATE DYNAMICS on large models in posts 10-11 are a different problem, see Steady state dynamics randomly terminates without error; *STEADY STATE DYNAMICS is not affected by this one.)
Checked on ccx 2.23 (macOS arm64, OMP_NUM_THREADS=1) and master 9ba5d76 (16 Oct 2026).
What triggers it
A *MODAL DYNAMIC step segfaults (exit 139) right after the *FREQUENCY step when a shell or beam node that is not a knot has a rotational boundary condition, for example a clamp 1, 1, 6, or a moment. ccx turns such an SPC or moment into a mean-rotation MPC (label MEANROTBS). dyna.c then calls nonlinmpc for it with the work arrays aux and iaux still NULL, and nonlinmpc writes into them.
The deck below follows the rule for 1D and 2D elements in modal dynamics in section 6.9.5 (Modal dynamic analysis) of the 2.23 manual: the point load of the *MODAL DYNAMIC step is also defined, with magnitude zero, in the *FREQUENCY step. It crashes even with no load at all in the *MODAL DYNAMIC step. The same model runs in *STEADY STATE DYNAMICS, and the strip held by translational SPCs only runs in *MODAL DYNAMIC and matches the superposition of ccx’s own modes. A crash where the manual describes the input as supported is a bug.
Before it crashes, ccx prints the warning shown in post 12 (CalculiX.c:1426): point loads on 1-D or 2-D elements must also be applied, with magnitude zero, in the preceding *FREQUENCY step; “look at example shellf.inp for a guideline.” The test deck shellf.inp is exactly such a model (S8 shells clamped with Nfixx,1,6). Run in *MODAL DYNAMIC instead of its *STEADY STATE DYNAMICS step, as in the first post, it segfaults in the same place.
Minimal deck
md_shell.inp:
** S4 strip 0.5 x 0.1 x 0.01 clamped at x = 0 (nodes 1 and 2, DOFs 1-6).
** *FREQUENCY with a zero point load at node 11 (manual 6.9.5), then *MODAL DYNAMIC
*NODE
1,0,0,0
2,0,0.1,0
3,0.1,0,0
4,0.1,0.1,0
5,0.2,0,0
6,0.2,0.1,0
7,0.3,0,0
8,0.3,0.1,0
9,0.4,0,0
10,0.4,0.1,0
11,0.5,0,0
12,0.5,0.1,0
*ELEMENT,TYPE=S4,ELSET=P
1,1,3,4,2
2,3,5,6,4
3,5,7,8,6
4,7,9,10,8
5,9,11,12,10
*MATERIAL,NAME=M
*ELASTIC
2e5,0.3
*DENSITY
1e-3
*SHELL SECTION,ELSET=P,MATERIAL=M
0.01
*NSET,NSET=OUT
11
*BOUNDARY
1,1,6
2,1,6
*STEP
*FREQUENCY,STORAGE=YES
4
*CLOAD
11,3,0.
*NODE PRINT,NSET=OUT
U
*END STEP
*STEP
*MODAL DYNAMIC
0.001,0.01
*CLOAD
11,3,1.
*NODE PRINT,NSET=OUT
U
*END STEP
Run it with OMP_NUM_THREADS=1 ccx md_shell; echo $?
Expected
The *MODAL DYNAMIC step runs, as it does for the same strip without rotational SPCs: with the clamp replaced by translational SPCs on nodes 1-4 (1,1,3 / 2,1,3 / 3,1,3 / 4,1,3), ccx prints uz(11) = 18.631 at t = 0.01, and superposing the 4 mass-normalised modes it printed in the *FREQUENCY step (129.6458, 899.933, 1396.897, 1502.569 Hz) for a unit step load gives 18.631.
The clamped model itself runs in *STEADY STATE DYNAMICS (10.,100.,2 instead of the *MODAL DYNAMIC lines): exit 0, uz(11) = 23.81 at 10 Hz.
Actual
The *FREQUENCY step finishes (4 modes), then ccx is killed by a segmentation fault (exit status 139). Backtrace (lldb):
stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: ccx`nonlinmpc_ + 4028
frame #1: ccx`dyna + 28228
frame #2: ccx`main + 36892
The same exit 139 with:
- no
*CLOAD in the *MODAL DYNAMIC step,
- one rotational SPC only: translations of nodes 1-4 held and
1,4,4,
- a B31 cantilever (3 elements) clamped with
1,1,6;
- no rotational SPC at all (translations of nodes 1-4 held) but a moment
11,4,1. in the *MODAL DYNAMIC step, with 11,4,0. in the *FREQUENCY step: ccx also makes a MEANROTBS MPC for a moment (gen3dforc.f:684).
Where it goes wrong
dyna.c declares the work arrays of nonlinmpc and never allocates them (lines 111 and 137-139):
*aub=NULL,*temp_array1=NULL,*temp_array2=NULL,*aux=NULL,
...
/* dummy variables for nonlinmpc */
ITG *iaux=NULL,maxlenmpc,icascade=0,newstep=0,iit=-1,idiscon;
Any MPC whose label is not blank, CYCLIC or SUBCYCLIC sets inonlinmpc=1 (dyna.c:730-738), and dyna.c:1723-1729 (and 1894-1900) then call
FORTRAN(nonlinmpc,(co,vold,ipompc,nodempc,coefmpc,labmpc,
nmpc,ikboun,ilboun,nboun,xbounact,aux,iaux,
&maxlenmpc,...
A rotational SPC on a shell or beam node that is not a knot becomes an MPC labelled MEANROTBS (gen3dboun.f:687, 820, 903). nonlinmpc.f:823-842 handles it in the general branch, which first copies the MPC’s terms into the work arrays:
iaux(i)=nodempc(2,index)
iaux(maxlenmpc+i)=node
aux(6*maxlenmpc+i)=coefmpc(index)
iaux is NULL and maxlenmpc is not set: the write to address 0 is the segfault. nonlingeo.c:437-438 allocates both arrays (NNEW(aux,double,7*maxlenmpc); NNEW(iaux,ITG,2*maxlenmpc);, with maxlenmpc=mpcinfo[3]). steadystate.c does not call nonlinmpc, which is why *STEADY STATE DYNAMICS runs. Knots (label KNOT) and *RIGID BODY MPCs go through other branches of nonlinmpc that do not use aux, which is why a node that is a knot does not crash.
Possible fix
Allocate the work arrays in dyna.c before the time loop, as nonlingeo.c does, and free them at the end, e.g.
if(inonlinmpc==1){
maxlenmpc=0;
for(i=0;i<*nmpc;i++){
ITG index=ipompc[i],len=0;
while(index!=0){len++;index=nodempc[3*index-1];}
if(len>maxlenmpc) maxlenmpc=len;
}
NNEW(aux,double,7*maxlenmpc);
NNEW(iaux,ITG,2*maxlenmpc);
}
...
SFREE(aux);SFREE(iaux);
Workaround: *STEADY STATE DYNAMICS, or make the node a knot. With a short B31 element (zero density) attached to nodes 1 and 2 of the deck above, ccx creates knots there, the *MODAL DYNAMIC step runs, and uz(11) = 1.7180 at t = 0.01 equals the superposition of the 4 modes it printed.