CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   ERROR->Foam::sigSegv::sigHandler(int) (https://www.cfd-online.com/Forums/openfoam-programming-development/153290-error-foam-sigsegv-sighandler-int.html)

cfdopenfoam May 21, 2015 22:04

sigSegv ERROR caused by SLPtrList<>
 
greetings to everyone.

your checking this thread has made me thankful. i now encounter a tough problem, which maybe C++ programming involved.

i develop mySolver in OF-2.3.0 on ubuntu-12.04 and everything seems to be OK. it can run normally and give the expected results. however, problem comes with the last statement of the main function, "return 0". here is all what i get:

Code:

#0  Foam::error::printStack(Foam::Ostream&) in "/home/yk/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigSegv::sigHandler(int) in "/home/yk/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Uninterpreted:
Segmentation fault (core dumped)

i googled the sigSegv error. and i now know it is caused by an application accessing memory outside the allocated space. but how could i address the problem efficiently? why the problem comes with "return 0", the last statement of the main function, rather than something in the time loop? what does the "return 0" actually do? are there some tools or debuggers i could use to fix the problem?

any idea will make my day. thanks for the attention.

best regards,
jhyk

cfdopenfoam May 22, 2015 07:22

some struggling...the problem is addressed but not solved.
it comes from the SLPtrList<> (in src/OpenFOAM/containers/LinkedLists/user/SLPtrList.H), which unfortunately i know nothing about.
when debugging with gdb, i find that a class containing an object of SLPtrList<> could not destruct normally. i think this is the problem makes the program could not return 0.

so, could someone kindly say something about this confusing SLPtrList<>? or where i can learn more about it?
any idea will be greatly appreciated!

wyldckat September 20, 2015 15:21

Greetings,

I guess I'm too late to answer now, but in theory:
  • One possible reason for the problem is possibly related to the OpenFOAM version you're using was built with a set of options and utilities, but then you built the solver with another version.
  • Another possibility is due to incorrect use of a list of type SLPtrList.
Either way, without seeing the source code modifications you made, it's nearly impossible to diagnose the origin problem.


Best regards,
Bruno

charles4allme June 11, 2018 07:49

Hello @cfdopenfoam

Were you able to discover what the problem is?

Best regards


All times are GMT -4. The time now is 01:07.