#18 Inserted keys not being retrieved


Keys that have been successfully inserted into the tree are not being
retrived on Darwin 8.6.0 with gcc 4.0.1 (PowerPC) or on Darwin 8.6.1 with
gcc 4.0.1 (Intel). Identical code, compiled on Linux 2.6.13 with gcc 4.0.2
(Intel), works perfectly (tested insertion/retrival of up to 100 million keys).

The test program is attached. The first case that fails is with nrays = 32.

Compile with:

gcc -O3 -o judyhs_ray judyhs_ray.c -lJudy

Run with:

judyhs_ray <nrays>


judyhs_ray 32





  • Christiaan Gribble

    Test program demonstrating failure

  • Nobody/Anonymous

    Logged In: NO

    I've found the same problem with Darwin 8.6 as well in my own test program.
    Interestingly if you build judy with CFLAGS=-O2 the bug manifests more often
    and earlier.

  • Nobody/Anonymous

    Logged In: NO

    Just confirming, for the test program given to break you have to build Judy with
    optimisation which is not enabled by default. i.e. "CFLAGS=-O2 ./configure;

  • Nobody/Anonymous

    Logged In: NO

    A workaround is to compile with gcc 3.3 on Darwin 8.x on powerpc. e.g.
    > "CC=gcc-3.3 ./configure; make"

    Darwin 8.x on Intel only has gcc 4.0 so the only workaround there is to build
    without optimisation.

  • Nobody/Anonymous

    Logged In: NO

    Workaround on intel macs is to install gcc-3.3 from source. Instructions can be
    found here: http://www.macosxhints.com/article.php?

    Then build with: "CC=gcc-3.3 ./configure; make"

  • Nobody/Anonymous

    Logged In: NO

    This bug is fixed (or at least not reproducable) in Judy v1.0.4. The example program will execute correctly on Tiger (Darwin 8) compiled with gcc 4.0.1 and -O2 if linked with judy 1.04, and fails if linked with v1.0.3.

  • Nobody/Anonymous

    Logged In: NO

    Problem only occurs with gcc 4.01 on Tiger, doesn't happen with gcc 4.0.1 on Leopard.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks