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

            Bug ID: 114859
           Summary: Seeing new segmentation fault in same_type_as
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: orion at nwra dot com
  Target Milestone: ---

As seen here:
https://koschei.fedoraproject.org/package/amg4psblas?collection=f40 with the
change from  14.0.1-0.13.fc40 to
14.0.1-0.15.fc40 we are starting to see a new segmentation fault in a test
program.

gdb shows:

Thread 1 "amg_d_pde2d" received signal SIGSEGV, Segmentation fault.
0x00007ffff7aee1b0 in amg_d_jac_smoother_clone_settings_ (sm=..., smout=...,
info=0) at ../amgprec/impl/smoother/amg_d_jac_smoother_clone_settings.f90:66
66            if (.not.same_type_as(sm%sv,smout%sv)) then
(gdb) print sm
$1 = {_data = 0x555555733100, _vptr = 0x7ffff7dbf360
<__amg_d_jac_smoother_MOD___vtab_amg_d_jac_smoother_Amg_d_jac_smoother_type>}
(gdb) print smout
$2 = {_data = 0x55555572bc00, _vptr = 0x7ffff7dbf360
<__amg_d_jac_smoother_MOD___vtab_amg_d_jac_smoother_Amg_d_jac_smoother_type>}

valgrind:

==73== Conditional jump or move depends on uninitialised value(s)
==73==    at 0x49961A1: amg_d_jac_smoother_clone_settings_ (in
/builddir/build/BUILDROOT/amg4psblas-1.1.2-5.fc41.x86_64/usr/lib64/openmpi/lib/libamg_prec.so.1.1)
==73==    by 0x4C0E736: ??? (in
/builddir/build/BUILDROOT/amg4psblas-1.1.2-5.fc41.x86_64/usr/lib64/openmpi/lib/libamg_prec.so.1.1)
==73==    by 0x4A7825B: amg_d_hierarchy_bld_ (in
/builddir/build/BUILDROOT/amg4psblas-1.1.2-5.fc41.x86_64/usr/lib64/openmpi/lib/libamg_prec.so.1.1)
==73==    by 0x10F770: MAIN__ (amg_d_pde2d.F90:409)
==73==    by 0x10BBD2: main (amg_d_pde2d.F90:67)
==73==
==73== Uninitialised byte(s) found during client check request
==73==    at 0x7B61B51: ??? (in /usr/lib64/openmpi/lib/libopen-pal.so.80.0.2)
==73==    by 0x69F2ED6: PMPI_Bcast (in
/usr/lib64/openmpi/lib/libmpi.so.40.40.2)
==73==    by 0x5FDE07B: MPI_BCAST (in
/usr/lib64/openmpi/lib/libmpi_mpifh.so.40.40.0)
==73==    by 0x4F20D69: __psi_m_collective_mod_MOD_psb_mbcasts (in
/usr/lib64/openmpi/lib/libpsb_base.so.3.8)
==73==    by 0x4AC9B1E: __amg_base_prec_type_MOD_amg_dml_bcast (in
/builddir/build/BUILDROOT/amg4psblas-1.1.2-5.fc41.x86_64/usr/lib64/openmpi/lib/libamg_prec.so.1.1)
==73==    by 0x4A800B5: amg_d_hierarchy_bld_ (in
/builddir/build/BUILDROOT/amg4psblas-1.1.2-5.fc41.x86_64/usr/lib64/openmpi/lib/libamg_prec.so.1.1)
==73==    by 0x10F770: MAIN__ (amg_d_pde2d.F90:409)
==73==    by 0x10BBD2: main (amg_d_pde2d.F90:67)
==73==  Address 0x3e6a471c is 5,612 bytes inside a block of size 109,760
alloc'd
==73==    at 0x484382F: malloc (vg_replace_malloc.c:446)
==73==    by 0x4A32781: amg_dprecinit_ (in
/builddir/build/BUILDROOT/amg4psblas-1.1.2-5.fc41.x86_64/usr/lib64/openmpi/lib/libamg_prec.so.1.1)
==73==    by 0x10F52B: MAIN__ (amg_d_pde2d.F90:279)
==73==    by 0x10BBD2: main (amg_d_pde2d.F90:67)
==73==

The only warning I see for that function's source file is:

amg_d_jac_smoother_clone_settings.f90:48:28:

   48 |   character(len=20) :: name='d_jac_smoother_clone_settings'
      |                            1
Warning: CHARACTER expression at (1) is being truncated (29/20)
[-Wcharacter-truncation]

which seems unrelated.

I'm at a loss with how to proceed to debug this further.

Reply via email to