Bug 673046 - Conditional jump or move depends on uninitialised value
Summary: Conditional jump or move depends on uninitialised value
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: valgrind
Version: rawhide
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: 2011-01-27 07:21 UTC by Nikola Pajkovsky
Modified: 2014-02-02 22:15 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-01-28 14:55:09 UTC
Type: ---


Attachments (Terms of Use)

Description Nikola Pajkovsky 2011-01-27 07:21:08 UTC
Description of problem:
There is condition jump in function *getline*

Version-Release number of selected component (if applicable):
$ rpm -q glibc
glibc-2.13.90-1.x86_64

How reproducible:
$ cat getline.c 
#include <stdio.h>
#include <stdlib.h>

int main(void)
{

    char *l = NULL;
    size_t len = 0;
    ssize_t read;

    FILE *fp = fopen("/etc/ethers", "r");

    while ((read = getline(&l, &len, fp)) != -1) {
    }

    free(l);
    fclose(fp);
}

$ cat Makefile 
PROGRAM			=	getline

CFLAGS			=	-std=gnu99 -pedantic -Wall -g -ggdb
CC			=	gcc

SRCS			+=	$(PROGRAM).c


OBJS			+=	$(addsuffix .o, $(basename $(SRCS)))


.PHONY:	build
.PHONY: clean

build: $(PROGRAM)

$(PROGRAM): $(OBJS)
		$(CC) $(CFLAGS) $(OBJS) -o $@


clean:
	rm -f *.o $(PROGRAM)


Steps to Reproduce:
1. just run it under valgrind
  
Actual results:
$ valgrind ./getline 
==329== Memcheck, a memory error detector
==329== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==329== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==329== Command: ./getline
==329== 
==329== Conditional jump or move depends on uninitialised value(s)
==329==    at 0x3437E16FD6: index (strchr.S:56)
==329==    by 0x3437E0776A: expand_dynamic_string_token (dl-load.c:324)
==329==    by 0x3437E080B1: _dl_map_object (dl-load.c:2179)
==329==    by 0x3437E017DD: map_doit (rtld.c:629)
==329==    by 0x3437E0E515: _dl_catch_error (dl-error.c:178)
==329==    by 0x3437E00F16: do_preload (rtld.c:813)
==329==    by 0x3437E044A7: dl_main (rtld.c:1696)
==329==    by 0x3437E14B23: _dl_sysdep_start (dl-sysdep.c:244)
==329==    by 0x3437E04F8E: _dl_start (rtld.c:334)
==329==    by 0x3437E01607: ??? (in /lib64/ld-2.13.90.so)
==329== 
==329== Conditional jump or move depends on uninitialised value(s)
==329==    at 0x3437E16FDB: index (strchr.S:59)
==329==    by 0x3437E0776A: expand_dynamic_string_token (dl-load.c:324)
==329==    by 0x3437E080B1: _dl_map_object (dl-load.c:2179)
==329==    by 0x3437E017DD: map_doit (rtld.c:629)
==329==    by 0x3437E0E515: _dl_catch_error (dl-error.c:178)
==329==    by 0x3437E00F16: do_preload (rtld.c:813)
==329==    by 0x3437E044A7: dl_main (rtld.c:1696)
==329==    by 0x3437E14B23: _dl_sysdep_start (dl-sysdep.c:244)
==329==    by 0x3437E04F8E: _dl_start (rtld.c:334)
==329==    by 0x3437E01607: ??? (in /lib64/ld-2.13.90.so)
==329== 
==329== 
==329== HEAP SUMMARY:
==329==     in use at exit: 0 bytes in 0 blocks
==329==   total heap usage: 2 allocs, 2 frees, 688 bytes allocated
==329== 
==329== All heap blocks were freed -- no leaks are possible
==329== 
==329== For counts of detected and suppressed errors, rerun with: -v
==329== Use --track-origins=yes to see where uninitialised values come from
==329== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 4 from 4)

Expected results:
be silent

Comment 1 Jakub Jelinek 2011-01-27 09:52:12 UTC
Yeah, valgrind needs to be rebuilt against glibc 2.13, as it suppressions are currently for 2.12* instead of 2.13*.

Comment 2 Jakub Jelinek 2011-01-28 14:55:09 UTC
Should be fixed with valgrind-3.6.0-2.fc15.


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