Skip to content
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

double_serializer_test fails (with valgrind) #498

Closed
andy5995 opened this issue Jul 24, 2019 · 2 comments
Closed

double_serializer_test fails (with valgrind) #498

andy5995 opened this issue Jul 24, 2019 · 2 comments

Comments

@andy5995
Copy link
Contributor

  • JSON_VER: git
  • OS: Debian 10
ERROR: valgrind found errors during execution:
FAIL test_double_serializer.test (exit status: 1)

Actually appears to be related to bash...? All other checks pass.

~/src/json-c/_build/tests$ valgrind --leak-check=full ./test_double_serializer 
==10195== Memcheck, a memory error detector
==10195== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==10195== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==10195== Command: ./test_double_serializer
==10195== 
==10198== 
==10198== HEAP SUMMARY:
==10198==     in use at exit: 51,962 bytes in 828 blocks
==10198==   total heap usage: 1,051 allocs, 223 frees, 78,776 bytes allocated
==10198== 
==10198== 11 bytes in 1 blocks are definitely lost in loss record 83 of 328
==10198==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==10198==    by 0x195E8D: xmalloc (in /bin/bash)
==10198==    by 0x18F51A: set_default_locale (in /bin/bash)
==10198==    by 0x135EE6: main (in /bin/bash)
==10198== 
==10198== LEAK SUMMARY:
==10198==    definitely lost: 11 bytes in 1 blocks
==10198==    indirectly lost: 0 bytes in 0 blocks
==10198==      possibly lost: 0 bytes in 0 blocks
==10198==    still reachable: 51,951 bytes in 827 blocks
==10198==         suppressed: 0 bytes in 0 blocks
==10198== Reachable blocks (those to which a pointer was found) are not shown.
==10198== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==10198== 
==10198== For counts of detected and suppressed errors, rerun with: -v
==10198== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==10197== 
==10197== HEAP SUMMARY:
==10197==     in use at exit: 51,600 bytes in 813 blocks
==10197==   total heap usage: 1,028 allocs, 215 frees, 74,418 bytes allocated
==10197== 
==10197== 11 bytes in 1 blocks are definitely lost in loss record 82 of 314
==10197==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==10197==    by 0x195E8D: xmalloc (in /bin/bash)
==10197==    by 0x18F51A: set_default_locale (in /bin/bash)
==10197==    by 0x135EE6: main (in /bin/bash)
==10197== 
==10197== LEAK SUMMARY:
==10197==    definitely lost: 11 bytes in 1 blocks
==10197==    indirectly lost: 0 bytes in 0 blocks
==10197==      possibly lost: 0 bytes in 0 blocks
==10197==    still reachable: 51,589 bytes in 812 blocks
==10197==         suppressed: 0 bytes in 0 blocks
==10197== Reachable blocks (those to which a pointer was found) are not shown.
==10197== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==10197== 
==10197== For counts of detected and suppressed errors, rerun with: -v
==10197== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==10199== 
==10199== HEAP SUMMARY:
==10199==     in use at exit: 50,604 bytes in 785 blocks
==10199==   total heap usage: 1,197 allocs, 412 frees, 80,398 bytes allocated
==10199== 
==10199== 11 bytes in 1 blocks are definitely lost in loss record 83 of 307
==10199==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==10199==    by 0x195E8D: xmalloc (in /bin/bash)
==10199==    by 0x18F51A: set_default_locale (in /bin/bash)
==10199==    by 0x135EE6: main (in /bin/bash)
==10199== 
==10199== LEAK SUMMARY:
==10199==    definitely lost: 11 bytes in 1 blocks
==10199==    indirectly lost: 0 bytes in 0 blocks
==10199==      possibly lost: 0 bytes in 0 blocks
==10199==    still reachable: 50,593 bytes in 784 blocks
==10199==         suppressed: 0 bytes in 0 blocks
==10199== Reachable blocks (those to which a pointer was found) are not shown.
==10199== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==10199== 
==10199== For counts of detected and suppressed errors, rerun with: -v
==10199== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==10201== 
==10201== HEAP SUMMARY:
==10201==     in use at exit: 170,827 bytes in 2,420 blocks
==10201==   total heap usage: 3,482 allocs, 1,062 frees, 269,401 bytes allocated
==10201== 
==10201== 11 bytes in 1 blocks are definitely lost in loss record 142 of 913
==10201==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==10201==    by 0x195E8D: xmalloc (in /bin/bash)
==10201==    by 0x18F51A: set_default_locale (in /bin/bash)
==10201==    by 0x135EE6: main (in /bin/bash)
==10201== 
==10201== LEAK SUMMARY:
==10201==    definitely lost: 11 bytes in 1 blocks
==10201==    indirectly lost: 0 bytes in 0 blocks
==10201==      possibly lost: 0 bytes in 0 blocks
==10201==    still reachable: 170,816 bytes in 2,419 blocks
==10201==         suppressed: 0 bytes in 0 blocks
==10201== Reachable blocks (those to which a pointer was found) are not shown.
==10201== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==10201== 
==10201== For counts of detected and suppressed errors, rerun with: -v
==10201== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==10200== 
==10200== HEAP SUMMARY:
==10200==     in use at exit: 170,406 bytes in 2,401 blocks
==10200==   total heap usage: 3,470 allocs, 1,069 frees, 232,031 bytes allocated
==10200== 
==10200== 11 bytes in 1 blocks are definitely lost in loss record 140 of 898
==10200==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==10200==    by 0x195E8D: xmalloc (in /bin/bash)
==10200==    by 0x18F51A: set_default_locale (in /bin/bash)
==10200==    by 0x135EE6: main (in /bin/bash)
==10200== 
==10200== LEAK SUMMARY:
==10200==    definitely lost: 11 bytes in 1 blocks
==10200==    indirectly lost: 0 bytes in 0 blocks
==10200==      possibly lost: 0 bytes in 0 blocks
==10200==    still reachable: 170,395 bytes in 2,400 blocks
==10200==         suppressed: 0 bytes in 0 blocks
==10200== Reachable blocks (those to which a pointer was found) are not shown.
==10200== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==10200== 
==10200== For counts of detected and suppressed errors, rerun with: -v
==10200== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==10203== 
==10203== HEAP SUMMARY:
==10203==     in use at exit: 170,476 bytes in 2,404 blocks
==10203==   total heap usage: 3,529 allocs, 1,125 frees, 233,863 bytes allocated
==10203== 
==10203== 11 bytes in 1 blocks are definitely lost in loss record 141 of 901
==10203==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==10203==    by 0x195E8D: xmalloc (in /bin/bash)
==10203==    by 0x18F51A: set_default_locale (in /bin/bash)
==10203==    by 0x135EE6: main (in /bin/bash)
==10203== 
==10203== LEAK SUMMARY:
==10203==    definitely lost: 11 bytes in 1 blocks
==10203==    indirectly lost: 0 bytes in 0 blocks
==10203==      possibly lost: 0 bytes in 0 blocks
==10203==    still reachable: 170,465 bytes in 2,403 blocks
==10203==         suppressed: 0 bytes in 0 blocks
==10203== Reachable blocks (those to which a pointer was found) are not shown.
==10203== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==10203== 
==10203== For counts of detected and suppressed errors, rerun with: -v
==10203== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==10206== 
==10206== HEAP SUMMARY:
==10206==     in use at exit: 170,434 bytes in 2,404 blocks
==10206==   total heap usage: 3,642 allocs, 1,238 frees, 240,823 bytes allocated
==10206== 
==10206== 11 bytes in 1 blocks are definitely lost in loss record 144 of 913
==10206==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==10206==    by 0x195E8D: xmalloc (in /bin/bash)
==10206==    by 0x18F51A: set_default_locale (in /bin/bash)
==10206==    by 0x135EE6: main (in /bin/bash)
==10206== 
==10206== LEAK SUMMARY:
==10206==    definitely lost: 11 bytes in 1 blocks
==10206==    indirectly lost: 0 bytes in 0 blocks
==10206==      possibly lost: 0 bytes in 0 blocks
==10206==    still reachable: 170,423 bytes in 2,403 blocks
==10206==         suppressed: 0 bytes in 0 blocks
==10206== Reachable blocks (those to which a pointer was found) are not shown.
==10206== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==10206== 
==10206== For counts of detected and suppressed errors, rerun with: -v
==10206== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==10210== 
==10210== HEAP SUMMARY:
==10210==     in use at exit: 171,754 bytes in 2,441 blocks
==10210==   total heap usage: 3,902 allocs, 1,461 frees, 287,176 bytes allocated
==10210== 
==10210== 11 bytes in 1 blocks are definitely lost in loss record 144 of 923
==10210==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==10210==    by 0x195E8D: xmalloc (in /bin/bash)
==10210==    by 0x18F51A: set_default_locale (in /bin/bash)
==10210==    by 0x135EE6: main (in /bin/bash)
==10210== 
==10210== LEAK SUMMARY:
==10210==    definitely lost: 11 bytes in 1 blocks
==10210==    indirectly lost: 0 bytes in 0 blocks
==10210==      possibly lost: 0 bytes in 0 blocks
==10210==    still reachable: 171,743 bytes in 2,440 blocks
==10210==         suppressed: 0 bytes in 0 blocks
==10210== Reachable blocks (those to which a pointer was found) are not shown.
==10210== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==10210== 
==10210== For counts of detected and suppressed errors, rerun with: -v
==10210== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==10209== 
==10209== HEAP SUMMARY:
==10209==     in use at exit: 171,272 bytes in 2,422 blocks
==10209==   total heap usage: 3,890 allocs, 1,468 frees, 249,542 bytes allocated
==10209== 
==10209== 11 bytes in 1 blocks are definitely lost in loss record 142 of 908
==10209==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==10209==    by 0x195E8D: xmalloc (in /bin/bash)
==10209==    by 0x18F51A: set_default_locale (in /bin/bash)
==10209==    by 0x135EE6: main (in /bin/bash)
==10209== 
==10209== LEAK SUMMARY:
==10209==    definitely lost: 11 bytes in 1 blocks
==10209==    indirectly lost: 0 bytes in 0 blocks
==10209==      possibly lost: 0 bytes in 0 blocks
==10209==    still reachable: 171,261 bytes in 2,421 blocks
==10209==         suppressed: 0 bytes in 0 blocks
==10209== Reachable blocks (those to which a pointer was found) are not shown.
==10209== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==10209== 
==10209== For counts of detected and suppressed errors, rerun with: -v
==10209== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Test default serializer:
obj.to_string(standard)=0.5
Test default serializer with custom userdata:
obj.to_string(userdata)=0.5
Test explicit serializer with custom userdata:
obj.to_string(custom)=test
Test reset serializer:
obj.to_string(reset)=0.5
obj.to_string(default format)=0.52381
obj.to_string(with global format)=x0.524y
obj.to_string(with thread format)=T0.52X
obj.to_string(long thread format)=Ttttttttttttt0.52xxxxxxxxxxxxxxxxxxX
obj.to_string(back to global format)=x0.524y
obj.to_string(back to default format)=0.52381
obj(12.0).to_string(default format)=12.0
obj(12.0).to_string(%.0f)=12
obj(12.0).to_string(%.0g)=1e+01
obj(12.0).to_string(%.1g)=12.0
obj(-12.0).to_string(default format)=-12.0
@hawicz
Copy link
Member

hawicz commented Jul 26, 2019

The check in test-defs.sh just does a very basic grep for "ERROR SUMMARY: 0 errors" at the end of the valgrind output, but with exec'ing the actual binary being the last thing that ./test_double_serializer (aka bash) does, I'd expect that to be fine.

If you're running valgrind directly, you need to at least include --trace-children=yes so you're not just analyzing the bash execution.

@hawicz
Copy link
Member

hawicz commented Jul 26, 2019

oops, looks like I introduced a bug into that test in 485f2a0

hawicz added a commit that referenced this issue Jul 26, 2019
@hawicz hawicz closed this as completed Jul 26, 2019
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

No branches or pull requests

2 participants