liberasurecode_test fails with "free(): invalid size" w/ ubuntu versions of jerasure/gf-complete

Issue #5 resolved
Tushar Gohad repo owner created an issue

Log (make test):

ok 1 - test_create_backend_invalid_args: UNKNOWN
ok 2 - test_create_backend_invalid_args: UNKNOWN
ok 3 - test_encode_invalid_args: UNKNOWN
ok 4 - test_encode_cleanup_invalid_args: UNKNOWN
ok 5 - test_decode_invalid_args: UNKNOWN
ok 6 - test_decode_cleanup_invalid_args: UNKNOWN
*** Error in `/tmp/liberasurecode/test/.libs/lt-liberasurecode_test': free(): invalid size: 0x0000000001e781f0 ***
make: *** [test] Aborted (core dumped)

To reproduce:

  1. remove all instances of Jerasure/gf-complete from your system.
  2. install:

http://mirrors.kernel.org/ubuntu/pool/universe/g/gf-complete/libgf-complete1_1.0.2-1_amd64.deb http://mirrors.kernel.org/ubuntu/pool/universe/j/jerasure/libjerasure2_2.0.0-1_amd64.deb http://mirrors.kernel.org/ubuntu/pool/universe/j/jerasure/libjerasure-dev_2.0.0-1_amd64.deb

  1. Rebuild liberasurecode "master"

  2. Issue "make test"

@bloodeagle40234 would you be able to take a look?

Comments (20)

  1. Kevin Greenan

    @tsg- @bloodeagle40234 I do not have time to look at this tonight, but can look tomorrow morning, if you guys do not figure it out. Keep me in the loop.

  2. Kota Tsuyuzaki

    @tsg- When I tried to take a look to this bug with new ubuntu 14.04 VM, the test didn't fail but I found doubtful code. I didn't reach why the test passed in my environment if my idea is true, but I'll try to figure out ASAP.

  3. Tushar Gohad reporter

    @bloodeagle40234 I am using 14.04 vagrant box as well. Don't see this when using jerasure/gf-complete built from latest git .. but when using ubuntu packaged versions, it fails with the error .. so make sure you install the ubuntu versions.

  4. Kota Tsuyuzaki

    @tsg- I tested on another environment at AWS. It was absolutely clear for testing. In the env, "double free or corruption" I expected with the doubtfull code above occurred so we need to merge the WIP code anyways to treat it. However, I sitll don't get whether the "free invalid size" caused from same issue or not. I wonder if you could test with the WIP code to clarify the bug.

  5. Kota Tsuyuzaki

    @kmgreen2 Thanks to looked at and mereged my patch @tsg- I'm waiting you also had test the patch because I couldn't reraise the bug in my environment. If you still had this issue, I'll restart to try to figure out what really happened.

  6. Kota Tsuyuzaki

    @tsg- I'm glad to tell you my recent patch ("WIP: fix doubtful code") fixes your issue :)

    I tested with following sequence at the new clean environment on ubuntu 14.04 on AWS:

    NOTE: This procedure report has 2 branches (choice 1 and 2) to confirm the WIP patch really treat your issue.

    • Creating schroot env
    • Install jerasure and gf-complete with deb package
    • Install related package (wget, git, autoconf, libtool) by apt-get.
    • Cloning liberasurecode repository to local
    • (choice 1) git reset --hard ceb8a406d015fe581f1d7b37f8435c18ba66e782 ( commit on "Fix JERAURE_SONAME in alg_sig.h" )
    • (choice 2) git reset --hard d81488a6b7629abdf625515cc503f847cdf6bc2d ( commit on "WIP: fix doubtful code"
    • bash autogen.sh, and then ./configure and then make
    • make test
    • test failed as:
    1..88
    ok 1 - test_create_backend_invalid_args: UNKNOWN
    lt-liberasurecode_test: liberasurecode_test.c:276: test_destroy_backend_invalid_args: Assertion `desc > 0' failed.
    
    • make install
    • ldconfig
    • make test
    • (choice 1) Fails with "free(): Invalid size" (same as you reported) with following logs:
    1..88
    ok 1 - test_create_backend_invalid_args: UNKNOWN
    ok 2 - test_create_backend_invalid_args: UNKNOWN
    ok 3 - test_encode_invalid_args: UNKNOWN
    ok 4 - test_encode_cleanup_invalid_args: UNKNOWN
    ok 5 - test_decode_invalid_args: UNKNOWN
    ok 6 - test_decode_cleanup_invalid_args: UNKNOWN
    *** Error in `/root/liberasurecode/test/.libs/lt-liberasurecode_test': free(): invalid size: 0x0000000001c2f1f0 ***
    make: *** [test] Aborted (core dumped)
    
    • (choice 2) All tests passed :)

    Hence, I trust current newest master doesn't fail with "free(): Invalid size", could you please confirm it again?

  7. Tushar Gohad reporter

    @bloodeagle40234, we don't want the tests to fail in either case. and yes, the current master doesn't fail with invalid size.

  8. Kota Tsuyuzaki

    @tsg- @kmgreen2 Sorry, it does not make me sence. The failure caused from absolutely a test code bug and it has been fixed on the current master so it will never fail. Do you still want to remove the test even though fixed, right? I could get rid of it easily but I didn't get the reason. Did I miss something?

  9. Kota Tsuyuzaki

    @tsg- Perhaps, are you meaning we should squash the wip commit to the issue commit not to fail at any commits on master? If you allow me to modify the history of master branch (i.e. allow force push), I could do that but I am worried the force push might break something else. (e.g. version tags)

  10. Tushar Gohad reporter

    @bloodeagle40234 sorry about the confusion over this issue. My point was that the assertions we are seeing with non-existent backends (not the double free one reported here), we should simply skip the test.

    In my comment above about latest master, I was only confirming what you said - that it doesn't fail anymore with invalid size error .. thank you for fixing that.

  11. Kota Tsuyuzaki

    @tsg- OK, I got it. The point you mentioned seems like as auto-skipping for non-exiting backends as same as PyECLib unittest. If so, it seems far from this issue #5 so I would like to close this #5 and open it as another issue, and then, discuss there. Is that ok for you?

  12. Log in to comment