|
[Sponsors] |
![]() |
![]() |
#21 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 52 ![]() ![]() |
Quote:
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 |
||
![]() |
![]() |
![]() |
![]() |
#22 | |
Senior Member
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 8 ![]() |
Quote:
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 |
||
![]() |
![]() |
![]() |
![]() |
#23 | |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 ![]() |
Quote:
In my case it was connected with tmp object. Are you using such objects?
__________________
best regards pblasiak |
||
![]() |
![]() |
![]() |
![]() |
#24 |
Senior Member
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 8 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#25 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 129 ![]() ![]() ![]() ![]() ![]() ![]() |
Quick questions/notes @calf.Z:
__________________
|
|
![]() |
![]() |
![]() |
![]() |
#26 | |
Senior Member
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 8 ![]() |
Quote:
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. |
||
![]() |
![]() |
![]() |
![]() |
#27 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 129 ![]() ![]() ![]() ![]() ![]() ![]() |
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" ); 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. |
|
![]() |
![]() |
![]() |
![]() |
#28 | |
Senior Member
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 8 ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
Tags |
corrupted list |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |