View Issue Details

IDProjectCategoryView StatusLast Update
0003716OpenFOAMBugpublic2021-08-25 11:56
ReportertniemiAssigned Towill 
PrioritylowSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Product Versiondev 
Fixed in Versiondev 
Summary0003716: Segmentation fault instead of proper IO ERROR
DescriptionI noticed that in recent dev versions I'm getting segmentation faults from places which normally should produce meaningful error messages. I managed to pinpoint the issue to this commit https://github.com/OpenFOAM/OpenFOAM-dev/commit/4398f57c5e88f21b78d5d7edf66f733a8d13ad8f

Steps To ReproduceFor example, if I take tutorials/combustion/reactingFoam/Lagrangian/verticalChannel and change "operation average;" to "operation averaged;", in OF9 I get

--> FOAM FATAL IO ERROR:
averaged is not in enumeration:
16
(
CoV
areaAverage
areaIntegrate
areaNormalAverage
areaNormalIntegrate
average
max
maxMag
min
minMag
none
orientedSum
sum
sumDirection
sumDirectionBalance
sumMag
)

However, currently in dev I only get

--> FOAM FATAL IO ERROR:
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigSegv::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 ? in "/lib/x86_64-linux-gnu/libc.so.6"
Segmentation fault (core dumped)

or

--> FOAM FATAL IO ERROR:
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigSegv::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::error::message() const at ??:?
#4 Foam::operator<<(Foam::Ostream&, Foam::IOerror const&) at ??:?
#5 ? at functionObjectList.C:?
#6 Foam::functionObjectList::timeToNextWrite() at ??:?
#7 Foam::Time::adjustDeltaT() at ??:?
#8 ? in "/opt/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/bin/reactingFoam"
#9 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#10 ? in "/opt/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/bin/reactingFoam"
Segmentation fault (core dumped)
TagsNo tags attached.

Activities

tniemi

2021-08-24 17:24

reporter   ~0012161

"operation average;" refers to surfaceFieldValue in controlDict

tniemi

2021-08-25 06:19

reporter   ~0012162

Restoring the removed "error(const error&)" copy constructor seems to help with the issue.

will

2021-08-25 11:56

manager   ~0012164

Yes, the pointer handling of the error class' string-stream got messed up. I don't see any reason for the string-stream being a pointer, so I've now made it an actual object. Even simpler. No copy constructors, no destructors.

https://github.com/OpenFOAM/OpenFOAM-dev/commit/32cfad7002c2b677114adadff76fdcf295533f80

Issue History

Date Modified Username Field Change
2021-08-24 16:59 tniemi New Issue
2021-08-24 17:24 tniemi Note Added: 0012161
2021-08-25 06:19 tniemi Note Added: 0012162
2021-08-25 11:56 will Assigned To => will
2021-08-25 11:56 will Status new => resolved
2021-08-25 11:56 will Resolution open => fixed
2021-08-25 11:56 will Fixed in Version => dev
2021-08-25 11:56 will Note Added: 0012164