Bug 1576883 - Conditional jump or move depends on uninitialised value in libgfortran.so.5.0.0
Summary: Conditional jump or move depends on uninitialised value in libgfortran.so.5.0.0
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-10 15:37 UTC by Satish Balay
Modified: 2018-08-10 13:46 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-10 13:46:40 UTC
Type: Bug


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.