Bug 1510247 - make libcurl use the new PK11_CreateManagedGenericObject() function with nss-3.34 and newer
Summary: make libcurl use the new PK11_CreateManagedGenericObject() function with nss-...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: curl
Version: 7.3
Hardware: All
OS: All
high
high
Target Milestone: rc
: ---
Assignee: Kamil Dudka
QA Contact: BaseOS QE Security Team
Mirek Jahoda
URL:
Whiteboard:
Depends On: rhel7-libcurl-unbounded-mem-issue 1610998
Blocks: 1549617 1549689 1057388 1551061
TreeView+ depends on / blocked
 
Reported: 2017-11-07 01:44 UTC by Bob Relyea
Modified: 2018-10-30 10:42 UTC (History)
28 users (show)

Fixed In Version: curl-7.29.0-51.el7
Doc Type: Known Issue
Doc Text:
Memory consumption of applications using _libcurl_ grows with each TLS connection The *Network Security Services* (NSS) `PK11_DestroyGenericObject()` function does not release resources allocated by `PK11_CreateGenericObject()` early enough. Consequently, the memory allocated by applications using the _libcurl_ package can grow with each TLS connection. To work around this problem: * Re-use existing TLS connections where possible or * Use certificates and keys from the *NSS* database instead of loading them from files directly using _libcurl_
Clone Of: rhel7-libcurl-unbounded-mem-issue
Environment:
Last Closed: 2018-10-30 10:40:37 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3157 None None None 2018-10-30 10:42:09 UTC
Mozilla Foundation 1202413 None None None 2019-01-28 10:55:09 UTC

Comment 5 Bob Relyea 2017-11-07 16:01:22 UTC
Nikos, i Bellerive you are right. I was going to ask about that in the meeting today.

Comment 8 Kamil Dudka 2017-12-01 13:20:44 UTC
Which version of upstream NSS introduced PK11_CreateManagedGenericObject()?

Is it mentioned in the release notes somewhere?

I am not able find anything about it...

Comment 9 Kai Engert (:kaie) (inactive account) 2017-12-01 14:45:07 UTC
In NSS 3.34, see the definitions in this file:
  https://hg.mozilla.org/projects/nss/file/tip/lib/nss/nss.def

We failed to document the new functions properly in the 3.34 release notes :(

Comment 10 Kamil Dudka 2017-12-01 15:02:09 UTC
I can see it in the system header files on my Fedora Rawhide VM but wanted some official statement to justify the related autoconf check for the presence of this function in the upcoming pull-request for curl upstream.

Comment 12 Kamil Dudka 2018-02-08 13:06:39 UTC
I have created a pull request upstream:

https://github.com/curl/curl/pull/2297

Comment 13 Kamil Dudka 2018-02-15 09:21:01 UTC
upstream commit:

https://github.com/curl/curl/commit/1605d93a

Comment 14 Kamil Dudka 2018-02-15 11:43:10 UTC
fixed in curl-7.53.1-15.fc26

Comment 23 Pablo Greco 2018-07-22 17:27:54 UTC
if valgrind reports leaks using this test

#include <curl/curl.h>
int main(int argc, char *argv[])
{
    curl_global_init(CURL_GLOBAL_SSL);
    curl_global_cleanup();
}
is the same bug as this one? Or should I file a new one?

Comment 24 Kamil Dudka 2018-07-23 08:35:30 UTC
It is definitely not related to this bug because the above example does not utilize nor PK11_CreateGenericObject() neither PK11_CreateManagedGenericObject().

On the other hand, it is most likely not a bug.  What exactly does valgrind report?

I get the following summary for your example:

   definitely lost: 0 bytes in 0 blocks
   indirectly lost: 0 bytes in 0 blocks
     possibly lost: 0 bytes in 0 blocks
   still reachable: 6,453 bytes in 64 blocks
        suppressed: 0 bytes in 0 blocks

... which does not suggest there is a real-world memory leak.

Comment 25 Pablo Greco 2018-07-23 10:42:37 UTC
Kamil, I agree that this leak does not progress (since curl_global_init should only be called once), and not exactly high priority, but still it would be great if this could be fixed.
Here is how I test it, and compare against latest curl from Fedora:

f29
# rpm -q libcurl-devel
libcurl-devel-7.61.0-2.fc29.x86_64
# valgrind --leak-check=full --show-leak-kinds=all ./a
==1074== Memcheck, a memory error detector
==1074== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1074== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==1074== Command: ./a
==1074== 
==1074== 
==1074== HEAP SUMMARY:
==1074==     in use at exit: 0 bytes in 0 blocks
==1074==   total heap usage: 3,444 allocs, 3,444 frees, 127,522 bytes allocated
==1074== 
==1074== All heap blocks were freed -- no leaks are possible
==1074== 
==1074== For counts of detected and suppressed errors, rerun with: -v
==1074== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

el7
# rpm -q libcurl-devel
libcurl-devel-7.29.0-46.el7.x86_64
$  valgrind --leak-check=full --show-leak-kinds=all ./a
==4847== Memcheck, a memory error detector
==4847== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==4847== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==4847== Command: ./a
==4847== 
==4847== 
==4847== HEAP SUMMARY:
==4847==     in use at exit: 6,453 bytes in 64 blocks
==4847==   total heap usage: 73 allocs, 9 frees, 8,619 bytes allocated
==4847== 
==4847== 3 bytes in 1 blocks are still reachable in loss record 1 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x512B809: strdup (in /usr/lib64/libc-2.17.so)
==4847==    by 0x66B6D54: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1249: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 3 bytes in 1 blocks are still reachable in loss record 2 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x512B809: strdup (in /usr/lib64/libc-2.17.so)
==4847==    by 0x66B6D54: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C12BB: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 4 bytes in 1 blocks are still reachable in loss record 3 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x512B809: strdup (in /usr/lib64/libc-2.17.so)
==4847==    by 0x66B6D54: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C125C: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 4 bytes in 1 blocks are still reachable in loss record 4 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x512B809: strdup (in /usr/lib64/libc-2.17.so)
==4847==    by 0x66B6D54: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C12CE: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 5 bytes in 1 blocks are still reachable in loss record 5 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x512B809: strdup (in /usr/lib64/libc-2.17.so)
==4847==    by 0x66B6D54: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1236: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 5 bytes in 1 blocks are still reachable in loss record 6 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x512B809: strdup (in /usr/lib64/libc-2.17.so)
==4847==    by 0x66B6D54: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1282: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 5 bytes in 1 blocks are still reachable in loss record 7 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x512B809: strdup (in /usr/lib64/libc-2.17.so)
==4847==    by 0x66B6D54: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C12E1: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 6 bytes in 1 blocks are still reachable in loss record 8 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x512B809: strdup (in /usr/lib64/libc-2.17.so)
==4847==    by 0x66B6D54: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1223: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 6 bytes in 1 blocks are still reachable in loss record 9 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x512B809: strdup (in /usr/lib64/libc-2.17.so)
==4847==    by 0x66B6D54: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1295: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 6 bytes in 1 blocks are still reachable in loss record 10 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x66BB667: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1359: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 7 bytes in 1 blocks are still reachable in loss record 11 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x512B809: strdup (in /usr/lib64/libc-2.17.so)
==4847==    by 0x66B6D54: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C126F: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 7 bytes in 1 blocks are still reachable in loss record 12 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x512B809: strdup (in /usr/lib64/libc-2.17.so)
==4847==    by 0x66B6D54: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C12A8: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 24 bytes in 1 blocks are still reachable in loss record 13 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66B6D40: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1223: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 24 bytes in 1 blocks are still reachable in loss record 14 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66B6D40: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1236: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 24 bytes in 1 blocks are still reachable in loss record 15 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66B6D40: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1249: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 24 bytes in 1 blocks are still reachable in loss record 16 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66B6D40: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C125C: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 24 bytes in 1 blocks are still reachable in loss record 17 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66B6D40: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C126F: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 24 bytes in 1 blocks are still reachable in loss record 18 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66B6D40: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1282: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 24 bytes in 1 blocks are still reachable in loss record 19 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66B6D40: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1295: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 24 bytes in 1 blocks are still reachable in loss record 20 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66B6D40: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C12A8: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 24 bytes in 1 blocks are still reachable in loss record 21 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66B6D40: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C12BB: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 24 bytes in 1 blocks are still reachable in loss record 22 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66B6D40: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C12CE: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 24 bytes in 1 blocks are still reachable in loss record 23 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66B6D40: PR_NewLogModule (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C12E1: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 24 bytes in 1 blocks are still reachable in loss record 24 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66B42EE: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C137E: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 24 bytes in 1 blocks are still reachable in loss record 25 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x66C1122: PR_ErrorInstallTable (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1388: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 32 bytes in 1 blocks are still reachable in loss record 26 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x6B0261F: _dlerror_run (in /usr/lib64/libdl-2.17.so)
==4847==    by 0x6B02050: dlopen@@GLIBC_2.2.5 (in /usr/lib64/libdl-2.17.so)
==4847==    by 0x66BC383: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1212: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 40 bytes in 1 blocks are still reachable in loss record 27 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x66B3E9B: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDE66: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDF70: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1344: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 40 bytes in 1 blocks are still reachable in loss record 28 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x66B3E9B: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDE66: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDF8E: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1344: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 40 bytes in 1 blocks are still reachable in loss record 29 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x66B3E9B: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDE66: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDFAC: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1344: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 40 bytes in 1 blocks are still reachable in loss record 30 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66BB651: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1359: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 48 bytes in 1 blocks are still reachable in loss record 31 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x66B3E89: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDE66: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDF70: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1344: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 48 bytes in 1 blocks are still reachable in loss record 32 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x66B3E89: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDE66: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDF8E: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1344: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 48 bytes in 1 blocks are still reachable in loss record 33 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x66B3E89: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDE66: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDFAC: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1344: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 64 bytes in 1 blocks are still reachable in loss record 34 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x66C9E62: PR_NewCondVar (in /usr/lib64/libnspr4.so)
==4847==    by 0x66D05A0: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1333: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 64 bytes in 1 blocks are still reachable in loss record 35 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66BAA26: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C133D: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 64 bytes in 1 blocks are still reachable in loss record 36 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x66C9E62: PR_NewCondVar (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDF47: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1344: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 64 bytes in 1 blocks are still reachable in loss record 37 of 57
==4847==    at 0x4C29C23: malloc (vg_replace_malloc.c:299)
==4847==    by 0x66C9E62: PR_NewCondVar (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C136D: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 38 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66C9DBC: PR_NewLock (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C0AA8: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C130E: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 39 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66C9DBC: PR_NewLock (in /usr/lib64/libnspr4.so)
==4847==    by 0x66B6C69: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1314: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 40 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66C9DBC: PR_NewLock (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C131E: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 41 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66C9DBC: PR_NewLock (in /usr/lib64/libnspr4.so)
==4847==    by 0x66D0591: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1333: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 42 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66C9DBC: PR_NewLock (in /usr/lib64/libnspr4.so)
==4847==    by 0x66BAB68: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C133D: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 43 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66C9DBC: PR_NewLock (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDF38: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1344: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 44 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66C9DBC: PR_NewLock (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDF53: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1344: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 45 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66C9DBC: PR_NewLock (in /usr/lib64/libnspr4.so)
==4847==    by 0x66B4060: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CDF5F: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1344: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 46 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66C9DBC: PR_NewLock (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C2678: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1349: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 47 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66C9DBC: PR_NewLock (in /usr/lib64/libnspr4.so)
==4847==    by 0x66B70C5: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1354: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 48 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66CA259: PR_NewMonitor (in /usr/lib64/libnspr4.so)
==4847==    by 0x66CA348: PR_NewNamedMonitor (in /usr/lib64/libnspr4.so)
==4847==    by 0x66BB70B: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1359: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 49 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66C9DBC: PR_NewLock (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C135E: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 50 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66C9DBC: PR_NewLock (in /usr/lib64/libnspr4.so)
==4847==    by 0x66BE3B8: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1379: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 51 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66C9DBC: PR_NewLock (in /usr/lib64/libnspr4.so)
==4847==    by 0x66BE3C4: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1379: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 52 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66C9DBC: PR_NewLock (in /usr/lib64/libnspr4.so)
==4847==    by 0x66B42D8: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C137E: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 53 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66C9DBC: PR_NewLock (in /usr/lib64/libnspr4.so)
==4847==    by 0x66D1407: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 168 bytes in 1 blocks are still reachable in loss record 54 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66CA259: PR_NewMonitor (in /usr/lib64/libnspr4.so)
==4847==    by 0x66D1413: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 264 bytes in 1 blocks are still reachable in loss record 55 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66BA93D: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C133D: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 1,024 bytes in 1 blocks are still reachable in loss record 56 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66BB232: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C1309: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== 1,344 bytes in 8 blocks are still reachable in loss record 57 of 57
==4847==    at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==4847==    by 0x66CA259: PR_NewMonitor (in /usr/lib64/libnspr4.so)
==4847==    by 0x66BA979: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x66C133D: ??? (in /usr/lib64/libnspr4.so)
==4847==    by 0x4E79934: ??? (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4E611B4: curl_global_init (in /usr/lib64/libcurl.so.4.3.0)
==4847==    by 0x4006E5: main (in /home/pablo/040/a)
==4847== 
==4847== LEAK SUMMARY:
==4847==    definitely lost: 0 bytes in 0 blocks
==4847==    indirectly lost: 0 bytes in 0 blocks
==4847==      possibly lost: 0 bytes in 0 blocks
==4847==    still reachable: 6,453 bytes in 64 blocks
==4847==         suppressed: 0 bytes in 0 blocks
==4847== 
==4847== For counts of detected and suppressed errors, rerun with: -v
==4847== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

I seem to be stealing this bug, should I/we file another one and continue there?

Comment 26 Kamil Dudka 2018-07-23 11:03:27 UTC
Nope.  "still reachable" is not a memory leak.  So there is nothing to report.

The still reachable memory you see at program exit is the global state of NSPR.  If this is your concern, you can call PR_Cleanup() from -lnspr4 before program exit.  The curl tool does it but it cannot be done in a library.

Please refer to the documentation of NSPR:

https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_Cleanup

Comment 27 Kamil Dudka 2018-07-23 11:07:55 UTC
As for the comparison with Fedora, it is not relevant because libcurl in Fedora uses OpenSSL, which implies that it does not use NSPR at all.

Comment 28 Kamil Dudka 2018-08-02 11:07:48 UTC
Bad news.  The fix for this bug causes a severe regression.  See bug #1610998.

Comment 35 errata-xmlrpc 2018-10-30 10:40:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:3157


Note You need to log in before you can comment on or make changes to this bug.