我有一个类使用mongodb-c-driver进行mongodb操作。 在构造函数中,调用mongoc_init()。 在解构器中,调用mongoc_cleanup()。 然后,valgrind 3.10.1告诉我一些内存“仍然可以访问”。 valgrind输出的一部分如下:
== 23222 ==在586的丢失记录586中仍然可以到达1个块中的16,384个字节
== 23222 ==在0x4C2D199:realloc(vg_replace_malloc.c:692)
== 23222 == by 0x6243894:CRYPTO_realloc(在/lib/x86_64-linux-gnu/libcrypto.so.1.0.0中)
== 23222 == by 0x62BE1F1:lh_insert(在/lib/x86_64-linux-gnu/libcrypto.so.1.0.0中)
== 23222 == by 0x62C0828:??? (在/lib/x86_64-linux-gnu/libcrypto.so.1.0.0中)
== 23222 == by 0x62C0243:??? (在/lib/x86_64-linux-gnu/libcrypto.so.1.0.0中)
== 23222 == by 0x5FCB01D:ERR_load_SSL_strings(在/lib/x86_64-linux-gnu/libssl.so.1.0.0中)
== 23222 == by 0x5083623:_mongoc_ssl_init(在/usr/local/lib/libmongoc-1.0.so.0.0.0中)
== 23222 == by 0x5077028:_mongoc_do_init(在/usr/local/lib/libmongoc-1.0.so.0.0.0中)
== 23222 == by 0x529A3FF:pthread_once(pthread_once.S:104)
== 23222 == by 0x400F305:call_init.part.0(dl-init.c:85)
== 23222 == by 0x400F3DE:call_init(dl-init.c:52)
== 23222 == by 0x400F3DE:_dl_init(dl-init.c:134)
== 23222 == by 0x40016E9:??? (在/lib/x86_64-linux-gnu/ld-2.15.so中)
== 23222 ==泄漏摘要:
== 23222 ==仍然可以访问:3,075个块中的91,832个字节
当我评论这两个函数mongoc_init()和mongoc_cleanup()时,valgrind告诉我所有堆块都被释放了。
任何想法?
谢谢。
I have a class to do mongodb operation using mongodb-c-driver. In the constructor, mongoc_init() is called. In deconstructor, mongoc_cleanup() is called. Then, valgrind 3.10.1 told me that some memory "still reachable". Part of the valgrind output is following:
==23222== 16,384 bytes in 1 blocks are still reachable in loss record 586 of 586
==23222== at 0x4C2D199: realloc (vg_replace_malloc.c:692)
==23222== by 0x6243894: CRYPTO_realloc (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==23222== by 0x62BE1F1: lh_insert (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==23222== by 0x62C0828: ??? (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==23222== by 0x62C0243: ??? (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==23222== by 0x5FCB01D: ERR_load_SSL_strings (in /lib/x86_64-linux-gnu/libssl.so.1.0.0)
==23222== by 0x5083623: _mongoc_ssl_init (in /usr/local/lib/libmongoc-1.0.so.0.0.0)
==23222== by 0x5077028: _mongoc_do_init (in /usr/local/lib/libmongoc-1.0.so.0.0.0)
==23222== by 0x529A3FF: pthread_once (pthread_once.S:104)
==23222== by 0x400F305: call_init.part.0 (dl-init.c:85)
==23222== by 0x400F3DE: call_init (dl-init.c:52)
==23222== by 0x400F3DE: _dl_init (dl-init.c:134)
==23222== by 0x40016E9: ??? (in /lib/x86_64-linux-gnu/ld-2.15.so)
==23222== LEAK SUMMARY:
==23222== still reachable: 91,832 bytes in 3,075 blocks
When I commented these two functions, mongoc_init() and mongoc_cleanup(), valgrind told me that All heap blocks were freed.
Any idea?
Thanks.
最满意答案
这似乎是mongodb-c-driver的问题。 其他人在mongodb c驱动项目下报告了同样的问题。 https://jira.mongodb.org/browse/CDRIVER-478
It seems that it is the problem of the mongodb-c-driver. Others reported the same issue under mongodb c driver project. https://jira.mongodb.org/browse/CDRIVER-478
mongoc_init()和mongoc_cleanup()可能使内存“仍然可以访问”(mongoc_init() and mongoc_cleanup() may make memory “still reachable”)我有一个类使用mongodb-c-driver进行mongodb操作。 在构造函数中,调用mongoc_init()。 在解构器中,调用mongoc_cleanup()。 然后,valgrind 3.10.1告诉我一些内存“仍然可以访问”。 valgrind输出的一部分如下:
== 23222 ==在586的丢失记录586中仍然可以到达1个块中的16,384个字节
== 23222 ==在0x4C2D199:realloc(vg_replace_malloc.c:692)
== 23222 == by 0x6243894:CRYPTO_realloc(在/lib/x86_64-linux-gnu/libcrypto.so.1.0.0中)
== 23222 == by 0x62BE1F1:lh_insert(在/lib/x86_64-linux-gnu/libcrypto.so.1.0.0中)
== 23222 == by 0x62C0828:??? (在/lib/x86_64-linux-gnu/libcrypto.so.1.0.0中)
== 23222 == by 0x62C0243:??? (在/lib/x86_64-linux-gnu/libcrypto.so.1.0.0中)
== 23222 == by 0x5FCB01D:ERR_load_SSL_strings(在/lib/x86_64-linux-gnu/libssl.so.1.0.0中)
== 23222 == by 0x5083623:_mongoc_ssl_init(在/usr/local/lib/libmongoc-1.0.so.0.0.0中)
== 23222 == by 0x5077028:_mongoc_do_init(在/usr/local/lib/libmongoc-1.0.so.0.0.0中)
== 23222 == by 0x529A3FF:pthread_once(pthread_once.S:104)
== 23222 == by 0x400F305:call_init.part.0(dl-init.c:85)
== 23222 == by 0x400F3DE:call_init(dl-init.c:52)
== 23222 == by 0x400F3DE:_dl_init(dl-init.c:134)
== 23222 == by 0x40016E9:??? (在/lib/x86_64-linux-gnu/ld-2.15.so中)
== 23222 ==泄漏摘要:
== 23222 ==仍然可以访问:3,075个块中的91,832个字节
当我评论这两个函数mongoc_init()和mongoc_cleanup()时,valgrind告诉我所有堆块都被释放了。
任何想法?
谢谢。
I have a class to do mongodb operation using mongodb-c-driver. In the constructor, mongoc_init() is called. In deconstructor, mongoc_cleanup() is called. Then, valgrind 3.10.1 told me that some memory "still reachable". Part of the valgrind output is following:
==23222== 16,384 bytes in 1 blocks are still reachable in loss record 586 of 586
==23222== at 0x4C2D199: realloc (vg_replace_malloc.c:692)
==23222== by 0x6243894: CRYPTO_realloc (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==23222== by 0x62BE1F1: lh_insert (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==23222== by 0x62C0828: ??? (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==23222== by 0x62C0243: ??? (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==23222== by 0x5FCB01D: ERR_load_SSL_strings (in /lib/x86_64-linux-gnu/libssl.so.1.0.0)
==23222== by 0x5083623: _mongoc_ssl_init (in /usr/local/lib/libmongoc-1.0.so.0.0.0)
==23222== by 0x5077028: _mongoc_do_init (in /usr/local/lib/libmongoc-1.0.so.0.0.0)
==23222== by 0x529A3FF: pthread_once (pthread_once.S:104)
==23222== by 0x400F305: call_init.part.0 (dl-init.c:85)
==23222== by 0x400F3DE: call_init (dl-init.c:52)
==23222== by 0x400F3DE: _dl_init (dl-init.c:134)
==23222== by 0x40016E9: ??? (in /lib/x86_64-linux-gnu/ld-2.15.so)
==23222== LEAK SUMMARY:
==23222== still reachable: 91,832 bytes in 3,075 blocks
When I commented these two functions, mongoc_init() and mongoc_cleanup(), valgrind told me that All heap blocks were freed.
Any idea?
Thanks.
最满意答案
这似乎是mongodb-c-driver的问题。 其他人在mongodb c驱动项目下报告了同样的问题。 https://jira.mongodb.org/browse/CDRIVER-478
It seems that it is the problem of the mongodb-c-driver. Others reported the same issue under mongodb c driver project. https://jira.mongodb.org/browse/CDRIVER-478
发布评论