Skip to content

Tester segfault due to libgfortran mixup #2224

@ckoe-bccms

Description

@ckoe-bccms

Hello everybody,

sorry for the initially empty bug report. Anyway.

I am observing tester failures while using a self-built gcc/gfortran 9.2 on top of Centos 7. These failures are the result of the testers being linked against the systems /lib64/libgfortran.so.3 instead of the compilers required libgfortran.so.5.

The normal openblas (0.3.7) built process compiles for example sblat1 with

# gfortran -g -Wall -frecursive -fno-optimize-sibling-calls -m64 -fopenmp -mavx2 -g  -o sblat1 sblat1.o ../libopenblas_omp_haswellp-r0.3.7.a -lm -lpthread -lgfortran -lm -lpthread -lgfortran -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../..  -lgomp -lpthread -lc
# ldd ./sblat1
        linux-vdso.so.1 =>  (0x00007ffd57d16000)
        libgfortran.so.3 => /lib64/libgfortran.so.3 (0x00007f6bb3486000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f6bb3184000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f6bb2f68000)
        libgomp.so.1 => /cluster/comp/gcc/9.2.0/lib64/libgomp.so.1 (0x00007f6bb2d33000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f6bb2966000)
        libgcc_s.so.1 => /cluster/comp/gcc/9.2.0/lib64/libgcc_s.so.1 (0x00007f6bb274e000)
        libquadmath.so.0 => /cluster/comp/gcc/9.2.0/lib64/libquadmath.so.0 (0x00007f6bb2508000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f6bb37a8000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f6bb2304000)
# ./sblat1

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7F0D3F69D697
#1  0x7F0D3F69DCDE
#2  0x7F0D3EB9A27F
#3  0x7F0D3F75C4C0
#4  0x7F0D3F769E27
#5  0x403DEA in MAIN__ at sblat1.f:63
Segmentation fault

EDIT: Copied initially wrong ldd output, now hopefully the correct one !

Now, if I prune library path arguments passed to the compiler and compile with

gfortran -g -Wall -frecursive -fno-optimize-sibling-calls -m64 -fopenmp -mavx2 -g  -o sblat1 sblat1.o ../libopenblas_omp_haswellp-r0.3.7.a -lm -lpthread -lgfortran -lm -lpthread -lgfortran   -lgomp -lpthread -lc
# ldd ./sblat1
        linux-vdso.so.1 =>  (0x00007ffed6dc2000)
        libgfortran.so.5 => /cluster/comp/gcc/9.2.0/lib64/libgfortran.so.5 (0x00007f1a4351a000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f1a43218000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f1a42ffc000)
        libgomp.so.1 => /cluster/comp/gcc/9.2.0/lib64/libgomp.so.1 (0x00007f1a42dc7000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f1a429fa000)
        libgcc_s.so.1 => /cluster/comp/gcc/9.2.0/lib64/libgcc_s.so.1 (0x00007f1a427e2000)
        libquadmath.so.0 => /cluster/comp/gcc/9.2.0/lib64/libquadmath.so.0 (0x00007f1a4259c000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f1a439a8000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f1a42398000)
# ./sblat1|head
 Real BLAS Test Program Results


 Test of subprogram number  1             SDOT 
                                    ----- PASS -----

this now links the correct libgfortran.5.so from the compiler.

This leads to the question if the original compiler call should contain the /usr/lib/gcc/x86_64-redhat-linux/4.8.5 etc. library paths which appear to be problematic ? Also, is there a way I could influence this from Makefile.rules, i.e. without changing lower level files ?

Best Regards

Christof

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions