Skip to content

realloc-16687 test leaks memory #17303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alexcrichton opened this issue Sep 16, 2014 · 3 comments · Fixed by #17475
Closed

realloc-16687 test leaks memory #17303

alexcrichton opened this issue Sep 16, 2014 · 3 comments · Fixed by #17475

Comments

@alexcrichton
Copy link
Member

$ rustc src/test/run-pass/realloc-16687.rs && valgrind --leak-check=full ./realloc-16687 
==4914== Memcheck, a memory error detector
==4914== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==4914== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==4914== Command: ./realloc-16687
==4914== 
==4914== 
==4914== HEAP SUMMARY:
==4914==     in use at exit: 832 bytes in 16 blocks
==4914==   total heap usage: 92 allocs, 76 frees, 8,384 bytes allocated
==4914== 
==4914== 416 bytes in 8 blocks are definitely lost in loss record 1 of 2
==4914==    at 0x167BEC: je_rallocx (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x1157B6: heap::imp::reallocate::h79d83959002ee6a8rha (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x1156F5: heap::reallocate::hab85b6905c8086a1yaa (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x1153E0: test_triangle::reallocate::hce22b2100fcc031d6ia (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x114D99: test_triangle::test_4::h7f38076d2656a38dQva (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x111B68: test_triangle::hae2dbf867a1dc84dMaa (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x1113BD: main::h796c90ed3713cda0haa (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x149DEA: start::closure.8494 (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x161F8B: rust_try_inner (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x161F75: rust_try (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x15F582: unwind::try::hc32837413dc79d50uId (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x15F42B: task::Task::run::he2343ec4d9f3287dfYc (in /home/alex/code/rust2/realloc-16687)
==4914== 
==4914== 416 bytes in 8 blocks are definitely lost in loss record 2 of 2
==4914==    at 0x167BEC: je_rallocx (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x1157B6: heap::imp::reallocate::h79d83959002ee6a8rha (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x1156F5: heap::reallocate::hab85b6905c8086a1yaa (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x1153E0: test_triangle::reallocate::hce22b2100fcc031d6ia (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x114E78: test_triangle::test_4::h7f38076d2656a38dQva (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x111B68: test_triangle::hae2dbf867a1dc84dMaa (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x1113BD: main::h796c90ed3713cda0haa (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x149DEA: start::closure.8494 (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x161F8B: rust_try_inner (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x161F75: rust_try (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x15F582: unwind::try::hc32837413dc79d50uId (in /home/alex/code/rust2/realloc-16687)
==4914==    by 0x15F42B: task::Task::run::he2343ec4d9f3287dfYc (in /home/alex/code/rust2/realloc-16687)
==4914== 
==4914== LEAK SUMMARY:
==4914==    definitely lost: 832 bytes in 16 blocks
==4914==    indirectly lost: 0 bytes in 0 blocks
==4914==      possibly lost: 0 bytes in 0 blocks
==4914==    still reachable: 0 bytes in 0 blocks
==4914==         suppressed: 0 bytes in 0 blocks
==4914== 
==4914== For counts of detected and suppressed errors, rerun with: -v
==4914== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)

I'm ignoring this test for now as it looks fairly complicated and this is required for a new snapshot to pass.

@alexcrichton
Copy link
Member Author

cc @pnkfelix

@thestinger
Copy link
Contributor

@alexcrichton: I don't see a deallocate call anywhere, so it looks like it's just a buggy test.

@pnkfelix
Copy link
Member

oh yeah, that test definitely looks buggy. will fix.

pnkfelix added a commit to pnkfelix/rust that referenced this issue Sep 23, 2014
bors added a commit that referenced this issue Sep 29, 2014
Add deallocate calls to the realloc-16687.rs test.

Fix #17303.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants