Bug 143251

Summary: ksh93 geneates valgrind hits
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Felix Schulte <felix.schulte>
Component: OtherAssignee: Dr. Werner Fink <werner>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: dgk, felix.schulte, forgotten_AxJOWNyuVy
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: SuSE Linux 10.0   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Felix Schulte 2006-01-14 00:46:24 UTC
ksh93 seems to generate a couple of valgrind hits which may require investigation.

Example:
------------------------------------------------------------------
valgrind /usr/bin/ksh -c "history"
==26785== Memcheck, a memory error detector.
==26785== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==26785== Using LibVEX rev 1313, a library for dynamic binary translation.
==26785== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==26785== Using valgrind-3.0.1.SVN, a dynamic binary instrumentation framework.
==26785== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==26785== For more details, rerun with: -v
==26785==
==26785== Syscall param mount(data) contains uninitialised byte(s)
==26785==    at 0x1BB8DC23: mount (in /lib/tls/libc-2.3.5.so)
==26785==    by 0x1B9BBD2E: fs3d (in /lib/ast/libast.so.5.4)
==26785==    by 0x1B92B6B8: sh_init (in /lib/ast/libshell.so.1.1)
==26785==    by 0x1B91CEE9: sh_main (in /lib/ast/libshell.so.1.1)
==26785==    by 0x804855B: (within /bin/ksh)
==26785==    by 0x1BAE3E9F: __libc_start_main (in /lib/tls/libc-2.3.5.so)
==26785==    by 0x8048480: (within /bin/ksh)
==26785==
==26785== Syscall param mount(type) points to unaddressable byte(s)
==26785==    at 0x1BB8DC23: mount (in /lib/tls/libc-2.3.5.so)
==26785==    by 0x1B9BBD2E: fs3d (in /lib/ast/libast.so.5.4)
==26785==    by 0x1B92B6B8: sh_init (in /lib/ast/libshell.so.1.1)
==26785==    by 0x1B91CEE9: sh_main (in /lib/ast/libshell.so.1.1)
==26785==    by 0x804855B: (within /bin/ksh)
==26785==    by 0x1BAE3E9F: __libc_start_main (in /lib/tls/libc-2.3.5.so)
==26785==    by 0x8048480: (within /bin/ksh)
==26785==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==26785==
==26785== Conditional jump or move depends on uninitialised value(s)
==26785==    at 0x1B9CA25C: optget (in /lib/ast/libast.so.5.4)
==26785==    by 0x1B92127E: sh_argopts (in /lib/ast/libshell.so.1.1)
==26785==    by 0x1B92C37E: sh_init (in /lib/ast/libshell.so.1.1)
==26785==    by 0x1B91CEE9: sh_main (in /lib/ast/libshell.so.1.1)
==26785==    by 0x804855B: (within /bin/ksh)
==26785==    by 0x1BAE3E9F: __libc_start_main (in /lib/tls/libc-2.3.5.so)
==26785==    by 0x8048480: (within /bin/ksh)
==26785==
==26785== Conditional jump or move depends on uninitialised value(s)
==26785==    at 0x1B9CA25C: optget (in /lib/ast/libast.so.5.4)
==26785==    by 0x1B911251: b_hist (in /lib/ast/libshell.so.1.1)
==26785==    by 0x1B956678: sh_exec (in /lib/ast/libshell.so.1.1)
==26785==    by 0x1B91C8C3: (within /lib/ast/libshell.so.1.1)
==26785==    by 0x1B91D050: sh_main (in /lib/ast/libshell.so.1.1)
==26785==    by 0x804855B: (within /bin/ksh)
==26785==    by 0x1BAE3E9F: __libc_start_main (in /lib/tls/libc-2.3.5.so)
==26785==    by 0x8048480: (within /bin/ksh)
1       ls
2       ls -la
3       history
==26785==
==26785== ERROR SUMMARY: 52 errors from 4 contexts (suppressed: 28 from 4)
==26785== malloc/free: in use at exit: 0 bytes in 0 blocks.
==26785== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==26785== For counts of detected errors, rerun with: -v
==26785== No malloc'd blocks -- no leaks are possible.
------------------------------------------------------------------

Key problem seems to be "Conditional jump or move depends on uninitialised value(s)", either being a real problem or valgrind having problems with the ioctl() listed in the log.

Valgrind version is
$ valgrind --version
valgrind-3.0.1.SVN
(from Suse 10.0 DVD)

ksh93 version is
ksh -c 'echo ${.sh.version}'
Version M 1993-12-28 q
(from Suse 10.0 DVD)

CC:ing David Korn and Roland Mainz for comments.
Comment 2 Dr. Werner Fink 2006-01-16 14:12:14 UTC
Please report this to the developers of ksh93.