You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I briefly spoke about this to @gdmiron at the Conference the other week. I am in the process of developing reactive transport models using either GEMS or Reaktoro, and ran into an issue with GEMS a while back:
When I execute my code, everything works as expected, but during the shutdown of the process, i sometimes get a segmentation fault from GEMS, which i believe has to do with the deletion of the TNode pointer. The simplest example i can come up with is a version of the gemcalc example:
#include <ctime>
#include <cmath>
#include <string>
#include <memory>
#include <iostream>
#include <iomanip>
#include <node.h>
#include <spdlog/spdlog.h>
int main()
{
std::shared_ptr<TNode> node( new TNode() );
if( node->GEM_init( "tp_test/H2O-dat.lst" ) )
{
std::cout << "error occured during reading the files" << std::endl;
return 1;
}
// Segmentation Fault/Bad Access occurs only if GEM_run is used, so probably caused somewhere in here?
long NodeStatusCH = node->GEM_run( false );
return 0;
}
I use a super simple chemical system here (just 1 mol H2O, 25°C, 1bar), here are the IO-files: tp_test.zip
Running the above script returns:
[gems3k] [info] Home directory is /Users/jengelmann
[tnode] [info] Initialization of system water G H2O 0 0 1 25 0
[1] 21360 segmentation fault ./gemcalc
about half of the time, the other half it just runs.
Debugging with lldb in vscode results in a EXC_BAD_ACCESS, also about half of the time. This is the call stack:
I can avoid this issue by adding set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") into my CMakeLists.txt, but this fix is not compatible with the transport part of my code.
Can you reproduce the issue? I work on an ARM Mac on the latest trunk branch of GEMS from this repository.
The text was updated successfully, but these errors were encountered:
Hi!
I briefly spoke about this to @gdmiron at the Conference the other week. I am in the process of developing reactive transport models using either GEMS or Reaktoro, and ran into an issue with GEMS a while back:
When I execute my code, everything works as expected, but during the shutdown of the process, i sometimes get a segmentation fault from GEMS, which i believe has to do with the deletion of the TNode pointer. The simplest example i can come up with is a version of the gemcalc example:
I use a super simple chemical system here (just 1 mol H2O, 25°C, 1bar), here are the IO-files: tp_test.zip
Running the above script returns:
about half of the time, the other half it just runs.
Debugging with lldb in vscode results in a EXC_BAD_ACCESS, also about half of the time. This is the call stack:
I can avoid this issue by adding
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
into my CMakeLists.txt, but this fix is not compatible with the transport part of my code.Can you reproduce the issue? I work on an ARM Mac on the latest trunk branch of GEMS from this repository.
The text was updated successfully, but these errors were encountered: