Hello all,

we've found a strange testcase that makes Valgrind unhappy:
----
#include <Judy.h>

int main()
{
     static Pvoid_t photo_users = NULL;
     Word_t voter_id;
     for (voter_id = 2000; voter_id < 2053; voter_id++) {
         Word_t vote_idx = voter_id << 32;
         Judy1Set(&photo_users, vote_idx, NULL);
     }
}
-----

This simple piece of code produces the warnings below.

With -O0 the warnings are gone, so this must be the result of some compiler 
optimization.
The problem seems to be caused by GCC version - I was able to reproduce it with 
both gcc-4.8.1 & gcc-4.9.0 on Linux.
I also have an old Judy binary that was built by gcc-4.7 and (I think) has -O2 
enabled, which doesn't produce these warnings.
And finally, it's NOT reproducible if Judy is built with Clang (tried v3.3) 
both on Linux and OSX.
Any ideas?

==14458== Conditional jump or move depends on uninitialised value(s)
==14458==    at 0x4E63058: j__udyInsWalk (JudyPrivate.h:1586)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E64C97: Judy1Set (Judy1Set.c:1847)
==14458==    by 0x400723: main (in /tmp/j_test)
==14458==
==14458== Use of uninitialised value of size 8
==14458==    at 0x4E6300B: j__udyInsWalk (JudyPrivate.h:1586)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E64C97: Judy1Set (Judy1Set.c:1847)
==14458==    by 0x400723: main (in /tmp/j_test)
==14458==
==14458== Conditional jump or move depends on uninitialised value(s)
==14458==    at 0x4E6305E: j__udyInsWalk (JudyPrivate.h:1586)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E64C97: Judy1Set (Judy1Set.c:1847)
==14458==    by 0x400723: main (in /tmp/j_test)
==14458==
==14458== Use of uninitialised value of size 8
==14458==    at 0x4E6306A: j__udyInsWalk (JudyPrivate.h:1586)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E64C97: Judy1Set (Judy1Set.c:1847)
==14458==    by 0x400723: main (in /tmp/j_test)
==14458==
==14458== Conditional jump or move depends on uninitialised value(s)
==14458==    at 0x4E630A7: j__udyInsWalk (Judy1Set.c:819)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E64C97: Judy1Set (Judy1Set.c:1847)
==14458==    by 0x400723: main (in /tmp/j_test)
==14458==
==14458== Conditional jump or move depends on uninitialised value(s)
==14458==    at 0x4E64AAD: j__udyInsWalk (Judy1Set.c:819)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E64C97: Judy1Set (Judy1Set.c:1847)
==14458==    by 0x400723: main (in /tmp/j_test)
==14458==
==14458== Conditional jump or move depends on uninitialised value(s)
==14458==    at 0x4E64AF4: j__udyInsWalk (Judy1Set.c:819)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E64C97: Judy1Set (Judy1Set.c:1847)
==14458==    by 0x400723: main (in /tmp/j_test)
==14458==
==14458== Use of uninitialised value of size 8
==14458==    at 0x4E64B03: j__udyInsWalk (Judy1Set.c:819)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E64C97: Judy1Set (Judy1Set.c:1847)
==14458==    by 0x400723: main (in /tmp/j_test)
==14458==
==14458== Conditional jump or move depends on uninitialised value(s)
==14458==    at 0x4E64B21: j__udyInsWalk (Judy1Set.c:819)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E6294D: j__udyInsWalk (Judy1Set.c:1650)
==14458==    by 0x4E64C97: Judy1Set (Judy1Set.c:1847)
==14458==    by 0x400723: main (in /tmp/j_test)

-- 
Wbr,
Antony Dovgal
---
http://pinba.org - realtime profiling for PHP

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Judy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/judy-devel

Reply via email to