Bug 1576883

Summary: Conditional jump or move depends on uninitialised value in libgfortran.so.5.0.0
Product: [Fedora] Fedora Reporter: Satish Balay <balay>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: aoliva, davejohansen, dmalcolm, fweimer, jakub, jwakely, law, mpolacek, msebor, nickc, pavel.ondracka
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-10 13:46:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Satish Balay 2018-05-10 15:37:59 UTC
Description of problem:

valgrind gives 'Conditional jump or move depends on uninitialised value' from within libgfortran.so.5.0.0 - for a simple fortran print statement

Version-Release number of selected component (if applicable):


gcc-gfortran-8.1.1-1.fc28.x86_64

How reproducible:

always

Steps to Reproduce:

balay@asterix /home/balay/junk
$ cat x.f
        program main
        integer i
        i = 5
        print *, 'Test string',i
        end

balay@asterix /home/balay/junk
$ gfortran -g x.f

Actual results:
balay@asterix /home/balay/junk
$ valgrind -q --tool=memcheck --leak-check=yes --num-callers=20 --track-origins=yes  ./a.out 
==28856== Conditional jump or move depends on uninitialised value(s)
==28856==    at 0x506923E: ??? (in /usr/lib64/libgfortran.so.5.0.0)
==28856==    by 0x5069623: ??? (in /usr/lib64/libgfortran.so.5.0.0)
==28856==    by 0x506A5FD: ??? (in /usr/lib64/libgfortran.so.5.0.0)
==28856==    by 0x506B344: ??? (in /usr/lib64/libgfortran.so.5.0.0)
==28856==    by 0x4007A3: MAIN__ (x.f:4)
==28856==    by 0x4007E9: main (x.f:5)
==28856==  Uninitialised value was created by a stack allocation
==28856==    at 0x50695E0: ??? (in /usr/lib64/libgfortran.so.5.0.0)
==28856== 
 Test string           5


Expected results:

no messages from valgrind

Additional info:

no such issue with 'GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)' on a different box. [also no valgrind messages with 'GNU Fortran (GCC) 7.2.0' built from source]

Also - I get a better stack trace with gfortran 8.1 compiled from source

bash-4.2$ valgrind -q --tool=memcheck --leak-check=yes --num-callers=20 --track-origins=yes ./a.out 
==40486== Conditional jump or move depends on uninitialised value(s)
==40486==    at 0x5057E3B: write_decimal.constprop.10 (write.c:808)
==40486==    by 0x50581E3: write_integer (write.c:1351)
==40486==    by 0x505905D: list_formatted_write_scalar (write.c:1865)
==40486==    by 0x5059D34: _gfortrani_list_formatted_write (write.c:1943)
==40486==    by 0x40083F: MAIN__ (x.f:4)
==40486==    by 0x400885: main (x.f:5)
==40486==  Uninitialised value was created by a stack allocation
==40486==    at 0x50581B0: write_integer (write.c:1327)
==40486== 
 Test string           5

Comment 1 Pavel Ondračka 2018-07-11 07:09:28 UTC
Upstream bug here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84156
So probably a valgrind problem in the end?

Comment 2 Marek Polacek 2018-08-10 13:46:40 UTC
The upstream PR closed as INVALID, so I'll do the same here.