whizard is hosted by Hepforge, IPPP Durham

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#808 closed defect (fixed)

gfortran 7.0.1 throws ICE

Reported by: Juergen Reuter Owned by: kilian
Priority: P0 Milestone: v2.5.0
Component: core Version: 2.4.0
Severity: blocker Keywords:
Cc:

Description

Unfortunately:

libtool: compile:  gfortran -I../basics -I../utilities -I../testing -I../system -I../combinatorics -I../rng -I../physics -I../fastjet -I../qft -I../types -I../particles -I../../circe1/src -I../../circe2/src -I../pdf_builtin -I../lhapdf -I../variables -I../expr_base -I../user -I../parsing -O0 -fbacktrace -fcheck=array-temps,bounds,do,mem,pointer -c sf_ewa_uti.f90  -fno-common -o .libs/sf_ewa_uti.o
sf_isr_uti.f90:537:0:

     allocate (isr_t :: sf_int (2))
 
internal compiler error: in gfc_trans_assignment_1, at fortran/trans-expr.c:9964

sf_isr_uti.f90:537:0: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)
Please submit a full bug report,

Change History (6)

comment:1 Changed 8 years ago by cweiss

The segfault happens after the execution of evaluator_1. There, a check in the last line,

call model%final ()
print *, 'Check finalized

works. The subroutine is called in "test" in "unit_tests.f90", where the subroutine is given as a "procedure(unit_test)" as the first argument. Explicitly,

    print *, 'TEST PROC! '
    call test_proc (u_test)
    print *, 'DONE'

prints out the "Check finalized" statement from above, but not "Done". The problem therefore is either in the interface of procedure(unit_test), or more generalliy with function pointers.

comment:2 Changed 8 years ago by Juergen Reuter

Actually ,there are two issues now, most likely related: the ICE when compiling with -fcheck=mem and 61 failing unit tests as well as _all_ functional tests failing, when compiling without flags. This is the link to the bugzilla report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79230 I'm preparing a much smaller test case for them. Dominique d'Humieres already nailed there problematic commit down to four days in early December when this broke down.

comment:3 Changed 8 years ago by Juergen Reuter

All remaining failures are now understood as of allocate (A, source = B), where A and B are allocatable arrays of derived types with allocatable components, e.g. iso_varying_string. My proposal is (even if that gets fixed in due time) to make the following precautious changes:

--- src/beams/beams.nw    (revision 7806)
+++ src/beams/beams.nw    (working copy)
@@ -655,8 +655,8 @@
   function beam_structure_get_smatrix (beam_structure) result (smatrix)
     class(beam_structure_t), intent(in) :: beam_structure
     type(smatrix_t), dimension(:), allocatable :: smatrix
-    allocate (smatrix (size (beam_structure%smatrix)), &
-         source = beam_structure%smatrix)
+    allocate (smatrix (size (beam_structure%smatrix)))
+    smatrix = beam_structure%smatrix
   end function beam_structure_get_smatrix


--- src/qft/qft.nw    (revision 7806)
+++ src/qft/qft.nw    (working copy)
@@ -366,21 +366,25 @@
     prt%has_anti = prt_src%has_anti
     if (allocated (prt_src%name)) then
        if (allocated (prt%name))  deallocate (prt%name)
-       allocate (prt%name (size (prt_src%name)), source = prt_src%name)
+       allocate (prt%name (size (prt_src%name)))
+       prt%name = prt_src%name
     end if
     if (allocated (prt_src%anti)) then
        if (allocated (prt%anti))  deallocate (prt%anti)
-       allocate (prt%anti (size (prt_src%anti)), source = prt_src%anti)
+       allocate (prt%anti (size (prt_src%anti)))
+       prt%anti = prt_src%anti
     end if
     prt%tex_name = prt_src%tex_name
     prt%tex_anti = prt_src%tex_anti
     if (allocated (prt_src%p_decay)) then
        if (allocated (prt%p_decay))  deallocate (prt%p_decay)
-       allocate (prt%p_decay (size (prt_src%p_decay)), source = prt_src%p_decay)
+       allocate (prt%p_decay (size (prt_src%p_decay)))
+       prt%p_decay = prt_src%p_decay
     end if
     if (allocated (prt_src%a_decay)) then
        if (allocated (prt%a_decay))  deallocate (prt%a_decay)
-       allocate (prt%a_decay (size (prt_src%a_decay)), source = prt_src%a_decay)
+       allocate (prt%a_decay (size (prt_src%a_decay)))
+       prt%a_decay = prt_src%a_decay
     end if
   end subroutine field_data_copy_from
 
@@ -477,13 +481,17 @@
     end if
     if (present (p_decay)) then
        if (allocated (prt%p_decay))  deallocate (prt%p_decay)
-       if (size (p_decay) > 0) &
-            allocate (prt%p_decay (size (p_decay)), source = p_decay)
+       if (size (p_decay) > 0) then
+          allocate (prt%p_decay (size (p_decay)))
+          prt%p_decay = p_decay
+       end if
     end if
     if (present (a_decay)) then
        if (allocated (prt%a_decay))  deallocate (prt%a_decay)
-       if (size (a_decay) > 0) &
-            allocate (prt%a_decay (size (a_decay)), source = a_decay)
+       if (size (a_decay) > 0) then
+            allocate (prt%a_decay (size (a_decay)))
+            prt%a_decay = a_decay
+         end if
     end if
   end subroutine field_data_set
 
@@ -810,12 +818,15 @@
     logical, intent(in), optional :: anti
     if (present (anti)) then
        if (anti) then
-          allocate (decay (size (prt%a_decay)), source = prt%a_decay)
+          allocate (decay (size (prt%a_decay)))
+          decay = prt%a_decay
        else
-          allocate (decay (size (prt%p_decay)), source = prt%p_decay)
+          allocate (decay (size (prt%p_decay)))
+          decay = prt%p_decay
        end if
     else
-       allocate (decay (size (prt%p_decay)), source = prt%p_decay)
+       allocate (decay (size (prt%p_decay)))
+       decay = prt%p_decay
     end if
   end subroutine field_data_get_decays


--- src/whizard-core/whizard.nw    (revision 7806)
+++ src/whizard-core/whizard.nw    (working copy)
@@ -908,8 +908,8 @@
        local%pn = global%pn
        if (allocated (local%sample_fmt))  deallocate (local%sample_fmt)
        if (allocated (global%sample_fmt)) then
-          allocate (local%sample_fmt (size (global%sample_fmt)), &
-               source = global%sample_fmt)
+          allocate (local%sample_fmt (size (global%sample_fmt)))
+          local%sample_fmt = global%sample_fmt         
        end if
        local%out_files => global%out_files
        local%model => global%model

Any objections?

comment:4 Changed 8 years ago by Juergen Reuter

Ok, new suggestion: we leave it as it is until we know whether it's fixed in gcc 7.1 or not.

comment:5 Changed 8 years ago by Juergen Reuter

Resolution: fixed
Status: newclosed

The run time errors have been solved by Andre Vehreschild (thanks!) and the current gcc/gfortran trunk works again. There is still the ICE (PR 79229) with the -fcheck=mem flag, however. Closing for now.

comment:6 Changed 8 years ago by Juergen Reuter

Milestone: v2.4.1v2.5.0

Milestone renamed

Note: See TracTickets for help on using tickets.