[petsc-dev] PetscSF in Fortran

Adrian Croucher a.croucher at auckland.ac.nz
Tue Oct 31 23:08:05 CDT 2017


On 01/11/17 16:20, Jed Brown wrote:
> Adrian Croucher <a.croucher at auckland.ac.nz> writes:
>
>> On 01/11/17 09:50, Smith, Barry F. wrote:
>>>     Please send the full traceback. Cut and paste
>> It's not really giving me much, only:
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x00007efe8574d6a9 in Pack_int_1 (n=2, bs=1, idx=0xfd6430,
>> unpacked=0xfffffffb000003ec, packed=0xfe9a00)
>> at /home/acro018/software/PETSc/code/src/vec/is/sf/impls/basic/sfbasic.c:497
>> 497     DEF_PackCmp(int)
> You need to use "bt" (backtrace) to print the rest of the stack.

Aha OK. Here it is:

Program received signal SIGSEGV, Segmentation fault.
0x00007f93b64496a9 in Pack_int_1 (n=2, bs=1, idx=0x17b43e0,
unpacked=0xfffffffb000003ec, packed=0x17c79b0)
at /home/acro018/software/PETSc/code/src/vec/is/sf/impls/basic/sfbasic.c:497
497     DEF_PackCmp(int)
(gdb) bt
#0  0x00007f93b64496a9 in Pack_int_1 (n=2, bs=1, idx=0x17b43e0,
unpacked=0xfffffffb000003ec, packed=0x17c79b0)
at /home/acro018/software/PETSc/code/src/vec/is/sf/impls/basic/sfbasic.c:497
#1  0x00007f93b645e830 in PetscSFBcastBegin_Basic (sf=0x17acbb0,
unit=0x7f93b27ad5c0 <ompi_mpi_int>, rootdata=0xfffffffb000003ec,
leafdata=0xfffffffffffffffb)
at /home/acro018/software/PETSc/code/src/vec/is/sf/impls/basic/sfbasic.c:937
#2  0x00007f93b646f2b2 in PetscSFBcastBegin (sf=0x17acbb0,
unit=0x7f93b27ad5c0 <ompi_mpi_int>, rootdata=0xfffffffb000003ec,
leafdata=0xfffffffffffffffb)
at /home/acro018/software/PETSc/code/src/vec/is/sf/interface/sf.c:977
#3  0x00007f93b64769ab in petscsfbcastbegin_ (sf=0x7ffe1047db90,
unit=0x40222c, rptr=0x7ffe1047dba0, lptr=0x7ffe1047dc20,
ierr=0x7ffe1047dc3c)
at 
/home/acro018/software/PETSc/code/src/vec/is/sf/interface/ftn-custom/zsf.c:45
#4  0x0000000000401c3a in MAIN__ () at ex1f.F90:90

> Can you give instructions to reproduce on a different system?
This is just running Barry's src/vec/is/sf/examples/tutorials/ex1f example.
> Does Valgrind have warnings?

Valgrind output up to the crash is below. There are some warnings there 
about PetscSFBcastBegin.

Cheers, Adrian

acro018 at en-354401:~/software/PETSc/code/src/vec/is/sf/examples/tutorials$ 
valgrind --leak-check=yes ./ex1f

==17871== Memcheck, a memory error detector
==17871== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==17871== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==17871== Command: ./ex1f
==17871==
==17871== Syscall param writev(vector[...]) points to uninitialised byte(s)
==17871==    at 0xB2192A7: writev (writev.c:49)
==17871==    by 0xDF6C5C2: mca_oob_tcp_msg_send_handler (in 
/usr/lib/openmpi/lib/openmpi/mca_oob_tcp.so)
==17871==    by 0xDF6D7BA: mca_oob_tcp_peer_send (in 
/usr/lib/openmpi/lib/openmpi/mca_oob_tcp.so)
==17871==    by 0xDF71506: mca_oob_tcp_send_nb (in 
/usr/lib/openmpi/lib/openmpi/mca_oob_tcp.so)
==17871==    by 0xDD61017: orte_rml_oob_send (in 
/usr/lib/openmpi/lib/openmpi/mca_rml_oob.so)
==17871==    by 0xDD61697: orte_rml_oob_send_buffer (in 
/usr/lib/openmpi/lib/openmpi/mca_rml_oob.so)
==17871==    by 0xD956BEE: ??? (in 
/usr/lib/openmpi/lib/openmpi/mca_grpcomm_bad.so)
==17871==    by 0xA9AA64B: ompi_mpi_init (in 
/usr/lib/openmpi/lib/libmpi.so.1.0.8)
==17871==    by 0xA9C2969: PMPI_Init (in 
/usr/lib/openmpi/lib/libmpi.so.1.0.8)
==17871==    by 0x97957F7: PMPI_INIT (in 
/usr/lib/openmpi/lib/libmpi_f77.so.1.0.7)
==17871==    by 0x4FCF435: petscinitialize_internal (zstart.c:328)
==17871==    by 0x4FCFF36: petscinitialize_ (zstart.c:508)
==17871==  Address 0xf996431 is 161 bytes inside a block of size 256 alloc'd
==17871==    at 0x4C2AF2E: realloc (vg_replace_malloc.c:692)
==17871==    by 0xAA386D9: opal_dss_buffer_extend (in 
/usr/lib/openmpi/lib/libmpi.so.1.0.8)
==17871==    by 0xAA38A90: opal_dss_copy_payload (in 
/usr/lib/openmpi/lib/libmpi.so.1.0.8)
==17871==    by 0xAA147CD: orte_grpcomm_base_pack_modex_entries (in 
/usr/lib/openmpi/lib/libmpi.so.1.0.8)
==17871==    by 0xD956ACF: ??? (in 
/usr/lib/openmpi/lib/openmpi/mca_grpcomm_bad.so)
==17871==    by 0xA9AA64B: ompi_mpi_init (in 
/usr/lib/openmpi/lib/libmpi.so.1.0.8)
==17871==    by 0xA9C2969: PMPI_Init (in 
/usr/lib/openmpi/lib/libmpi.so.1.0.8)
==17871==    by 0x97957F7: PMPI_INIT (in 
/usr/lib/openmpi/lib/libmpi_f77.so.1.0.7)
==17871==    by 0x4FCF435: petscinitialize_internal (zstart.c:328)
==17871==    by 0x4FCFF36: petscinitialize_ (zstart.c:508)
==17871==    by 0x4015D7: MAIN__ (ex1f.F90:25)
==17871==    by 0x40214B: main (ex1f.F90:10)
==17871==
PetscSF Object: 1 MPI processes
   type: basic
     sort=rank-order
   [0] Number of roots=6, leaves=2, remote ranks=1
   [0] 0 <- (0,2)
   [0] 2 <- (0,0)
   [0] Roots referenced by my leaves, by rank
   [0] 0: 2 edges
   [0]    0 <- 2
   [0]    2 <- 0
==17871== Conditional jump or move depends on uninitialised value(s)
==17871==    at 0x4F2A6BB: f90array1daccessint_ (f90_fwrap.F:78)
==17871==    by 0x513732C: F90Array1dAccess (f90_cwrap.c:107)
==17871==    by 0x5209950: petscsfbcastbegin_ (zsf.c:43)
==17871==    by 0x401C39: MAIN__ (ex1f.F90:90)
==17871==    by 0x40214B: main (ex1f.F90:10)
==17871==
==17871== Conditional jump or move depends on uninitialised value(s)
==17871==    at 0x5137341: F90Array1dAccess (f90_cwrap.c:108)
==17871==    by 0x5209950: petscsfbcastbegin_ (zsf.c:43)
==17871==    by 0x401C39: MAIN__ (ex1f.F90:90)
==17871==    by 0x40214B: main (ex1f.F90:10)
==17871==
==17871== Conditional jump or move depends on uninitialised value(s)
==17871==    at 0x4F2A6BB: f90array1daccessint_ (f90_fwrap.F:78)
==17871==    by 0x513732C: F90Array1dAccess (f90_cwrap.c:107)
==17871==    by 0x520997B: petscsfbcastbegin_ (zsf.c:44)
==17871==    by 0x401C39: MAIN__ (ex1f.F90:90)
==17871==    by 0x40214B: main (ex1f.F90:10)
==17871==
==17871== Conditional jump or move depends on uninitialised value(s)
==17871==    at 0x5137341: F90Array1dAccess (f90_cwrap.c:108)
==17871==    by 0x520997B: petscsfbcastbegin_ (zsf.c:44)
==17871==    by 0x401C39: MAIN__ (ex1f.F90:90)
==17871==    by 0x40214B: main (ex1f.F90:10)
==17871==
==17871== Use of uninitialised value of size 8
==17871==    at 0x51DC6A9: Pack_int_1 (sfbasic.c:497)
==17871==    by 0x51F182F: PetscSFBcastBegin_Basic (sfbasic.c:937)
==17871==    by 0x52022B1: PetscSFBcastBegin (sf.c:977)
==17871==    by 0x52099AA: petscsfbcastbegin_ (zsf.c:45)
==17871==    by 0x401C39: MAIN__ (ex1f.F90:90)
==17871==    by 0x40214B: main (ex1f.F90:10)
==17871==
==17871== Invalid read of size 4
==17871==    at 0x51DC6A9: Pack_int_1 (sfbasic.c:497)
==17871==    by 0x51F182F: PetscSFBcastBegin_Basic (sfbasic.c:937)
==17871==    by 0x52022B1: PetscSFBcastBegin (sf.c:977)
==17871==    by 0x52099AA: petscsfbcastbegin_ (zsf.c:45)
==17871==    by 0x401C39: MAIN__ (ex1f.F90:90)
==17871==    by 0x40214B: main (ex1f.F90:10)
==17871==  Address 0xfffffffb00000200 is not stack'd, malloc'd or 
(recently) free'd
==17871==

-- 
Dr Adrian Croucher
Senior Research Fellow
Department of Engineering Science
University of Auckland, New Zealand
email: a.croucher at auckland.ac.nz
tel: +64 (0)9 923 4611



More information about the petsc-dev mailing list