------- Comment #4 from jv244 at cam dot ac dot uk 2009-06-03 16:31 ------- OK, a good hint from valgrind. The following error is present if I use 4.4.1 but not if I link against the runtime from 4.4.0: ==30712== Invalid read of size 1 ==30712== at 0x4A22DF9: strncmp (mc_replace_strmem.c:314) ==30712== by 0x4BD83AF: _gfortrani_parse_format (format.c:188) ==30712== by 0x4BE4B4F: data_transfer_init (transfer.c:2106) ==30712== by 0x63CFE9: __input_section_types_MOD_section_vals_write (input_section_types.F:2042) ==30712== by 0x63ED60: __input_section_types_MOD_section_vals_write (input_section_types.F:2087) ==30712== by 0x5FB9A3: __input_cp2k_restarts_MOD_write_restart (input_cp2k_restarts.F:175) ==30712== by 0x764CA9: __md_util_MOD_md_output (md_util.F:61) ==30712== by 0x764863: __md_run_MOD_qs_mol_dyn_low (md_run.F:461) ==30712== by 0x764AFE: __md_run_MOD_qs_mol_dyn (md_run.F:142) ==30712== by 0x40E5A6: __cp2k_runs_MOD_cp2k_run (cp2k_runs.F:329) ==30712== by 0x404F37: __cp2k_runs_MOD_run_input (cp2k_runs.F:1095) ==30712== by 0x403F62: MAIN__ (cp2k.F:272) ==30712== Address 0x62b2ed0 is 0 bytes inside a block of size 640 free'd ==30712== at 0x4A2196E: free (vg_replace_malloc.c:323) ==30712== by 0x63D11F: __input_section_types_MOD_section_vals_write (input_section_types.F:2042) ==30712== by 0x63ED60: __input_section_types_MOD_section_vals_write (input_section_types.F:2087) ==30712== by 0x5FB9A3: __input_cp2k_restarts_MOD_write_restart (input_cp2k_restarts.F:175) ==30712== by 0x764CA9: __md_util_MOD_md_output (md_util.F:61) ==30712== by 0x764863: __md_run_MOD_qs_mol_dyn_low (md_run.F:461) ==30712== by 0x764AFE: __md_run_MOD_qs_mol_dyn (md_run.F:142) ==30712== by 0x40E5A6: __cp2k_runs_MOD_cp2k_run (cp2k_runs.F:329) ==30712== by 0x404F37: __cp2k_runs_MOD_run_input (cp2k_runs.F:1095) ==30712== by 0x403F62: MAIN__ (cp2k.F:272) ==30712== by 0x2D7E079: main (fmain.c:21)
the code at input_section_types.F:2042 looks like: WRITE(unit=unit_nr,fmt="("//TRIM(myfmt)//",a,' ')",advance="NO")& TRIM(keyword%names(1)) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40330