bug-avl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pbst-test detects memory leaks when compiled with -O3


From: Georg Sauthoff
Subject: pbst-test detects memory leaks when compiled with -O3
Date: Sun, 4 May 2014 23:45:58 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

I am using GNU avl-2.0.3. When compiling without optimizations, all
tests run successfully. But when I compile with -O3 the pbst-test
fails (the other still succeed).

Expected behaviour:

    $ ./pbst-test
    Testing seed=19886...
    [..]
    $ echo $?
    0

Actual behaviour:

    $ ./pbst-test
    ./pbst-test
    bst-test for GNU libavl 2.0.3; use --help to get help.
    Testing seed=19886...
     Node 0 has parent 6 (should be 1).
     Node 4 has parent 3 (should be 5).
     Node 6 has parent 10 (should be 5).
     Node 5 has parent 4 (should be 3).
     Node 8 has parent 6 (should be 9).
     Node 10 has parent -1 (should be 9).
     Node 12 has parent 14 (should be 13).
     Node 14 has parent 10 (should be 13).
     Node 9 has parent 8 (should be 11).
     Node 13 has parent 12 (should be 11).
     Node 3 has parent 0 (should be 7).
     Node 11 has parent 12 (should be 7).
      Error!
      Memory leaks detected:
        block #150: 40 bytes
        block #151: 32 bytes
        block #152: 32 bytes
        block #153: 32 bytes
        block #154: 32 bytes
        block #155: 32 bytes
        block #156: 32 bytes
        block #157: 32 bytes
        block #158: 32 bytes
        block #159: 32 bytes
        block #160: 32 bytes
        block #161: 32 bytes
        block #162: 32 bytes
        block #163: 32 bytes
        block #164: 32 bytes
        block #165: 32 bytes
    $ echo $?
    1

How reproducible:

Compile with gcc -O3

Test-system:
Fedora 19
gcc 4.8.2
x86/64

Note that when compiling with -O or -O2 pbst-test also succeeds.


Best regards
Georg

PS: When compiling with optimizations, gcc -Wall issues some warnings about
possible uses of uninitialized variables. Attached patch fixes these issues. But
it does not fix the pbst-test failure.

Attachment: gccowallinit.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]