Bug 1645971 - valgrind wcsncmp reports "Conditional jump or move depends on uninitialised value" on glibc strcmp-avx2.S:113
Summary: valgrind wcsncmp reports "Conditional jump or move depends on uninitialised v...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: valgrind
Version: 29
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Mark Wielaard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1655642
TreeView+ depends on / blocked
 
Reported: 2018-11-05 05:45 UTC by Russell Strong
Modified: 2018-12-27 01:50 UTC (History)
4 users (show)

Fixed In Version: valgrind-3.14.0-7.fc29 valgrind-3.14.0-7.fc28
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1655642 (view as bug list)
Environment:
Last Closed: 2018-12-21 19:39:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
test program snippet that triggers the report (623 bytes, text/x-csrc)
2018-11-05 05:45 UTC, Russell Strong
no flags Details


Links
System ID Private Priority Status Summary Last Updated
KDE Software Compilation 401627 0 None None None 2018-12-01 23:11:17 UTC

Description Russell Strong 2018-11-05 05:45:11 UTC
Created attachment 1501630 [details]
test program snippet that triggers the report

Description of problem:

Valgrind is reporting what I suspect is a false positive:

"Conditional jump or move depends on uninitialised value" on
glibc strcmp-avx2.S:113

I've created a test program attached that generates the report using wcsncmp.  It appears to be length dependant on the underlying memory that is allocated.
This did not appear in versions of Fedora prior to 29.

The output of the test program is below.

[root@localhost net]# gcc test.c
[root@localhost net]# valgrind ./a.out
==26675== Memcheck, a memory error detector
==26675== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==26675== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==26675== Command: ./a.out
==26675== 


first test case (8 wchar_t), no complaints from valgrind
test case 1 match


second test case (6 wchar_t), valgrind complains
==26675== Conditional jump or move depends on uninitialised value(s)
==26675==    at 0x49C4E59: __wcsncmp_avx2 (strcmp-avx2.S:113)
==26675==    by 0x40121B: main (in /home/russell/net/a.out)
==26675== 
test case 2 match
==26675== 
==26675== HEAP SUMMARY:
==26675==     in use at exit: 0 bytes in 0 blocks
==26675==   total heap usage: 3 allocs, 3 frees, 1,080 bytes allocated
==26675== 
==26675== All heap blocks were freed -- no leaks are possible
==26675== 
==26675== For counts of detected and suppressed errors, rerun with: -v
==26675== Use --track-origins=yes to see where uninitialised values come from
==26675== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)


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

valgrind-3.14.0-1.fc29.x86_64

Comment 1 Mark Wielaard 2018-11-05 12:59:00 UTC
This probably comes from the following glibc commit glibc-2.27.9000-436-g1457016:

commit 1457016337072d1b6739f571846b619596990cb7
Author: Leonardo Sandoval <leonardo.sandoval.gonzalez.com>
Date:   Thu May 3 11:09:30 2018 -0500

    x86-64: Optimize strcmp/wcscmp and strncmp/wcsncmp with AVX2

strcmp, ecscmp and strncmp have overrides in valgrind shared/vg_replace_strmem.c.
But wcsncmp doesn't.

Comment 2 Fedora Update System 2018-12-19 01:43:42 UTC
valgrind-3.14.0-7.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-725d146d26

Comment 3 Fedora Update System 2018-12-19 03:36:48 UTC
valgrind-3.14.0-7.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-ef423a0352

Comment 4 Fedora Update System 2018-12-21 19:39:40 UTC
valgrind-3.14.0-7.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2018-12-27 01:50:49 UTC
valgrind-3.14.0-7.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.


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