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

Integrate with Valgrind #15

Closed
smtakeda opened this issue Dec 5, 2017 · 7 comments
Closed

Integrate with Valgrind #15

smtakeda opened this issue Dec 5, 2017 · 7 comments
Assignees

Comments

@smtakeda
Copy link
Contributor

smtakeda commented Dec 5, 2017

No description provided.

@smtakeda smtakeda self-assigned this Dec 7, 2017
@smtakeda
Copy link
Contributor Author

smtakeda commented Jan 6, 2018

PHP tests can run with valgrind by

TEST_PHP_ARGS=-m make test

But the large result set tests will hit a test timeout as it takes more than 5 min.

@smtakeda
Copy link
Contributor Author

smtakeda commented Jan 7, 2018

ctests raised this. This doesn't happen in the local environment. Not sure what is going on.

==9738== Invalid free() / delete / delete[] / realloc()
==9738==    at 0x4C2BDEC: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9738==    by 0x57E2DEB: __libc_freeres (in /lib/x86_64-linux-gnu/libc-2.19.so)
==9738==    by 0x4A256BC: _vgnU_freeres (in /usr/lib/valgrind/vgpreload_core-amd64-linux.so)
==9738==    by 0x56B616A: __run_exit_handlers (exit.c:97)
==9738==    by 0x56B61F4: exit (exit.c:104)
==9738==    by 0x569BF4B: (below main) (libc-start.c:321)
==9738==  Address 0x5a3c3c0 is 0 bytes inside data symbol "noai6ai_cached"
==9738== 
==9738== 
==9738== HEAP SUMMARY:
==9738==     in use at exit: 0 bytes in 0 blocks
==9738==   total heap usage: 84,111 allocs, 84,112 frees, 8,407,676 bytes allocated
==9738== 
==9738== All heap blocks were freed -- no leaks are possible
==9738== 
==9738== For counts of detected and suppressed errors, rerun with: -v
==9738== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

@smtakeda
Copy link
Contributor Author

smtakeda commented Jan 7, 2018

--run-libc-freeres=no removed the error. Looks like it was due to old glibc.

@smtakeda
Copy link
Contributor Author

smtakeda commented Jan 7, 2018

All tests but one test passed.
https://travis-ci.org/snowflakedb/pdo_snowflake/jobs/325963856
This is the large result set test. @notkriswagner do you have any idea about this?

==10080== 
==10080== HEAP SUMMARY:
==10080==     in use at exit: 8,285 bytes in 58 blocks
==10080==   total heap usage: 889,779 allocs, 889,721 frees, 94,992,156,847 bytes allocated
==10080== 
==10080== 544 bytes in 2 blocks are possibly lost in loss record 20 of 25
==10080==    at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10080==    by 0x4012FE4: allocate_dtv (dl-tls.c:296)
==10080==    by 0x4012FE4: _dl_allocate_tls (dl-tls.c:460)
==10080==    by 0x5464D92: allocate_stack (allocatestack.c:589)
==10080==    by 0x5464D92: pthread_create@@GLIBC_2.2.5 (pthread_create.c:500)
==10080==    by 0x45C523: chunk_downloader_init (chunk_downloader.c:285)
==10080==    by 0x45188B: snowflake_execute (client.c:1447)
==10080==    by 0x44FF5F: snowflake_query (client.c:939)
==10080==    by 0x44D433: main (large_result_set.c:31)
==10080== 
==10080== LEAK SUMMARY:
==10080==    definitely lost: 0 bytes in 0 blocks
==10080==    indirectly lost: 0 bytes in 0 blocks
==10080==      possibly lost: 544 bytes in 2 blocks
==10080==    still reachable: 7,741 bytes in 56 blocks
==10080==         suppressed: 0 bytes in 0 blocks
==10080== Reachable blocks (those to which a pointer was found) are not shown.
==10080== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==10080== 
==10080== For counts of detected and suppressed errors, rerun with: -v
==10080== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Will look into this anyway.

@smtakeda
Copy link
Contributor Author

smtakeda commented Jan 7, 2018

If I ran the large result set test, no valgrind error is raised:

xucxaNAEb7II1SItlFjMx9Amj1MGIokATyQnclc3rNO9KoWng75oyWtZLqrbgAE4t6vM7VpOMF2NoAXaEejMIvuKncF7xmbisZ8HMSFaK9f5MGxO0NZ6P7qpGgHqjE4Or8T7TV2pEj4RQTXz05SfgRLM1G984XZVIq0xq6rO3a44byTL3bQ2vXtYRCNn8l49Pvz7tFfPzVpoSJierVVfwBidr5DwYqSZSpAIfhkT80kowYsJlVvtWRl4yL2XvNHeqbXGFpYsqwS4g7TJc3NgkVi5f1b2nJ0RAauQrk3ZUtjBqsyYhPABSOI0lvN7WmWqJgwaLksJUC2FelKlknbLyz8MIjYXnlMTjDMdLbNm9Gb5b0BvBesBYXIkKVuSxYPRPnKAoGr32axY16GUk5TaLotUQf4Iu73RLAEXDl8sFt8wiJWpZPoegfgtadI207KVH1FlEJSBzyy7huAH3Kf6bu7HPcj4XiVuZDXEXvHwV8YziDd1a4Z4qGSxlho7FtJE0SflJhoDpgNqqqVA9WK55BbKejwRlZdlEwQn8SXkG9d6mOdGxcmlbVumqGGMhI3mWuINMEasFVOy3rxEWStPINEhY3OyVt3mKPKK3g159O7VOw83RyZjoHLTZ9FLP5tblKHfzn7v3NuL66e5mx79IyvtYTATwceYMSvHGdqpx1WOaaZn1FZzlUMLRHCgHJ29t3BZlRyW
Number of rows in result: 100000
Number of rows fetched: 100000
Number of rows fetched equals number of rows expected in result
==27963== 
==27963== HEAP SUMMARY:
==27963==     in use at exit: 0 bytes in 0 blocks
==27963==   total heap usage: 759,688 allocs, 759,688 frees, 101,659,792,885 bytes allocated
==27963== 
==27963== All heap blocks were freed -- no leaks are possible
==27963== 
==27963== For counts of detected and suppressed errors, rerun with: -v
==27963== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 8 from 6)

@smtakeda
Copy link
Contributor Author

Now it is reproducible on the local vm. Moving the ticket to libsnowflakeclient.

@smtakeda
Copy link
Contributor Author

--run-libc-freeres=no caused the above issue. That's false alarm!

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

1 participant