Crash while writing closed XMF file using serial_io.
Using GCC and running a simple MPI test we crash in:
#0 __mempcpy_sse2 () at ../sysdeps/x86_64/memcpy.S:72
#1 0x00002b147ac66250 in _IO_new_file_xsputn (f=0x20b4730, data=0x4609c8, n=17) at fileops.c:1307
#2 0x00002b147ac35ced in _IO_vfprintf_internal (s=0x20b4730, format=0x4609c8 "<Attribute Name=\"%s\" AttributeType=\"%s\" Center=\"Node\">\n", ap=ap@entry=0x7ffe5327cec8) at vfprintf.c:1323
#3 0x00002b147ac40b97 in __fprintf (stream=<optimised out>, format=<optimised out>) at fprintf.c:32
#4 0x00000000004524c4 in writeXMFline (xmfFile=0x20b4730, fileName=0x7ffe5327d370 "output_000.hdf5", name=0x45f070 "Velocities", N=1024128, dim=3, type=FLOAT) at common_io.c:460
#5 0x000000000044820e in prepareArray (grp=33554432, fileName=0x7ffe5327d370 "output_000.hdf5", xmfFile=0x20b4730, name=0x45f070 "Velocities", type=FLOAT, N_total=1024128, dim=3, us=0x7ffe5327d510, convFactor=UNIT_CONV_SPEED) at serial_io.c:212
#6 0x00000000004483e6 in writeArrayBackEnd (grp=33554432, fileName=0x7ffe5327d370 "output_000.hdf5", xmfFile=0x20b4730, name=0x45f070 "Velocities", type=FLOAT, N=1024128, dim=3, N_total=1024128, mpi_rank=0, offset=0, part_c=0x2b147b7db058 "", us=0x7ffe5327d510, convFactor=UNIT_CONV_SPEED) at serial_io.c:263
#7 0x0000000000449a8e in hydro_write_particles (us=0x7ffe5327d510, parts=0x2b147b7db040, offset=0, mpi_rank=0, N_total=1024128, N=1024128, xmfFile=0x20b4730, fileName=0x7ffe5327d370 "output_000.hdf5", h_grp=33554432) at ./hydro/Gadget2/hydro_io.h:76
#8 write_output_serial (e=0x7ffe5327d680, us=0x7ffe5327d510, mpi_rank=0, mpi_size=1, comm=1140850688, info=469762048) at serial_io.c:644
#9 0x000000000040442d in main (argc=15, argv=0x7ffe5327da48) at main.c:423
Checking it seems that the xmfFile being written to is closed.
This happens in writeXMFfooter()
which is followed by a call
to hydro_write_particles()
for the 0 rank, when the xmfFile
handle is access once more.