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

corrupted double-linked list

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

Like Tree6Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 28, 2018, 08:17
Default
  #21
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,145
Rep Power: 46
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by calf.Z View Post
I have encountered the same questions.

*** Error in `coolrhoSimpleFoam': double free or corruption (!prev): 0x0000000001d2aa60 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f4484bec7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f4484bf537a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f4484bf953c]
/lib/x86_64-linux-gnu/libc.so.6(__cxa_finalize+0x9a)[0x7f4484baf36a]
/home/dyfluid/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libspecie.so(+0x1c1613)[0x7f4489ef1613]


Can anyone help me with this problem?

Thank you very mach.

That is probably the same memory being freed twice and as it seems to be a self-written solver your best bet is to compile it in Debug-mode and run it in a debugger


Just two pieces of advice:
- if you use delete in OpenFOAM-code you're probably doing something wrong
- never use a "naked" pointer but wrap it in a autoPtr and use references to it
- make sure that any references you pass around are not used after the autoPtr left scope


That is three. But the second one is a mix between the other two
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   December 17, 2018, 02:46
Default
  #22
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 4
calf.Z is on a distinguished road
Quote:
Originally Posted by gschaider View Post
That is probably the same memory being freed twice and as it seems to be a self-written solver your best bet is to compile it in Debug-mode and run it in a debugger


Just two pieces of advice:
- if you use delete in OpenFOAM-code you're probably doing something wrong
- never use a "naked" pointer but wrap it in a autoPtr and use references to it
- make sure that any references you pass around are not used after the autoPtr left scope


That is three. But the second one is a mix between the other two

Thank you for your reply!

I compile two new libraries (userspecie and TabularThermophysicalModels) without errors, and then I compiled the official solver(rhoSimpleFoam) with the new libraries without errors. I didn't modify any code about this solver and I just linked the libraries and renamed it to coolrhoSimpleFoam.

When I use the new solver for running case,there are some errors:
*** Error in `coolrhoSimpleFoam':double free or corruption (!prev): 0x000000000193b250 ***
......

In my make/options:

...
I$(WM_PROJECT_USER_DIR)/thermophysicalModels/basic/lnInclude \
I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
...

EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) -luserspecie \
-L$(FOAM_USER_LIBBIN) -lTabularThermophysicalModels \
...

I think I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ should be removed, but when I tried it, it's said that ***.H chould not be found. When I added it, it compiled successfully.

I have no idea about double free or corruption (!prev). I am wondering if you can help me with this problem.

That's very appreciated of you.

Regards,
Calf.Z
calf.Z is offline   Reply With Quote

Old   December 17, 2018, 02:55
Default
  #23
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 229
Rep Power: 12
gaza is on a distinguished road
Quote:
Originally Posted by calf.Z View Post
Thank you for your reply!

I compile two new libraries (userspecie and TabularThermophysicalModels) without errors, and then I compiled the official solver(rhoSimpleFoam) with the new libraries without errors. I didn't modify any code about this solver and I just linked the libraries and renamed it to coolrhoSimpleFoam.

When I use the new solver for running case,there are some errors:
*** Error in `coolrhoSimpleFoam':double free or corruption (!prev): 0x000000000193b250 ***
......

In my make/options:

...
I$(WM_PROJECT_USER_DIR)/thermophysicalModels/basic/lnInclude \
I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
...

EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) -luserspecie \
-L$(FOAM_USER_LIBBIN) -lTabularThermophysicalModels \
...

I think I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ should be removed, but when I tried it, it's said that ***.H chould not be found. When I added it, it compiled successfully.

I have no idea about double free or corruption (!prev). I am wondering if you can help me with this problem.

That's very appreciated of you.

Regards,
Calf.Z

In my case it was connected with tmp object.
Are you using such objects?
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   December 17, 2018, 04:05
Default
  #24
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 4
calf.Z is on a distinguished road
I compiled the library based on the code online and I haven’t researched the code.
And then I just used rhosimpleFoam to link the new library and renamed it to coolrhoSimpleFoam. After finishing running,double free or corruption appeared,
So I have no idea.
calf.Z is offline   Reply With Quote

Old   December 22, 2018, 10:39
Default
  #25
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,956
Blog Entries: 43
Rep Power: 122
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick questions/notes @calf.Z:
  1. At the start of solver run, either before or after the initial header, sometimes OpenFOAM will state which object has been loaded as a duplicate. Since you haven't followed the instructions indicated here: How to give enough info to get help - it's not possible to see what only you can see.
  2. Please indicate from where you got the "TabularThermophysicalModels" source code and which installation instructions you've followed, so that we can try and reproduce the same error. It is likely that they have a duplicate runtime name for one or more of their classes, hence the crash at the end.
__________________
wyldckat is offline   Reply With Quote

Old   December 22, 2018, 21:41
Default
  #26
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 4
calf.Z is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Quick questions/notes @calf.Z:
  1. At the start of solver run, either before or after the initial header, sometimes OpenFOAM will state which object has been loaded as a duplicate. Since you haven't followed the instructions indicated here: How to give enough info to get help - it's not possible to see what only you can see.
  2. Please indicate from where you got the "TabularThermophysicalModels" source code and which installation instructions you've followed, so that we can try and reproduce the same error. It is likely that they have a duplicate runtime name for one or more of their classes, hence the crash at the end.
I am sorry for the mistakes I made and thank you for replying me.

I have uploaded some related files. The two new libraries :libuserspecie.so and libTabularThermophysicalModels.so. were compiled without errors. I use wclean lib then wmake libso

When I linked the libraries with my solver, it also compiled without errors. I
use wclean then wmake. The options:

EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(WM_PROJECT_USER_DIR)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \

EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) -luserspecie \
-L$(FOAM_USER_LIBBIN) -lTabularThermophysicalModels \
-lcompressibleTransportModels \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-lfiniteVolume \
-lsampling \
-lmeshTools \
-lOpenFOAM \
-lfvOptions

After I ran the case, it appears: Error in `coolrhoSimpleFoam': double free or corruption (!prev): 0x000000000168e250 ***

I have no ideas about it. Thank you.
Attached Files
File Type: c tabularThermo.C (5.0 KB, 0 views)
File Type: h tabularThermo.H (4.1 KB, 1 views)
File Type: c tabularThermos.C (2.9 KB, 1 views)
calf.Z is offline   Reply With Quote

Old   December 23, 2018, 16:17
Default
  #27
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,956
Blog Entries: 43
Rep Power: 122
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: I did ask you from where you had gotten the "TabularThermophysicalModels" source code... I went looking and found that you likely used the version from here: https://github.com/Yuusha0/tabulated...es/tree/v2.0.2

I then I tried to use the tutorial case "2FlatPlatesCompressible" that they provide, which didn't run as it was. The fix was simple enough: instead of modifying the solver, all I had to do was add the following block to the end of the file "system/controlDict":
Code:
libs
(
    "libuserspecie.so"
    "libTabularThermophysicalModels.so"
    "libtabularReactionThermophysicalModels.so"
);
This will make the solver load these libraries before it starts to do anything else regarding the case.

Once the solver was finished running, it did not have any error messages.

Therefore, my suggestion is that instead of you trying to compile a custom solver with this source code, instead use this strategy with the existing OpenFOAM solvers.
calf.Z likes this.
wyldckat is offline   Reply With Quote

Old   December 25, 2018, 02:21
Default
  #28
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 4
calf.Z is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Quick answer: I did ask you from where you had gotten the "TabularThermophysicalModels" source code... I went looking and found that you likely used the version from here: https://github.com/Yuusha0/tabulated...es/tree/v2.0.2

I then I tried to use the tutorial case "2FlatPlatesCompressible" that they provide, which didn't run as it was. The fix was simple enough: instead of modifying the solver, all I had to do was add the following block to the end of the file "system/controlDict":
Code:
libs
(
    "libuserspecie.so"
    "libTabularThermophysicalModels.so"
    "libtabularReactionThermophysicalModels.so"
);
This will make the solver load these libraries before it starts to do anything else regarding the case.

Once the solver was finished running, it did not have any error messages.

Therefore, my suggestion is that instead of you trying to compile a custom solver with this source code, instead use this strategy with the existing OpenFOAM solvers.
Thank you, I have resolved the problem by the library presented in the link and the method you suggest.
wyldckat likes this.
calf.Z is offline   Reply With Quote

Reply

Tags
corrupted list

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 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 08:20
Missing math.h header Travis FLUENT 4 January 15, 2009 11:48
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51
what's wrong about my code for 2d burgers equation morxio Main CFD Forum 3 April 27, 2007 10:38
REAL GAS UDF brian FLUENT 6 September 11, 2006 08:23


All times are GMT -4. The time now is 12:08.