Very critical: Memory leak in freeradius-1.1.6

nikitha george nikitha.george at gmail.com
Wed May 23 15:32:01 CEST 2007


On 5/23/07, nikitha george <nikitha.george at gmail.com> wrote:
>
> Please find the valgrind output below. It shows so much memory is still
> reachable.
> I guess we are not cleaning up the all the expired cached session at
> regular interval.
>
>
> ==21844== 7,456 bytes in 29 blocks are still reachable in loss record 33
> of 44
> ==21844==    at 0x48054FB: realloc (vg_replace_malloc.c:306)
> ==21844==    by 0x351D54: (within /lib/libcrypto.so.0.9.8b)
> ==21844==    by 0x352486: CRYPTO_realloc (in /lib/libcrypto.so.0.9.8b)
> ==21844==    by 0x3A4776: lh_insert (in /lib/libcrypto.so.0.9.8b)
> ==21844==    by 0x355527: OBJ_NAME_add (in /lib/libcrypto.so.0.9.8b)
> ==21844==    by 0x3AC41C: EVP_add_digest (in /lib/libcrypto.so.0.9.8b)
> ==21844==    by 0x486EF91: SSL_library_init (in /lib/libssl.so.0.9.8b)
> ==21844==    by 0x4BAAE03: eaptls_attach (rlm_eap_tls.c:287)
> ==21844==    by 0x4B95230: eaptype_load (eap.c:122)
> ==21844==    by 0x4B93D1B: eap_instantiate (rlm_eap.c:145)
> ==21844==    by 0xCCBE: find_module_instance (modules.c:358)
> ==21844==    by 0xDCBD: do_compile_modsingle (modcall.c:1005)
> ==21844==
> ==21844==
> ==21844== 10,692 bytes in 33 blocks are still reachable in loss record 34
> of 44
> ==21844==    at 0x4805400: malloc (vg_replace_malloc.c:149)
> ==21844==    by 0x4830106: pairmake (valuepair.c:1049)
> ==21844==    by 0x4830A58: pairread (valuepair.c:1244)
> ==21844==    by 0x4830C15: userparse (valuepair.c:1296)
> ==21844==    by 0x9BAB: pairlist_read (files.c:200)
> ==21844==    by 0x4BBB5FF: preprocess_instantiate (rlm_preprocess.c:493)
> ==21844==    by 0xCCBE: find_module_instance (modules.c:358)
> ==21844==    by 0xDCBD: do_compile_modsingle (modcall.c:1005)
> ==21844==    by 0xD34C: setup_modules (modules.c:580)
> ==21844==    by 0x10A35: main (radiusd.c:965)
> ==21844==
> ==21844==
> ==21844== 13,325 bytes in 21 blocks are still reachable in loss record 35
> of 44
> ==21844==    at 0x480473F: calloc (vg_replace_malloc.c:279)
> ==21844==    by 0x4FE8F57A: _dl_new_object (in /lib/ld-2.5.so)
> ==21844==    by 0x4FE8B0E0: _dl_map_object_from_fd (in /lib/ld-2.5.so)
> ==21844==    by 0x4FE8D403: _dl_map_object (in /lib/ld-2.5.so)
> ==21844==    by 0x4FE96668: dl_open_worker (in /lib/ld-2.5.so)
> ==21844==    by 0x4FE92C05: _dl_catch_error (in /lib/ld-2.5.so)
> ==21844==    by 0x4FE96191: _dl_open (in /lib/ld-2.5.so)
> ==21844==    by 0x419BCD0C: dlopen_doit (in /lib/libdl-2.5.so)
> ==21844==    by 0x4FE92C05: _dl_catch_error (in /lib/ld-2.5.so)
> ==21844==    by 0x419BD38B: _dlerror_run (in /lib/libdl-2.5.so)
> ==21844==    by 0x419BCC43: dlopen@@GLIBC_2.1 (in /lib/libdl-2.5.so)
> ==21844==    by 0x48392A9: sys_dl_open (ltdl.c:958)
> ==21844==
> ==21844==
> ==21844== 15,808 bytes in 670 blocks are still reachable in loss record 36
> of 44
> ==21844==    at 0x4805400: malloc (vg_replace_malloc.c:149)
> ==21844==    by 0x418C001F: strdup (in /lib/libc-2.5.so)
> ==21844==    by 0x79D7: cf_section_read (conffile.c:207)
> ==21844==    by 0x8094: conf_read (conffile.c:917)
> ==21844==    by 0xB55D: read_radius_conf_file (mainconfig.c:1264)
> ==21844==    by 0xB6A5: read_mainconfig (mainconfig.c:1309)
> ==21844==    by 0x109F2: main (radiusd.c:941)
> ==21844==
> ==21844==
> ==21844== 26,768 bytes in 336 blocks are still reachable in loss record 37
> of 44
> ==21844==    at 0x4805400: malloc (vg_replace_malloc.c:149)
> ==21844==    by 0x4B944E1: eap_compose (eap.c:395)
> ==21844==    by 0x4B93AC8: eap_authenticate (rlm_eap.c:341)
> ==21844==    by 0xE3C7: modcall (modcall.c:236)
> ==21844==    by 0xEA6B: call_one (modcall.c:269)
> ==21844==    by 0xE5B9: modcall (modcall.c:324)
> ==21844==    by 0xC63D: indexed_modcall (modules.c:469)
> ==21844==    by 0x5213: rad_check_password (auth.c:380)
> ==21844==    by 0x579A: rad_authenticate (auth.c:675)
> ==21844==    by 0xFC66: rad_respond (radiusd.c:1675)
> ==21844==    by 0x116B1: main (radiusd.c:1440)
> ==21844==
> ==21844==
> ==21844== 49,152 bytes in 4 blocks are still reachable in loss record 38
> of 44
> ==21844==    at 0x4805400: malloc (vg_replace_malloc.c:149)
> ==21844==    by 0x4825B3F: lrad_hash_table_insert (hash.c:375)
> ==21844==    by 0x4822AAF: dict_addattr (dict.c:478)
> ==21844==    by 0x482316B: my_dict_init (dict.c:744)
> ==21844==    by 0x4822F71: my_dict_init (dict.c:1050)
> ==21844==    by 0x4822F71: my_dict_init (dict.c:1050)
> ==21844==    by 0x4823DC5: dict_init (dict.c:1258)
> ==21844==    by 0xB5AF: read_radius_conf_file (mainconfig.c:1276)
> ==21844==    by 0xB6A5: read_mainconfig (mainconfig.c:1309)
> ==21844==    by 0x109F2: main (radiusd.c:941)
> ==21844==
> ==21844==
> ==21844== 64,892 bytes in 1,704 blocks are still reachable in loss record
> 39 of 44
> ==21844==    at 0x4805400: malloc (vg_replace_malloc.c:149)
> ==21844==    by 0x153DC: rad_malloc (util.c:308)
> ==21844==    by 0x79AE: cf_section_read (conffile.c:203)
> ==21844==    by 0x8094: conf_read (conffile.c:917)
> ==21844==    by 0xB55D: read_radius_conf_file (mainconfig.c:1264)
> ==21844==    by 0xB6A5: read_mainconfig (mainconfig.c:1309)
> ==21844==    by 0x109F2: main (radiusd.c:941)
> ==21844==
> ==21844==
> ==21844== 136,877 bytes in 5,331 blocks are still reachable in loss record
> 40 of 44
> ==21844==    at 0x4805400: malloc (vg_replace_malloc.c:149)
> ==21844==    by 0x4822662: dict_addvalue (dict.c:542)
> ==21844==    by 0x482322E: my_dict_init (dict.c:783)
> ==21844==    by 0x4822F71: my_dict_init (dict.c:1050)
> ==21844==    by 0x4822F71: my_dict_init (dict.c:1050)
> ==21844==    by 0x4823DC5: dict_init (dict.c:1258)
> ==21844==    by 0xB5AF: read_radius_conf_file (mainconfig.c:1276)
> ==21844==    by 0xB6A5: read_mainconfig (mainconfig.c:1309)
> ==21844==    by 0x109F2: main (radiusd.c:941)
> ==21844==
> ==21844==
> ==21844== 200,340 bytes in 3,339 blocks are still reachable in loss record
> 41 of 44
> ==21844==    at 0x4805400: malloc (vg_replace_malloc.c:149)
> ==21844==    by 0x4822A43: dict_addattr (dict.c:463)
> ==21844==    by 0x482316B: my_dict_init (dict.c:744)
> ==21844==    by 0x4822F71: my_dict_init (dict.c:1050)
> ==21844==    by 0x4822F71: my_dict_init (dict.c:1050)
> ==21844==    by 0x4823DC5: dict_init (dict.c:1258)
> ==21844==    by 0xB5AF: read_radius_conf_file (mainconfig.c:1276)
> ==21844==    by 0xB6A5: read_mainconfig (mainconfig.c:1309)
> ==21844==    by 0x109F2: main (radiusd.c:941)
> ==21844==
> ==21844==
> ==21844== 276,096 bytes in 17,256 blocks are still reachable in loss
> record 42 of 44
> ==21844==    at 0x4805400: malloc (vg_replace_malloc.c:149)
> ==21844==    by 0x4825A61: lrad_hash_table_insert (hash.c:417)
> ==21844==    by 0x4822AAF: dict_addattr (dict.c:478)
> ==21844==    by 0x482316B: my_dict_init (dict.c:744)
> ==21844==    by 0x4822F71: my_dict_init (dict.c:1050)
> ==21844==    by 0x4822F71: my_dict_init (dict.c:1050)
> ==21844==    by 0x4823DC5: dict_init (dict.c:1258)
> ==21844==    by 0xB5AF: read_radius_conf_file (mainconfig.c:1276)
> ==21844==    by 0xB6A5: read_mainconfig (mainconfig.c:1309)
> ==21844==    by 0x109F2: main (radiusd.c:941)
> ==21844==
> ==21844==
> ==21844== 1,569,535 bytes in 3,525 blocks are still reachable in loss
> record 43 of 44
> ==21844==    at 0x4805400: malloc (vg_replace_malloc.c:149)
> ==21844==    by 0x351D1D: (within /lib/libcrypto.so.0.9.8b)
> ==21844==    by 0x35239E: CRYPTO_malloc (in /lib/libcrypto.so.0.9.8b)
> ==21844==    by 0x3A4867: lh_new (in /lib/libcrypto.so.0.9.8b)
> ==21844==    by 0x35548A: OBJ_NAME_init (in /lib/libcrypto.so.0.9.8b)
> ==21844==    by 0x355564: OBJ_NAME_add (in /lib/libcrypto.so.0.9.8b)
> ==21844==    by 0x3AC4D7: EVP_add_cipher (in /lib/libcrypto.so.0.9.8b)
> ==21844==    by 0x486EE95: SSL_library_init (in /lib/libssl.so.0.9.8b)
> ==21844==    by 0x4BAAE03: eaptls_attach (rlm_eap_tls.c:287)
> ==21844==    by 0x4B95230: eaptype_load (eap.c:122)
> ==21844==    by 0x4B93D1B: eap_instantiate (rlm_eap.c:145)
> ==21844==    by 0xCCBE: find_module_instance (modules.c:358)
> ==21844==
> ==21844==
> ==21844== 3,557,736 bytes in 54 blocks are still reachable in loss record
> 44 of 44
> ==21844==    at 0x4805400: malloc (vg_replace_malloc.c:149)
> ==21844==    by 0x4B9D4EC: eaptls_new_session (tls.c:49)
> ==21844==    by 0x4BAA7A3: eaptls_initiate (rlm_eap_tls.c:594)
> ==21844==    by 0x4B94C51: eaptype_call (eap.c:150)
> ==21844==    by 0x4B94F1E: eaptype_select (eap.c:260)
> ==21844==    by 0x4B9391E: eap_authenticate (rlm_eap.c:261)
> ==21844==    by 0xE3C7: modcall (modcall.c:236)
> ==21844==    by 0xEA6B: call_one (modcall.c:269)
> ==21844==    by 0xE5B9: modcall (modcall.c:324)
> ==21844==    by 0xC63D: indexed_modcall (modules.c:469)
> ==21844==    by 0x5213: rad_check_password (auth.c:380)
> ==21844==    by 0x579A: rad_authenticate (auth.c:675)
> ==21844==
> ==21844== LEAK SUMMARY:
> ==21844==    definitely lost: 289 bytes in 20 blocks.
> ==21844==      possibly lost: 0 bytes in 0 blocks.
> ==21844==    still reachable: 5,960,026 bytes in 33,842 blocks.
> ==21844==         suppressed: 0 bytes in 0 blocks.
>
> Please let me know if you could get any fix for this..
>
> Thanks a lot for any help,
> -- Nikitha
>
>
>
>
>
>
> On 5/21/07, nikitha george <nikitha.george at gmail.com> wrote:
> >
> > OS: GNU/Linux-2.6.18-1.2798.fc6
> >
> > machine : i686
> > hardware-platform: i386
> > gcc -- 4.1.1
> > glib -- 2.12.13
> >
> > Number of requests per second:
> > I am trying to connect 16 clients at the roaming rate of 1 second. The
> > average
> > time per request complete is (250ms) so atmost 4 requests per second.
> > Once the roaming
> > is started none of the requests are getting completed. During this
> > condition
> > the memory usage increase rapidly at the rate of 5 to 10MB till 160MB.
> >
> > radiusd.conf file: default one comes with freeradius-1.1.6
> >
> >
> >
> > ...
>
> [Message clipped]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20070523/fd8787c1/attachment.html>


More information about the Freeradius-Users mailing list