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

double free or corruption (!prev) in a solver not apparently using malloc or similar.

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By iblu
  • 1 Post By mturcios777
  • 1 Post By iblu

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 3, 2014, 04:56
Default double free or corruption (!prev) in a solver not apparently using malloc or similar.
  #1
New Member
 
i.schiavi
Join Date: Jan 2014
Posts: 11
Rep Power: 12
iblu is on a distinguished road
Hi, i'm running a OF solver developed by a subcontractor and can't get t to work more than a single timestep. At that point the solver exits and gives a double free or corruption (!prev). Compiled it with "make" without errors. Tried to compile it with GCC but it would not be able to find the .H files listed after each #include directive listed, so given up as I am not sure why it would not find them. Used valgrind and obtained an error file I am not really able to understand (i'm new to CFD and my C is a vague memory from my first year at uni oh so many years ago). I attach the program code (thermalblabla) and valgrind output (both as txt).
Would love to understand how can I track down the error, so would appreciate some help. May I say I had not had this problems with seemingly the same code before having to reinstall it all, but other colleagues had it. I don't think I had a different code. Maybe I compiled it wrong?
thanks. If i have not put enough info, pls let me know
i.
Attached Files
File Type: txt valgrind.txt (70.8 KB, 18 views)
File Type: txt thermalMhdSimpleRhoFoam.txt (3.5 KB, 14 views)
Kummi likes this.
iblu is offline   Reply With Quote

Old   February 3, 2014, 14:11
Default
  #2
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
With compilation, do you mean make or wmake?
mturcios777 is offline   Reply With Quote

Old   February 3, 2014, 16:44
Default
  #3
New Member
 
i.schiavi
Join Date: Jan 2014
Posts: 11
Rep Power: 12
iblu is on a distinguished road
ah, good question. I might have used make - sorry I'm home now and working on another computer and the wrong partition so can't check just yet . just read something on OpenFoam on wmake but I don't know enough to understand the difference with make. I know in the thermoblabla folder I have a .dep file, i have the Make directory with the option and files files. Might try a fresh recompile and report back in the morning. thanks
iblu is offline   Reply With Quote

Old   February 3, 2014, 17:53
Default
  #4
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
You should read up on compiling for OpenFOAM:

http://www.openfoam.org/docs/user/co...plications.php
Kummi likes this.
mturcios777 is offline   Reply With Quote

Old   February 4, 2014, 05:03
Default
  #5
New Member
 
i.schiavi
Join Date: Jan 2014
Posts: 11
Rep Power: 12
iblu is on a distinguished road
still the same problem after recompiling with wmake.
I've dug out the old skype conversation with the subcontractor but can't find no clues, except perhaps silly thing, my platforms are called linuxGccDPOpt, his were called linux64GccDPOpt I thought that 64 referred to the mysterious 64 bits of his whatever built of whatever. can't be that can it... during wmake I can see it links to my platforms nicely

Thanks, will read up on compiling!
iblu is offline   Reply With Quote

Old   February 4, 2014, 05:10
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

What if the problem is not in this "double free" but in your case files? Can you post the error which solver produces after one time step?
alexeym is offline   Reply With Quote

Old   February 4, 2014, 05:23
Default
  #7
New Member
 
i.schiavi
Join Date: Jan 2014
Posts: 11
Rep Power: 12
iblu is on a distinguished road
hello
I have a solver err log file which remains blank (although I have to look up how to tell the program to write on it, as it's always been blank). The solver file simply puts "end" at the end of the time step (have attached it in any case)
Have also attached the error generated on terminal
thanks
Attached Files
File Type: txt solver log.txt (3.2 KB, 23 views)
File Type: txt error to terminal.txt (5.7 KB, 23 views)
Kummi likes this.
iblu is offline   Reply With Quote

Old   February 4, 2014, 05:34
Default
  #8
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well,

Now I'd like to look at your controlDict as it seems that your endTime is 1, also lines in 'error to terminal-1.txt' with

Code:
/opt/openfoam211/platforms/linuxGccDPOpt/lib/libsampling.so
made me think that you a doing sampling with functionObjects and this can actually lead to the error.
alexeym is offline   Reply With Quote

Old   February 4, 2014, 05:40
Default
  #9
New Member
 
i.schiavi
Join Date: Jan 2014
Posts: 11
Rep Power: 12
iblu is on a distinguished road
here the controlDict
sorry i don't understand, what else should i provide you with?
Attached Files
File Type: txt controlDict.txt (2.3 KB, 20 views)
iblu is offline   Reply With Quote

Old   February 4, 2014, 05:48
Default
  #10
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well

1. Only one time step is actually done due to

Code:
stopAt          writeNow;
change it to

Code:
stopAt          endTime;
2. And

Code:
libs (
      "libOpenFOAM.so"  // OpenFOAM will (probably) crash if this library is not specified
      "libsimpleSwakFunctionObjects.so"
      "libmyBCs.so"
      "libswakFunctionObjects.so"
      "libgroovyBC.so"
     );
tells that you're actually using swakFunctionObjects where 'double free' occurs. I can't suggest anything about it as I don't know why do you need this libraries.
alexeym is offline   Reply With Quote

Old   February 4, 2014, 07:49
Default
  #11
New Member
 
i.schiavi
Join Date: Jan 2014
Posts: 11
Rep Power: 12
iblu is on a distinguished road
well indeed... how silly of me not checking that detail about the endtime proper beginner!!!!
I must admit even when it worked it did end up giving that glibc error, but at least it was at the end of the simulation. so i have to get back to the developer about the libraries as I do not know the consequences in the long term (or on the results)
iblu is offline   Reply With Quote

Old   February 4, 2014, 10:00
Default
  #12
New Member
 
i.schiavi
Join Date: Jan 2014
Posts: 11
Rep Power: 12
iblu is on a distinguished road
the simulation goes to step 2 but then it stays there, and I have a solver err log that i do not like a single bit...
Attached Files
File Type: txt solver_err .txt (1.7 KB, 18 views)
iblu is offline   Reply With Quote

Old   February 4, 2014, 10:19
Default
  #13
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Step 2 is a time step after first time step or second run or the solver (according to comments in controlDict you need to restart solver after first 50 steps with modified relaxation factors)?

As you've posted only stack trace I don't know what field causes the error. Usually you can start by changing GAMG solver to PCG (or PBiCG, it depends). Also you can try to change discretisation schemes (go with first order). Play with relaxation factors. To suggest anything I need to have a look at your fvSchemes and fvSolution.
alexeym is offline   Reply With Quote

Old   February 4, 2014, 10:43
Default
  #14
New Member
 
i.schiavi
Join Date: Jan 2014
Posts: 11
Rep Power: 12
iblu is on a distinguished road
thanks and sorry for giving you only bits at a time unknowingly
control dict should be set so the simulation runs for 50 time steps, so 2 is the second time step
I ma following the direction of the subcontractor with relaxation factors and stuff, so here is the solver log and the other files...
Attached Files
File Type: txt solver .txt (3.7 KB, 5 views)
File Type: txt fvScheme.txt (3.6 KB, 7 views)
File Type: txt fvSolution.txt (3.6 KB, 6 views)
iblu is offline   Reply With Quote

Old   February 4, 2014, 11:00
Default
  #15
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
It seems that you've got problem solving velocity equation.

Comments in the fvSolution (relaxationFactors section) state that relaxation factor for U equation should be 0.2 up to time step 150 (while in the file you've attached relaxation factor for U is commented out). Uncomment line with relaxation factor for U equation.

Also attached fvScheme (while it should be fvSchemes) and fvSolution are actually the same file.
alexeym is offline   Reply With Quote

Old   February 4, 2014, 11:28
Default
  #16
New Member
 
i.schiavi
Join Date: Jan 2014
Posts: 11
Rep Power: 12
iblu is on a distinguished road
that what happens when you do too many things at once sorry

uncommented, relaunched.
Attached Files
File Type: txt fvScheme.txt (2.2 KB, 12 views)
iblu is offline   Reply With Quote

Old   February 5, 2014, 04:04
Thumbs up
  #17
New Member
 
i.schiavi
Join Date: Jan 2014
Posts: 11
Rep Power: 12
iblu is on a distinguished road
thanks for all your help Alexej
my chugging computer completed the simulation successfully. There are still problems of memory allocation at the end of the run, which I need to raise with the subcontractor, but hopefully I get to arrive to some results.
best regards
I.
iblu is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
New densitybased solver AeroFoam giulio_romanelli OpenFOAM Running, Solving & CFD 48 January 15, 2016 09:20
Steady state chemistry linnemann OpenFOAM Running, Solving & CFD 14 April 7, 2015 14:10
Working directory via command line Luiz CFX 4 March 6, 2011 21:02
Parallel rasInterFoam openfoam_user OpenFOAM Running, Solving & CFD 4 November 1, 2008 05:14
REAL GAS UDF brian FLUENT 6 September 11, 2006 09:23


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