CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Customized code based on DieselEngineFoamSolver, always getting segmentation fault

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 3, 2009, 05:26
Default Customized code based on DieselEngineFoamSolver, always getting segmentation fault
  #1
Member
 
Join Date: Jun 2009
Posts: 36
Rep Power: 10
dipling is on a distinguished road
Hello,

i am still working/searching for a good solution for MeshMoving. I figured out that the Cut/adding-cell algorithm can be find in the LayerAR.C (with its baseclasses).
For testing I took the DieselEngineFoamSolver with "EngineTopoChangerMesh.H" (instead of EngineMesh.H) and "CreateEngineDynmiacMesh.H" (instead of CreateEngineMesh.H).

For the first loops (crank angle -180 - (-170.5)) all is done fine. But then the solver gives the following message when the crank angle exactly reaching -170:

Code:
deformSwitch 20
INFO 0
PistonDeformation0
Piston layering mode
01
1
MinLayerThickness 0.003
Segmentation fault
Normally there is :
Code:
deformSwitch 20
INFO 0
PistonDeformation0
Piston layering mode
01
1
MinLayerThickness 0.003
2
3
3
....
In the source code at this point: (layerAR.C)

Code:
Info << "1" << endl;
Info << "MinLayerThickness " << minLayerThickness << endl;
autoPtr<mapPolyMesh> topoChangeMap = topoChanger_.changeMesh();
 
Info << "2"
For me it seems to be a memory error ? I am not the C++ pro, just basic solid skills.

I would be very happy anybody can help me! Any have fun to decrypt my Enlish
dipling is offline   Reply With Quote

Old   July 3, 2009, 08:05
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,017
Rep Power: 43
gschaider will become famous soon enoughgschaider will become famous soon enough
I'm afraid the 'easiest' way to find out the exact location of the error is compiling a debug-version and running that (see http://openfoamwiki.net/index.php/HowTo_debugging)

Unless this is a well-known error. Then someone might be able to tell you directly what is wrong
gschaider is offline   Reply With Quote

Old   July 3, 2009, 08:46
Default
  #3
Member
 
Join Date: Jun 2009
Posts: 36
Rep Power: 10
dipling is on a distinguished road
ok, i will repeat it with the debug-mode. let's see...
dipling is offline   Reply With Quote

Old   July 15, 2009, 10:40
Default
  #4
Member
 
Join Date: Jun 2009
Posts: 36
Rep Power: 10
dipling is on a distinguished road
Hello,

i recompiled the openfoam-15-dev now with the linxgccdebug compiler. Now i can compile everything in debug-mode. I made the the same procedure like last time.

Now:

Quote:
index 532 out of range 0 ... 531

From function UList<T>::checkIndex(const label)
in file /home/cfd/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/UListI.H at line 111.

FOAM aborting
I have some Problems to indentifier UList<T>

The void checks if i is < 0 or < size (obv 531 in this case) but i have no idea where he gets:
a) index i
b) size

If anybody knows that, it would be very helpfull.
dipling is offline   Reply With Quote

Old   July 16, 2009, 05:12
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,017
Rep Power: 43
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by dipling View Post
Hello,

i recompiled the openfoam-15-dev now with the linxgccdebug compiler. Now i can compile everything in debug-mode. I made the the same procedure like last time.

Now:



I have some Problems to indentifier UList<T>

The void checks if i is < 0 or < size (obv 531 in this case) but i have no idea where he gets:
a) index i
b) size

If anybody knows that, it would be very helpfull.
That kind of information is what makes the debug-version very popular (but also very slow): it intercepted an access outside of an array that in the optimized version would have resulted in the segmentation fault that you originally experienced. Normally there should also be a stack trace. For the interpretation of that have a look at

http://openfoamwiki.net/index.php/HowTo_debugging

Normally the actual error should be one or two points below the intercepted UList-access. The stack-trace reports reports the filenames and the line-numbers in the debug-version. And that is the information of interest

Bernhard
gschaider is offline   Reply With Quote

Old   July 30, 2009, 09:33
Default
  #6
Member
 
Join Date: Jun 2009
Posts: 36
Rep Power: 10
dipling is on a distinguished road
Hello,

it's me again I teste the "bt" command in gdb after the segmentation fault:

Code:
#0  0xb804d430 in __kernel_vsyscall ()
#1  0xb61b36d0 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb61b5098 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb6648458 in Foam::error::abort (this=0xb69cf620) at lnInclude/error.C:243
#4  0x08087d58 in Foam::operator<< <Foam::error> (os=@0x89be5d8, m={fPtr_ = 0xb664815a <Foam::error::abort()>, err_ = @0xb69cf620})
    at /home/cfd/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/errorManip.H:86
#5  0x08096597 in Foam::UList<double>::checkIndex (this=0x8b3528c, i=1) at /home/cfd/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/UListI.H:111
#6  0x080965c2 in Foam::UList<double>::operator[] (this=0x8b3528c, i=1) at /home/cfd/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/UListI.H:136
#7  0xb73df753 in Foam::volPointInterpolation::interpolateInternalField<Foam::Vector<double> > (this=0xbfb6955c, vf=@0xbfb687d0, pf=@0x8b0c6e8)
    at lnInclude/volPointInterpolate.C:67
#8  0xb73e9caa in Foam::volPointInterpolation::interpolate<Foam::Vector<double> > (this=0xbfb6955c, vf=@0xbfb687d0) at lnInclude/volPointInterpolate.C:184
#9  0xb7404129 in interpolationCellPointFace (this=0x8a507a0, pInterp=@0xbfb6955c, psi=@0xbfb687d0)
    at interpolation/interpolation/interpolationCellPointFace/interpolationCellPointFace.C:53
#10 0xb740425d in Foam::interpolation<Foam::Vector<double> >::adddictionaryConstructorToTable<Foam::interpolationCellPointFace<Foam::Vector<double> > >::New (
    pInterp=@0xbfb6955c, psi=@0xbfb687d0) at lnInclude/interpolation.H:80
#11 0xb6c4db56 in Foam::interpolation<Foam::Vector<double> >::New (interpolationType=@0xbfb674d8, pInterp=@0xbfb6955c, psi=@0xbfb687d0)
    at /home/cfd/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude/newInterpolation.C:58
#12 0xb6c4dbcf in Foam::interpolation<Foam::Vector<double> >::New (interpolationSchemes=@0xbfb67f4c, pInterp=@0xbfb6955c, psi=@0xbfb687d0)
    at /home/cfd/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude/newInterpolation.C:71
#13 0xb6c46b5f in Foam::spray::evolve (this=0xbfb67c58) at spray/sprayOps.C:57
#14 0x080811d6 in main (argc=Cannot access memory at address 0x528c
Can anybody extract some information where he gets i=1 ?The reason why Foam is crashing is listet below..


The orginally error is now:

index 1 out of range 0 ... 0

From function UList<T>::checkIndex(const label)
in file /home/cfd/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/UListI.H at line 111.

FOAM aborting
dipling is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I get rid of segmentation fault sabuj Fluent UDF and Scheme Programming 4 July 3, 2016 05:46
DPM Segmentation Fault in UDF jhlee9622 FLUENT 0 July 1, 2016 03:21
Problems setting up case for running with chtMultiRegionFoam (mesh is from Salome) esujby OpenFOAM Pre-Processing 29 January 31, 2016 14:09
DPM_Heat_MASS, Segmentation fault error herr010 Fluent UDF and Scheme Programming 0 July 22, 2015 04:24
Segmentation Fault caused by a pointer floquation OpenFOAM Programming & Development 1 October 17, 2014 11:43


All times are GMT -4. The time now is 09:54.