*CONTACT PRINT CF / CFN / CFS segfaults in a *BUCKLE or *STEADY STATE DYNAMICS step (face-to-face pair, elastic material; own or carried request)

Summary

Section 7.23 (*CONTACT PRINT) of the 2.23 manual: “The quantities CF, CFN and CFS represent the total force, total normal force and total shear force acting on the slave surface, respectively, for a selected face-to-face penalty contact pair.” It also says: “If no *CONTACT PRINT card is used within a step the selections of the previous step apply”.

With a face-to-face penalty pair and an elastic material, a CF, CFN or CFS request crashes ccx with a segmentation fault (exit status 139, no message) in

  • a *BUCKLE step, whether the request is the step’s own or carried over from a preceding *STATIC step, and
  • a *STEADY STATE DYNAMICS step.

The same decks without the request run. A *FREQUENCY step and a *MODAL DYNAMIC step with the same request also segfault on ccx 2.23. On master they run and print a CFN table of zeros (and NaN wherever printoutcontact.f divides by the contact area, which is 0), so only *BUCKLE and *STEADY STATE DYNAMICS are left.

Version

ccx 2.23 (macOS arm64) and current master (537aa81, 2 Nov 2026).

Already reported or fixed?

Not reported for these procedures: I found no matching GitHub issue or pull request in Dhondtguido/CalculiX and no calculix.discourse.group topic title (searched 3 Nov 2026).

Related:

Minimal input

cfn_buckle.inp:

** Two unit cubes stacked at z = 1 with a face-to-face contact pair.
** Lower cube held at its bottom, upper cube held in x and y at its top.
** One *BUCKLE step with a *CONTACT PRINT CFN request for the pair.
*NODE, NSET=NALL
1, 0., 0., 0.
2, 1., 0., 0.
3, 1., 1., 0.
4, 0., 1., 0.
5, 0., 0., 1.
6, 1., 0., 1.
7, 1., 1., 1.
8, 0., 1., 1.
9, 0., 0., 1.
10, 1., 0., 1.
11, 1., 1., 1.
12, 0., 1., 1.
13, 0., 0., 2.
14, 1., 0., 2.
15, 1., 1., 2.
16, 0., 1., 2.
*ELEMENT, TYPE=C3D8, ELSET=LOW
1, 1, 2, 3, 4, 5, 6, 7, 8
*ELEMENT, TYPE=C3D8, ELSET=UP
2, 9, 10, 11, 12, 13, 14, 15, 16
*NSET, NSET=BOT
1, 2, 3, 4
*NSET, NSET=TOP
13, 14, 15, 16
*MATERIAL, NAME=M
*ELASTIC
1000., 0.3
*DENSITY
1.
*SOLID SECTION, ELSET=LOW, MATERIAL=M
*SOLID SECTION, ELSET=UP, MATERIAL=M
*SURFACE, NAME=LTOP
LOW, S2
*SURFACE, NAME=UBOT
UP, S1
*SURFACE INTERACTION, NAME=SI
*SURFACE BEHAVIOR, PRESSURE-OVERCLOSURE=LINEAR
1.E5
*CONTACT PAIR, INTERACTION=SI, TYPE=SURFACE TO SURFACE
UBOT, LTOP
*BOUNDARY
BOT, 1, 3
TOP, 1, 2
*STEP
*BUCKLE
2
*CLOAD
13, 1, 1.
*CONTACT PRINT, SLAVE=UBOT, MASTER=LTOP
CFN
*END STEP

cfn_ssd.inp: the same model (everything above the first *STEP), followed by

*STEP
*FREQUENCY, STORAGE=YES
4
*END STEP
*STEP
*STEADY STATE DYNAMICS
0.1, 1., 3
*CLOAD
13, 1, 0.
*CONTACT PRINT, SLAVE=UBOT, MASTER=LTOP
CFN
*END STEP

How to run

ccx cfn_buckle
ccx cfn_ssd

Expected

The run goes on: the buckling factors and the frequency response, and either an empty CFN table (these procedures generate no contact elements; master prints zeros in a *FREQUENCY step) or a warning that the request does not apply, as 5e7153d gives for a node-to-surface pair.

Actual

deck 2.23 master
cfn_buckle.inp segfault segfault
the same, CF or CFS instead of CFN segfault segfault
the same, request moved into a preceding *STATIC step (top pushed 0.001) and carried into the *BUCKLE step segfault segfault
cfn_buckle.inp without the *CONTACT PRINT request runs (factors 0.9878253, 1.013035) runs (same)
cfn_ssd.inp segfault segfault
cfn_ssd.inp without the request runs runs
*FREQUENCY, STORAGE=YES with the request (first step) segfault runs, CFN table of zeros (and NaN) per mode
*FREQUENCY then *MODAL DYNAMIC with the request segfault runs, CFN table of zeros (and NaN)

No message before the crash. For cfn_buckle.inp the output holds only the banner (the rest of the buffered output is lost) and the .dat file stays empty; for cfn_ssd.inp it ends with “Using up to 1 cpu(s) for the stress calculation.”

Where it goes wrong

src/printoutcontact.f (master lines 72-73), for every CF / CFN / CFS request:

            read(prset(ii)(1:10),'(i10)') itie
            istart=itiefac(1,itie)

arpackbu.c (line 89) and steadystate.c (line 99) declare *itiefac=NULL and never set up contact, so they pass a null itiefac (and null pslavsurf, pmastsurf, springarea) through results() and resultsprint() into printoutcontact(). These procedures generate no contact elements (ne0=*ne), so the loop over the contact elements that follows would not run anyway; the crash is the read of itiefac before it.

With if(ne.eq.ne0) cycle inserted after line 72 (no contact elements: nothing to sum), all the crashing decks above run to “Job finished” on master.

Fix

In printoutcontact.f, skip a CF / CFN / CFS request (or print zeros, as *FREQUENCY does on master) when the step has no contact elements, before itiefac is read. Alternatively, drop the request with a warning in procedures without contact, as 5e7153d does for node-to-surface pairs.

Confirmed using official ccx 2.23 build on Windows, needs a GitHub ticket.

The analysis (cfn_buckle) indeed crashes.

1 Like

Posted: *CONTACT PRINT CF / CFN / CFS segfaults in a *BUCKLE or *STEADY STATE DYNAMICS step (face-to-face pair, elastic material; own or carried request) · Issue #323 · Dhondtguido/CalculiX · GitHub

1 Like