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 |
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 |
Quote:
In my case it was connected with tmp object. Are you using such objects? |
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. |
Quick questions/notes @calf.Z:
|
3 Attachment(s)
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. |
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 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. |
Quote:
|
Getting the same error on my own compiled solver!
|
All times are GMT -4. The time now is 01:50. |