【问题标题】:mongoc_init() and mongoc_cleanup() may make memory "still reachable"mongoc_init() 和 mongoc_cleanup() 可能使内存“仍然可以访问”
【发布时间】:2015-02-25 16:41:45
【问题描述】:

我有一个类可以使用 mongodb-c-driver 进行 mongodb 操作。在构造函数中,调用了 mongoc_init()。在解构器中,调用了 mongoc_cleanup()。然后,valgrind 3.10.1 告诉我一些内存“仍然可以访问”。部分 valgrind 输出如下:

==23222== 1 个块中的 16,384 字节在 586 的丢失记录 586 中仍然可以访问

==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== 由 0x62C0828: ??? (在 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 中)

==23222== 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== 由 0x40016E9: ??? (在 /lib/x86_64-linux-gnu/ld-2.15.so 中)

==23222== 泄漏摘要:

==23222== 仍可访问:3,075 个块中的 91,832 个字节

当我评论这两个函数 mongoc_init() 和 mongoc_cleanup() 时,valgrind 告诉我所有堆块都已释放。

有什么想法吗?

谢谢。

【问题讨论】:

    标签: mongodb valgrind mongo-c-driver


    【解决方案1】:

    好像是mongodb-c-driver的问题。 其他人在 mongodb c 驱动程序项目下报告了同样的问题。 https://jira.mongodb.org/browse/CDRIVER-478

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-28
      • 2023-03-29
      • 1970-01-01
      • 1970-01-01
      • 2015-08-03
      • 1970-01-01
      • 2013-07-11
      • 2011-05-23
      相关资源
      最近更新 更多