https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87359

--- Comment #7 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Well, I can confirm this.  Output from valgrind shows as the first error:

Running test: event_transforms_1| Process library 'event_transforms_1_lib':
initialized
==23957== Invalid read of size 8
==23957==    at 0xB22334:
__mci_midpoint_MOD___final_mci_midpoint_Mci_midpoint_t (mci_midpoint.f90:475)
==23957==    by 0xA57C34: __process_mci_MOD_process_mci_entry_init
(process_mci.f90:187)
==23957==    by 0xA8E78B: __process_MOD_process_setup_mci (process.f90:1150)
==23957==    by 0xB30828: __event_transforms_uti_MOD_event_transforms_1
(event_transforms_uti.f90:85)
==23957==    by 0x422BB9: __unit_tests_MOD_test (unit_tests.f90:175)
==23957==    by 0xB4FF46: __event_transforms_ut_MOD_event_transforms_test
(event_transforms_ut.f90:45)
==23957==    by 0xB51801: whizard_check.3816 (in
/home/ig25/Downloads/Whiz/whizard_test)
==23957==    by 0xB53255: MAIN__ (in /home/ig25/Downloads/Whiz/whizard_test)
==23957==    by 0xB535A9: main (in /home/ig25/Downloads/Whiz/whizard_test)
==23957==  Address 0x61375a0 is 16 bytes inside a block of size 480 free'd
==23957==    at 0x4C2B28A: free (vg_replace_malloc.c:530)
==23957==    by 0xA57C03: __process_mci_MOD_process_mci_entry_init
(process_mci.f90:187)
==23957==    by 0xA8E78B: __process_MOD_process_setup_mci (process.f90:1150)
==23957==    by 0xB30828: __event_transforms_uti_MOD_event_transforms_1
(event_transforms_uti.f90:85)
==23957==    by 0x422BB9: __unit_tests_MOD_test (unit_tests.f90:175)
==23957==    by 0xB4FF46: __event_transforms_ut_MOD_event_transforms_test
(event_transforms_ut.f90:45)
==23957==    by 0xB51801: whizard_check.3816 (in
/home/ig25/Downloads/Whiz/whizard_test)
==23957==    by 0xB53255: MAIN__ (in /home/ig25/Downloads/Whiz/whizard_test)
==23957==    by 0xB535A9: main (in /home/ig25/Downloads/Whiz/whizard_test)
==23957==  Block was alloc'd at
==23957==    at 0x4C2A0DD: malloc (vg_replace_malloc.c:299)
==23957==    by 0xA4539B:
__process_config_MOD_process_component_extract_mci_template
(process_config.f90:834)
==23957==    by 0xA579D2: __process_mci_MOD_process_mci_entry_init
(process_mci.f90:187)
==23957==    by 0xA8E78B: __process_MOD_process_setup_mci (process.f90:1150)
==23957==    by 0xB30828: __event_transforms_uti_MOD_event_transforms_1
(event_transforms_uti.f90:85)
==23957==    by 0x422BB9: __unit_tests_MOD_test (unit_tests.f90:175)
==23957==    by 0xB4FF46: __event_transforms_ut_MOD_event_transforms_test
(event_transforms_ut.f90:45)
==23957==    by 0xB51801: whizard_check.3816 (in
/home/ig25/Downloads/Whiz/whizard_test)
==23957==    by 0xB53255: MAIN__ (in /home/ig25/Downloads/Whiz/whizard_test)
==23957==    by 0xB535A9: main (in /home/ig25/Downloads/Whiz/whizard_test)

So, it is a finalizer problem.  The allocate statement was at

  function process_component_extract_mci_template (component) &
         result (mci_template)
    class(mci_t), allocatable :: mci_template
    class(process_component_t), intent(in) :: component
    if (allocated (component%mci_template)) &
       allocate (mci_template, source = component%mci_template)
  end function process_component_extract_mci_template

Hopefully, this can narrow things down a bit.

Reply via email to