[Icecast-dev] icecast/libxml2 leaks memory on FC13

Thomas B. Ruecker dm8tbr at afthd.tu-darmstadt.de
Sat Aug 7 14:27:53 PDT 2010


Hi,

the reporting person has tried also with vanilla icecast source compiled.

The setup is:

Liquidsoap in MP3 mode sending a stream
Winamp pulling the stream
A flash applet requesting a custom XSLT file every 10s

The output of valgrind is:

==13821==
==13821== HEAP SUMMARY:
==13821==     in use at exit: 1,744,928 bytes in 4,194 blocks
==13821==   total heap usage: 41,508 allocs, 37,314 frees, 18,811,774 bytes allo
cated
==13821==
==13821== Searching for pointers to 4,194 not-freed blocks
==13821== Checked 967,224 bytes
==13821==
==13821== 968 bytes in 1 blocks are definitely lost in loss record 240 of 263
==13821==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)
==13821==    by 0x3B08EA4024: xmlGetGlobalState (in /usr/lib64/libxml2.so.2.7.7)
==13821==    by 0x3B08EA3214: __xmlDefaultBufferSize (in /usr/lib64/libxml2.so.2
.7.7)
==13821==    by 0x3B08E520F2: xmlBufferCreate (in /usr/lib64/libxml2.so.2.7.7)
==13821==    by 0x4104D2: stats_event_conv (stats.c:220)
==13821==    by 0x40D3F3: source_update_settings (source.c:1007)
==13821==    by 0x40DB42: source_recheck_mounts (source.c:1384)
==13821==    by 0x40C927: _slave_thread (slave.c:738)
==13821==    by 0x4200FD: _start_routine (thread.c:655)
==13821==    by 0x3B00A07760: start_thread (in /lib64/libpthread-2.12.so)
==13821==    by 0x3B002E14EC: clone (in /lib64/libc-2.12.so)
==13821==
==13821== 830,000 bytes in 830 blocks are definitely lost in loss record 262 of
263
==13821==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)
==13821==    by 0x3B08E2D6DF: xmlEncodeEntitiesReentrant (in /usr/lib64/libxml2.
so.2.7.7)
==13821==    by 0x40FAA9: stats_get_xml (stats.c:970)
==13821==    by 0x40FBB0: stats_transform_xslt (stats.c:939)
==13821==    by 0x419244: add_authenticated_listener (auth.c:422)
==13821==    by 0x41955D: auth_add_listener (auth.c:511)
==13821==    by 0x409D45: _handle_connection (connection.c:1150)
==13821==    by 0x4200FD: _start_routine (thread.c:655)
==13821==    by 0x3B00A07760: start_thread (in /lib64/libpthread-2.12.so)
==13821==    by 0x3B002E14EC: clone (in /lib64/libc-2.12.so)
==13821==
==13821== 830,000 bytes in 830 blocks are definitely lost in loss record 263 of
263
==13821==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)
==13821==    by 0x3B08E2D6DF: xmlEncodeEntitiesReentrant (in /usr/lib64/libxml2.
so.2.7.7)
==13821==    by 0x40FAB9: stats_get_xml (stats.c:971)
==13821==    by 0x40FBB0: stats_transform_xslt (stats.c:939)
==13821==    by 0x419244: add_authenticated_listener (auth.c:422)
==13821==    by 0x41955D: auth_add_listener (auth.c:511)
==13821==    by 0x409D45: _handle_connection (connection.c:1150)
==13821==    by 0x4200FD: _start_routine (thread.c:655)
==13821==    by 0x3B00A07760: start_thread (in /lib64/libpthread-2.12.so)
==13821==    by 0x3B002E14EC: clone (in /lib64/libc-2.12.so)
==13821==
==13821== LEAK SUMMARY:
==13821==    definitely lost: 1,660,968 bytes in 1,661 blocks
==13821==    indirectly lost: 0 bytes in 0 blocks
==13821==      possibly lost: 0 bytes in 0 blocks
==13821==    still reachable: 83,960 bytes in 2,533 blocks
==13821==         suppressed: 0 bytes in 0 blocks
==13821== Reachable blocks (those to which a pointer was found) are not shown.
==13821== To see them, rerun with: --leak-check=full --show-reachable=yes
==13821==
==13821== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 6 from 6)
--13821--
--13821-- used_suppression:      6 dl-hack3-cond-1
==13821==
==13821== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 6 from 6)




The one-time leak of 968 bytes is irrelevant, but there seems to be something leaking rapidly, most likely on each request of the XSLT file.

I tried to reproduce it on an fc13 liveCD but have failed so far. For the user this bug also existed on FC12 on i686.

Is it maybe an libxml2 bug in FC?


Input welcome! Feel free to join jayarjo and me on IRC.

Cheers

Thomas




More information about the Icecast-dev mailing list