To analyze failing ccx runs I set environment variable CCX_LOG_ALLOC=1 to understand in which function the program may crash: This setting reports memory allocation changes to the console output. In our case I am not interested in the amount of memory being allocated, I am only interested in the function name mentioned by the console output.
Then running your example file above with the truss elements the last successful console outputs before the program crash are:
ALLOCATION of variable nal, file results.c, line=199, num=1, size=4, address= 42950005200
ALLOCATION of variable energysms1, file results.c, line=200, num=1, size=8, address= 42950005232
Using up to 1 cpu(s) for the stress calculation.
ALLOCATION of variable ithread, file results.c, line=232, num=1, size=4, address= 42950005264
FREEING of variable fn1, file results.c, line=248: oldaddress= 42949969168
FREEING of variable ithread, file results.c, line=248: oldaddress= 42950005264
FREEING of variable neapar, file results.c, line=248: oldaddress= 42949982384
FREEING of variable nebpar, file results.c, line=248: oldaddress= 42949982304
FREEING of variable qa1, file results.c, line=287: oldaddress= 42949911136
FREEING of variable nal, file results.c, line=298: oldaddress= 42950005200
FREEING of variable energysms1, file results.c, line=308: oldaddress= 42950005232
ALLOCATION of variable nkapar, file forparll.c, line=44, num=1, size=4, address= 42949911136
ALLOCATION of variable nkbpar, file forparll.c, line=45, num=1, size=4, address= 42949982304
ALLOCATION of variable ithread, file forparll.c, line=66, num=1, size=4, address= 42949982384
FREEING of variable ithread, file forparll.c, line=74: oldaddress= 42949982384
FREEING of variable nkapar, file forparll.c, line=74: oldaddress= 42949911136
FREEING of variable nkbpar, file forparll.c, line=74: oldaddress= 42949982304
This means that in line 74 of forparll.c the final memory cleanups seem to have worked:
Something seems to happen when function forparll() is being left or after. Once function forparll() is left the program returns back to resultsforc(). As resultsforc() does not contain an SFREE() command there is no console output to verify if the code crashes in function resultsforc(). So the crash may have alternatively occured in a function which called resultsforc().