Re: [Opalvoip-devel] Memory lake during thread ended on Linux
Brought to you by:
csoutheren,
rjongbloed
From: Yuriy C. <yur...@gm...> - 2008-11-26 10:11:52
|
Hi Derek It is really stupid situation. I spend all night to find this lake and describe why it is happen. But instead of analyzing my description and ask, if you need, addition question to understand it, you say that this bug does not exist because your test tool does not crush with it! Unfortunately this only mean that your test tool is poor. Excuse me for this emotional thoughts, I cannot restrain it. Ad rem. OS: Linux drouter 2.6.25.14-69.fc8 #1 SMP Mon Aug 4 14:20:24 EDT 2008 i686 athlon i386 GNU/Linux PTLIB svn revision: 21628. I use trunk version. You are right if I run: "./threadex -d 1 -a" everything ok. But try to run: "./threadex -d 1 -a -t 5" and you will see appearance of the bug which I describe early. This is my log which I receive to stdout: ... 0:03.527 PExternalT...0xb796ab90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0d8e0 DelayThread:0xb796ab90(id = 0) 0:03.528 LauncherTh...0xb7f41b90 osutil.cxx(190) PWLib File handle high water mark within 5% of maximum: 1023 Thread unblock pipe 0:03.528 PExternalT...0xb79ecb90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f08a98 DelayThread:0xb79ecb90(id = 0) 0:03.529 Housekeeper:0xb7b72b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f096d0 PExternalThread:0xb79ecb90(id = b79ecb90) 0:03.529 PExternalT...0xb7aafb90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0d3c0 DelayThread:0xb7aafb90(id = 0) 0:03.529 Housekeeper:0xb7b72b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f08a98 PExternalThread:0xb7aafb90(id = b7aafb90) 0:03.529 PExternalT...0xb7c76b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0d7c0 DelayThread:0xb7c76b90(id = 0) 0:03.529 Housekeeper:0xb7b72b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f096d0 PExternalThread:0xb7c76b90(id = b7c76b90) 0:03.529 PExternalT...0xb7bf4b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0cda0 DelayThread:0xb7bf4b90(id = 0) 0:03.529 Housekeeper:0xb7b72b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0d3c0 PExternalThread:0xb7bf4b90(id = b7bf4b90) 0:03.529 PExternalT...0xb79abb90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8efde98 DelayThread:0xb79abb90(id = 0) 0:03.529 Housekeeper:0xb7b72b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f096d0 PExternalThread:0xb79abb90(id = b79abb90) 0:03.529 PExternalT...0xb7cf8b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0d8e0 DelayThread:0xb7cf8b90(id = 0) 0:03.530 Housekeeper:0xb7b72b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0d7c0 PExternalThread:0xb7cf8b90(id = b7cf8b90) 0:03.530 PExternalT...0xb7d7ab90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0d6e8 DelayThread:0xb7d7ab90(id = 0) 0:03.530 Housekeeper:0xb7b72b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f096d0 PExternalThread:0xb7d7ab90(id = b7d7ab90) 0:03.530 PExternalT...0xb7f00b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f09a88 DelayThread:0xb7f00b90(id = 0) 0:03.530 Housekeeper:0xb7b72b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0cda0 PExternalThread:0xb7f00b90(id = b7f00b90) 0:03.531 PExternalT...0xb796ab90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0cd00 DelayThread:0xb796ab90(id = 0) 0:03.530 PExternalT...0xb7b31b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0d520 DelayThread:0xb7b31b90(id = 0) 0:03.531 Housekeeper:0xb7b72b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0d8e0 PExternalThread:0xb796ab90(id = b796ab90) 0:03.531 Housekeeper:0xb7b72b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8efde98 PExternalThread:0xb7b31b90(id = b7b31b90) 0:03.531 PExternalT...0xb7af0b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8efdd20 DelayThread:0xb7af0b90(id = 0) 0:03.532 Housekeeper:0xb7b72b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0d7c0 PExternalThread:0xb7af0b90(id = b7af0b90) 0:03.531 PExternalT...0xb78e8b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0baa8 DelayThread:0xb78e8b90(id = 0) 0:03.532 Housekeeper:0xb7b72b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0d6e8 PExternalThread:0xb78e8b90(id = b78e8b90) 0:03.532 PExternalT...0xb7dbbb90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0e120 DelayThread:0xb7dbbb90(id = 0) 0:03.533 LauncherTh...0xb7f41b90 assert.cxx(108) PWLib Assertion fail: Operating System error, file ptlib/unix/tlibthrd.cxx, line 313, Error=24 Assertion fail: Operating System error, file ptlib/unix/tlibthrd.cxx, line 313, Error=24 <A>bort, <C>ore dump? A Command ? X Exiting. 0:13.533 Housekeeper:0xb7b72b90 tlibthrd.cxx(349) PWLib Destroyed thread 0x8f0d520 PExternalThread:0xb7dbbb90(id = b7dbbb90) <A>bort, <C>ore dump? A Aborting. Try to run this commend several times, sometimes I yet received segfault and some other error. Truly yours, Yuriy. > -----Original Message----- > From: Derek Smithies [mailto:de...@in...] > Sent: Wednesday, November 26, 2008 3:17 AM > To: Yuriy Cherniavsky > Cc: opa...@li... > Subject: Re: [Opalvoip-devel] Memory lake during thread ended on Linux > > Hi, > we had a discussion on leaks in threads on linux a while ago. > > To cope with such situations, there is a helper program in > ptlib/samples/threadex > > I need to see evidence that there is a leak. > To do this, I suggest we use the same program. > Please use the threadex program, but do not edit threadex... > > This example application was compiled tested debugged on linux. > > It creates and deletes hundreds of thousands of threads. > > I suggest you use this application to test for thread related leaks. > > I ran it with > > ./threadex -d 1 a > > If the arguement to the d parameter is too high, there will be too many > threads in existance and the file handle limit will cause execution to > abort. > > To watch process size, I had a console running the following script > command: > while true; do ps -eLF | grep threadex | grep -v grep | tail -n 1; > sleep 1 ; done; > > > There was no leak of memory. - After 19437 threads had been launched > and > terminated. > > You may wish to try with your build tree. > ... > > Derek Smithies Ph.D. > IndraNet Technologies Ltd. > Email: de...@in... > ph +64 3 365 6485 > Web: http://www.indranet-technologies.com/ |