Describe the bug
stf is crashing with a seg fault when running with the sample_galaxycatalog_run configuration with Particle_search_type=1. The seg fault is being thrown in ramsesio.cxx line 43 because the read buffer is the incorrect size (is dummy, should be sizeof(dummy)).
To Reproduce
Steps to reproduce the behavior:
Set Particle_search_type=1 in sample_galaxycatalog_run.cfg
Run stf
Observe seg fault while loading input data
Expected behavior
Input data should load without seg faulting.
Log files
Valgrind stacktrace:
==22366== Invalid write of size 8
==22366== at 0x4C326CB: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22366== by 0x5FFBBDF: std::basic_filebuf<char, std::char_traits<char> >::xsgetn(char*, long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==22366== by 0x60088EA: std::istream::read(char*, long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==22366== by 0x583BD9: RAMSES_fortran_read(std::basic_fstream<char, std::char_traits<char> >&, int*) (ramsesio.cxx:43)
Additional context
I'm about to submit a PR for the fix.
Describe the bug stf is crashing with a seg fault when running with the sample_galaxycatalog_run configuration with Particle_search_type=1. The seg fault is being thrown in ramsesio.cxx line 43 because the read buffer is the incorrect size (is
dummy
, should besizeof(dummy)
).To Reproduce Steps to reproduce the behavior:
Expected behavior Input data should load without seg faulting.
Log files Valgrind stacktrace:
Additional context I'm about to submit a PR for the fix.