RT RT/krbdev.mit.edu: Ticket #2872 memory leak in dns code Signed in as guest.
[Logout]

[Home] [Search] [Configuration]

[Display] [History] [Basics] [Dates] [People] [Links] [Jumbo]

 
 

 The Basics  
Id
2872
Status
resolved
Worked
0 min
Priority
0/0
Queue
krb5
 

 Keyword Selections  
Component
  • krb5-libs
Tags
Version_reported
  • 1.4
Version_Fixed
  • 1.4
Target_Version
  • 1.4
 

 Relationships  
Depends on:
Depended on by:
Parents:
Children:

Refers to:
Referred to by:
 
 Dates  
Created: Tue Jan 11 20:59:22 2005
Starts: Not set
Started: Wed Jan 12 12:18:31 2005
Last Contact: Fri Jan 14 19:10:59 2005
Due: Not set
Updated: Wed Dec 16 18:02:44 2015 by tlyu
 

 People  
Owner
 tlyu
Requestors
 raeburn@mit.edu
Cc
 
AdminCc
 
 

 More about Ken Raeburn  
Comments about this user:
No comment entered about this user
This user's 25 highest priority tickets:
 

History   Display mode: [Brief headers] [Full headers]
      Tue Jan 11 20:59:23 2005  raeburn - Ticket created    
     
To: krb5-bugs@mit.edu
From: Ken Raeburn <raeburn@mit.edu>
Date: Tue, 11 Jan 2005 20:58:40 -0500
Subject: memory leak in dns code

I set up a series of realm R1.MIT.EDU .. R4.MIT.EDU with cross-realm
keys, got a ticket as principal x@R1, and ran "kvno
service2@R4.MIT.EDU" with the current 1.4 branch sources, under
valgrind on x86-linux.  So intermediate TGTs were needed for R1->R2,
R2->R3,
R3->R4.

Aside from the leaks related in ticket 2541, this one showed up.  Some
experimentation with different service principal realms and different
sets of existing tickets indicates that the number of leaked blocks
varies, presumably with the number of KDC requests.

==30513== 280 bytes in 10 blocks are definitely lost in loss record 7 of 7
==30513==    at 0x1B903D38: malloc (vg_replace_malloc.c:131)
==30513==    by 0x1B9D118B: __libc_res_nsend (in /lib/libresolv-2.3.2.so)
==30513==    by 0x1B9CFE19: __libc_res_nquery (in /lib/libresolv-2.3.2.so)
==30513==    by 0x1B9D056A: __libc_res_nquerydomain (in /lib/libresolv-2.3.2.so)
==30513==    by 0x1B9D0131: __libc_res_nsearch (in /lib/libresolv-2.3.2.so)
==30513==    by 0x1B9D0479: __res_nsearch (in /lib/libresolv-2.3.2.so)
==30513==    by 0x1B9787EC: krb5int_dns_init (dnsglue.c:106)
==30513==    by 0x1B978C34: krb5int_make_srv_query_realm (dnssrv.c:106)
==30513==    by 0x1B97BAB1: krb5_locate_srv_dns_1 (locate_kdc.c:518)
==30513==    by 0x1B97BC45: krb5int_locate_server (locate_kdc.c:595)

At first glance, I think it may be a glibc bug.  There is a res_nclose
routine that we aren't calling, but I don't think it'll fix this.

Ken


Download (untitled) 1.4k
      Wed Jan 12 12:18:31 2005  tlyu - Status changed from new to open    
      Wed Jan 12 12:18:32 2005  tlyu - Given to tlyu    
      Wed Jan 12 12:18:32 2005  tlyu - Correspondence added    
     
From: tlyu@mit.edu
Subject: CVS Commit

Fix some potential resource leaks in dnsglue.c.


To generate a diff of this commit:



	cvs diff -r5.483 -r5.484 krb5/src/ChangeLog
	cvs diff -r1.309 -r1.310 krb5/src/aclocal.m4
	cvs diff -r5.416 -r5.417 krb5/src/lib/krb5/os/ChangeLog
	cvs diff -r5.3 -r5.4 krb5/src/lib/krb5/os/dnsglue.c


Download (untitled) 289b
      Wed Jan 12 16:20:41 2005  tlyu - Component krb5-libs added    
      Wed Jan 12 16:20:42 2005  tlyu - Target_Version 1.4 added    
      Thu Jan 13 16:55:16 2005  tlyu - Status changed from open to resolved    
      Thu Jan 13 16:55:17 2005  tlyu - Version_Fixed 1.4 added    
      Thu Jan 13 16:55:17 2005  tlyu - Correspondence added    
     
From: tlyu@mit.edu
Subject: CVS Commit

pullup from trunk


To generate a diff of this commit:



	cvs diff -r1.275 -r1.275.4.1 krb5/src/lib/gssapi/krb5/ChangeLog
	cvs diff -r1.40 -r1.40.4.1 krb5/src/lib/gssapi/krb5/acquire_cred.c
	cvs diff -r1.84 -r1.84.4.1
		krb5/src/lib/gssapi/krb5/init_sec_context.c


Download (untitled) 265b
      Thu Jan 13 16:58:08 2005  tlyu - Status changed from resolved to open    
      Thu Jan 13 16:58:09 2005  tlyu - Comments added    
     
[tlyu - Thu Jan 13 16:55:17 2005]:

> pullup from trunk
>
>
> To generate a diff of this commit:
>
>
>
> 	cvs diff -r1.275 -r1.275.4.1 krb5/src/lib/gssapi/krb5/ChangeLog
> 	cvs diff -r1.40 -r1.40.4.1 krb5/src/lib/gssapi/krb5/acquire_cred.c
> 	cvs diff -r1.84 -r1.84.4.1
> 		krb5/src/lib/gssapi/krb5/init_sec_context.c

previous commit should have gone to [2875].  copied there.


Download (untitled) 383b
      Thu Jan 13 16:58:30 2005  tlyu - Keyword 1.4 deleted    
      Fri Jan 14 18:31:51 2005  tlyu - Comments added    
     
So we've got one leak in res_nsend() in Linux, and a different one in
res_ninit() in Solaris libresolv.  res_ndestroy() in the BIND sources
looks like it does the right things with resources allocated by
res_ninit(), but neither Solaris nor Linux exports it.  All of these are
reasonably considered OS bugs, so what we have now (call res_ndestroy()
if we can find it) is probably the best we'll get unless we do
thread-specific caching, or caching in krb5_context, or mutex around
calls to the non-thread-safe resolver APIs.


Download (untitled) 524b
      Fri Jan 14 18:33:52 2005  tlyu - Version_reported 1.4 added    
      Fri Jan 14 18:33:52 2005  tlyu - Tags pullup added    
      Fri Jan 14 18:54:43 2005  tlyu - Comments added    
     
To: rt-comment@krbdev.mit.edu
Subject: Re: [krbdev.mit.edu #2872] memory leak in dns code
From: Tom Yu <tlyu@mit.edu>
Date: Fri, 14 Jan 2005 18:54:39 -0500
RT-Send-Cc: 

This leak appears to be known, at least for glibc.

http://sources.redhat.com/bugzilla/show_bug.cgi?id=462


Download (untitled) 107b
      Fri Jan 14 19:10:57 2005  tlyu - Status changed from open to resolved    
      Fri Jan 14 19:10:57 2005  tlyu - Version_Fixed 1.4 added    
      Fri Jan 14 19:10:58 2005  tlyu - Correspondence added    
     
From: tlyu@mit.edu
Subject: CVS Commit

pullup from trunk


To generate a diff of this commit:



	cvs diff -r5.479.4.4 -r5.479.4.5 krb5/src/ChangeLog
	cvs diff -r1.308.4.1 -r1.308.4.2 krb5/src/aclocal.m4
	cvs diff -r5.412.2.4 -r5.412.2.5 krb5/src/lib/krb5/os/ChangeLog
	cvs diff -r5.3 -r5.3.2.1 krb5/src/lib/krb5/os/dnsglue.c


Download (untitled) 287b
      Wed Dec 16 18:02:44 2015  tlyu - Keyword pullup deleted