Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 532002

Summary: QMF agent does not shutdown properly
Product: Red Hat Enterprise MRG Reporter: Frantisek Reznicek <freznice>
Component: qpid-qmfAssignee: Ken Giusti <kgiusti>
Status: CLOSED CURRENTRELEASE QA Contact: MRG Quality Engineering <mrgqe-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: DevelopmentCC: esammons, jsarenik, kgiusti, tross
Target Milestone: 1.3   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-22 10:52:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Frantisek Reznicek 2009-10-30 09:00:00 UTC
Description of problem:

The QMF agent (cpp/examples/qmf-agent/qmf-agent) does not shutdown properly,
the bug 489557 is found fixed, but still I can see two bad observations:

alpha] qmf-agent does not shut down at all when got kill -2
  Observed on RHEL 5.4 only

  After the test you will find quite a lot running qmf-agents in 
  memory with following footprint:

  [root@mrg-qe-02 qmf-agent]# gdb
  GNU gdb Fedora (6.8-37.el5)
  Copyright (C) 2008 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "x86_64-redhat-linux-gnu".
  (gdb) attach 14987
  Attaching to process 14987
  Reading symbols from /root/bz/bz489557/qpidc-0.5.752581-30/el5/qpidc-0.5.752581/cpp/examples/qmf-agent/qmf-agent...done.
  Reading symbols from /root/bz/bz489557/qpidc-0.5.752581-30/el5/qpidc-0.5.752581/cpp/src/.libs/libqmfagent.so.0...done.
  Loaded symbols for ../../src/.libs/libqmfagent.so.0
  Reading symbols from /lib64/libgcc_s.so.1...done.
  Loaded symbols for /lib64/libgcc_s.so.1
  Reading symbols from /lib64/libc.so.6...done.
  Loaded symbols for /lib64/libc.so.6
  Reading symbols from /root/bz/bz489557/qpidc-0.5.752581-30/el5/qpidc-0.5.752581/cpp/src/.libs/libqpidclient.so.0...done.
  Loaded symbols for ../../src/.libs/libqpidclient.so.0
  Reading symbols from /usr/lib64/libstdc++.so.6...done.
  Loaded symbols for /usr/lib64/libstdc++.so.6
  Reading symbols from /root/bz/bz489557/qpidc-0.5.752581-30/el5/qpidc-0.5.752581/cpp/src/.libs/libqpidcommon.so.0...done.
  Loaded symbols for ../../src/.libs/libqpidcommon.so.0
  Reading symbols from /lib64/libm.so.6...done.
  Loaded symbols for /lib64/libm.so.6
  Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
  Loaded symbols for /lib64/ld-linux-x86-64.so.2
  Reading symbols from /lib64/libuuid.so.1...done.
  Loaded symbols for /lib64/libuuid.so.1
  Reading symbols from /usr/lib64/libboost_program_options.so.2...done.
  Loaded symbols for /usr/lib64/libboost_program_options.so.2
  Reading symbols from /usr/lib64/libboost_filesystem.so.2...done.
  Loaded symbols for /usr/lib64/libboost_filesystem.so.2
  Reading symbols from /lib64/libdl.so.2...done.
  Loaded symbols for /lib64/libdl.so.2
  Reading symbols from /lib64/librt.so.1...done.
  Loaded symbols for /lib64/librt.so.1
  Reading symbols from /usr/lib64/libsasl2.so.2...done.
  Loaded symbols for /usr/lib64/libsasl2.so.2
  Reading symbols from /lib64/libpthread.so.0...done.
  [Thread debugging using libthread_db enabled]
  [New Thread 0x2ab0a02192a0 (LWP 14987)]
  [New Thread 0x42280940 (LWP 14989)]
  Loaded symbols for /lib64/libpthread.so.0
  Reading symbols from /lib64/libresolv.so.2...done.
  Loaded symbols for /lib64/libresolv.so.2
  Reading symbols from /lib64/libcrypt.so.1...done.
  Loaded symbols for /lib64/libcrypt.so.1
  0x00000032392077e5 in pthread_join () from /lib64/libpthread.so.0
  (gdb) info threads
    2 Thread 0x42280940 (LWP 14989)  0x000000323920d174 in __lll_lock_wait () from /lib64/libpthread.so.0
  * 1 Thread 0x2ab0a02192a0 (LWP 14987)  0x00000032392077e5 in pthread_join () from /lib64/libpthread.so.0
  (gdb) thread apply all bt
  
  Thread 2 (Thread 0x42280940 (LWP 14989)):
  #0  0x000000323920d174 in __lll_lock_wait () from /lib64/libpthread.so.0
  #1  0x0000003239208ae5 in _L_lock_1127 () from /lib64/libpthread.so.0
  #2  0x00000032392089e3 in pthread_mutex_lock () from /lib64/libpthread.so.0
  #3  0x00002ab09f8a09f2 in ~Singleton (this=<value optimized out>) at ./qpid/sys/posix/Mutex.h:116
  #4  0x00000000004024c5 in shutdown () at example.cpp:158
  #5  <signal handler called>
  #6  0x000000323869a0b1 in nanosleep () from /lib64/libc.so.6
  #7  0x0000003238699ed4 in sleep () from /lib64/libc.so.6
  #8  0x00002ab09f8a54c4 in qpid::management::ManagementAgentImpl::ConnectionThread::run (this=0x2ab0a023a218)
      at qpid/agent/ManagementAgentImpl.cpp:845
  #9  0x00002ab09ff2f9ba in runRunnable (p=0x4227f870) at qpid/sys/posix/Thread.cpp:35
  #10 0x00000032392064a7 in start_thread () from /lib64/libpthread.so.0
  #11 0x00000032386d3c2d in clone () from /lib64/libc.so.6
  
  Thread 1 (Thread 0x2ab0a02192a0 (LWP 14987)):
  #0  0x00000032392077e5 in pthread_join () from /lib64/libpthread.so.0
  #1  0x00002ab09ff2fa73 in qpid::sys::Thread::join (this=<value optimized out>) at qpid/sys/posix/Thread.cpp:58
  #2  0x00002ab09f8a29b3 in ~ManagementAgentImpl (this=0x2ab0a021a010) at qpid/agent/ManagementAgentImpl.cpp:98
  #3  0x00002ab09f8a0a2b in ~Singleton (this=<value optimized out>) at qpid/agent/ManagementAgentImpl.cpp:70
  #4  0x00000000004024c5 in shutdown () at example.cpp:158
  #5  <signal handler called>
  #6  0x000000323869a0b1 in nanosleep () from /lib64/libc.so.6
  #7  0x0000003238699ed4 in sleep () from /lib64/libc.so.6
  #8  0x0000000000402feb in CoreClass::doLoop (this=0x7fffd232e370) at example.cpp:105
  #9  0x000000000040340d in main_int (argc=<value optimized out>, argv=<value optimized out>) at example.cpp:189
  #10 0x00000000004036c6 in main (argc=-768417360, argv=0x7fffd232e1b0) at example.cpp:195
  (gdb) quit
  The program is running.  Quit anyway (and detach it)? (y or n) y
  Detaching from program: /root/bz/bz489557/qpidc-0.5.752581-30/el5/qpidc-0.5.752581/cpp/examples/qmf-agent/qmf-agent, process 14987
  [root@mrg-qe-02 qmf-agent]# pstree -ap 14987
  qmf-agent,14987 127.0.0.1 99999
    └─{qmf-agent},14989


beta] qmf-agent aborts when got kill -2
  Observed on both RHEL 4.8 and 5.4

  RHEL5.4 case

  [root@mrg-qe-02 qmf-agent]# cat core.10414.ctxt
  GNU gdb Fedora (6.8-37.el5)
  Copyright (C) 2008 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "x86_64-redhat-linux-gnu"...
  Reading symbols from /root/bz/bz489557/qpidc-0.5.752581-30/el5/qpidc-0.5.752581/cpp/src/.libs/libqmfagent.so.0...done.
  Loaded symbols for ../../src/.libs/libqmfagent.so.0
  Reading symbols from /lib64/libgcc_s.so.1...done.
  Loaded symbols for /lib64/libgcc_s.so.1
  Reading symbols from /lib64/libc.so.6...done.
  Loaded symbols for /lib64/libc.so.6
  Reading symbols from /root/bz/bz489557/qpidc-0.5.752581-30/el5/qpidc-0.5.752581/cpp/src/.libs/libqpidclient.so.0...done.
  Loaded symbols for ../../src/.libs/libqpidclient.so.0
  Reading symbols from /usr/lib64/libstdc++.so.6...done.
  Loaded symbols for /usr/lib64/libstdc++.so.6
  Reading symbols from /root/bz/bz489557/qpidc-0.5.752581-30/el5/qpidc-0.5.752581/cpp/src/.libs/libqpidcommon.so.0...done.
  Loaded symbols for ../../src/.libs/libqpidcommon.so.0
  Reading symbols from /lib64/libm.so.6...done.
  Loaded symbols for /lib64/libm.so.6
  Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
  Loaded symbols for /lib64/ld-linux-x86-64.so.2
  Reading symbols from /lib64/libuuid.so.1...done.
  Loaded symbols for /lib64/libuuid.so.1
  Reading symbols from /usr/lib64/libboost_program_options.so.2...done.
  Loaded symbols for /usr/lib64/libboost_program_options.so.2
  Reading symbols from /usr/lib64/libboost_filesystem.so.2...done.
  Loaded symbols for /usr/lib64/libboost_filesystem.so.2
  Reading symbols from /lib64/libdl.so.2...done.
  Loaded symbols for /lib64/libdl.so.2
  Reading symbols from /lib64/librt.so.1...done.
  Loaded symbols for /lib64/librt.so.1
  Reading symbols from /usr/lib64/libsasl2.so.2...done.
  Loaded symbols for /usr/lib64/libsasl2.so.2
  Reading symbols from /lib64/libpthread.so.0...done.
  Loaded symbols for /lib64/libpthread.so.0
  Reading symbols from /lib64/libresolv.so.2...done.
  Loaded symbols for /lib64/libresolv.so.2
  Reading symbols from /lib64/libcrypt.so.1...done.
  Loaded symbols for /lib64/libcrypt.so.1
  Core was generated by `./qmf-agent 127.0.0.1 99999'.
  Program terminated with signal 6, Aborted.
  [New process 10416]
  [New process 10417]
  [New process 10414]
  #0  0x0000003238630265 in raise () from /lib64/libc.so.6
  (gdb)
  Thread 3 (process 10414):
  #0  0x000000323869a0b1 in nanosleep () from /lib64/libc.so.6
  #1  0x0000003238699ed4 in sleep () from /lib64/libc.so.6
  #2  0x0000000000402feb in CoreClass::doLoop (this=0x7fff5c55ccc0)
      at example.cpp:105
  #3  0x000000000040340d in main_int (argc=<value optimized out>,
      argv=<value optimized out>) at example.cpp:189
  #4  0x00000000004036c6 in main (argc=1549126400, argv=0x7fff5c55cb00)
      at example.cpp:195
  
  Thread 2 (process 10417):
  #0  0x000000323869a0b1 in nanosleep () from /lib64/libc.so.6
  #1  0x0000003238699ed4 in sleep () from /lib64/libc.so.6
  #2  0x00002b93f04fe792 in qpid::management::ManagementAgentImpl::PublishThread::run (this=0x2b93f0e90440) at qpid/agent/ManagementAgentImpl.cpp:924
  #3  0x00002b93f0b859ba in runRunnable (p=0x42818040)
      at qpid/sys/posix/Thread.cpp:35
  #4  0x00000032392064a7 in start_thread () from /lib64/libpthread.so.0
  #5  0x00000032386d3c2d in clone () from /lib64/libc.so.6
  
  Thread 1 (process 10416):
  #0  0x0000003238630265 in raise () from /lib64/libc.so.6
  #1  0x0000003238631d10 in abort () from /lib64/libc.so.6
  #2  0x00000032386296e6 in __assert_fail () from /lib64/libc.so.6
  #3  0x00002b93f0b85aad in qpid::sys::Thread::join (this=<value optimized out>)
      at qpid/sys/posix/Thread.cpp:58
  #4  0x00002b93f04f89b3 in ~ManagementAgentImpl (this=0x2b93f0e70010)
      at qpid/agent/ManagementAgentImpl.cpp:98
  #5  0x00002b93f04f6a2b in ~Singleton (this=<value optimized out>)
      at qpid/agent/ManagementAgentImpl.cpp:70
  #6  0x00000000004024c5 in shutdown () at example.cpp:158
  #7  <signal handler called>
  #8  0x00000032386d3bef in clone () from /lib64/libc.so.6
  #9  0x0000003239206ad5 in pthread_create@@GLIBC_2.2.5 ()
    from /lib64/libpthread.so.0
  #10 0x00002b93f0b85c4a in Thread (this=0x41e16140, runnable=0x173d8408)
      at qpid/sys/posix/Thread.cpp:44
  #11 0x00002b93f078eb6b in qpid::client::TCPConnector::connect (
      this=0x173d83f0, host=@0x173d7ca8, port=<value optimized out>)
      at qpid/client/Connector.cpp:202
  #12 0x00002b93f07869c7 in qpid::client::ConnectionImpl::open (this=0x173d7bb0)
      at qpid/client/ConnectionImpl.cpp:150
  #13 0x00002b93f0777028 in qpid::client::Connection::open (this=0x2b93f0e90240,
      settings=@0xffffffff) at qpid/client/Connection.cpp:122
  #14 0x00002b93f04faef4 in qpid::management::ManagementAgentImpl::ConnectionThread::run (this=0x2b93f0e90218) at qpid/agent/ManagementAgentImpl.cpp:795
  #15 0x00002b93f0b859ba in runRunnable (p=0x3d0f00)
      at qpid/sys/posix/Thread.cpp:35
  #16 0x00000032392064a7 in start_thread () from /lib64/libpthread.so.0
  #17 0x00000032386d3c2d in clone () from /lib64/libc.so.6



  RHEL 4.8 case

  [root@rhel48i qmf-agent]# cat  core.30121.ctxt
  GNU gdb Red Hat Linux (6.3.0.0-1.162.el4rh)
  Copyright 2004 Free Software Foundation, Inc.
  GDB is free software, covered by the GNU General Public License, and you are
  welcome to change it and/or distribute copies of it under certain conditions.
  Type "show copying" to see the conditions.
  There is absolutely no warranty for GDB.  Type "show warranty" for details.
  This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".
  
  Core was generated by `./qmf-agent 127.0.0.1 99999'.
  Program terminated with signal 6, Aborted.
  Reading symbols from /root/bz/bz489557/qpidc-0.5.752581-30/el4/qpidc-0.5.752581/cpp/src/.libs/libqmfagent.so.0...done.
  Loaded symbols for ../../src/.libs/libqmfagent.so.0
  Reading symbols from /lib/libgcc_s.so.1...done.
  Loaded symbols for /lib/libgcc_s.so.1
  Reading symbols from /lib/tls/libc.so.6...done.
  Loaded symbols for /lib/tls/libc.so.6
  Reading symbols from /root/bz/bz489557/qpidc-0.5.752581-30/el4/qpidc-0.5.752581/cpp/src/.libs/libqpidclient.so.0...done.
  Loaded symbols for ../../src/.libs/libqpidclient.so.0
  Reading symbols from /usr/lib/libstdc++.so.6...done.
  Loaded symbols for /usr/lib/libstdc++.so.6
  Reading symbols from /root/bz/bz489557/qpidc-0.5.752581-30/el4/qpidc-0.5.752581/cpp/src/.libs/libqpidcommon.so.0...done.
  Loaded symbols for ../../src/.libs/libqpidcommon.so.0
  Reading symbols from /lib/tls/libm.so.6...done.
  Loaded symbols for /lib/tls/libm.so.6
  Reading symbols from /lib/ld-linux.so.2...done.
  Loaded symbols for /lib/ld-linux.so.2
  Reading symbols from /lib/tls/libuuid.so.1...done.
  Loaded symbols for /lib/tls/libuuid.so.1
  Reading symbols from /usr/lib/libboost_program_options.so.1...done.
  Loaded symbols for /usr/lib/libboost_program_options.so.1
  Reading symbols from /usr/lib/libboost_filesystem.so.1...done.
  Loaded symbols for /usr/lib/libboost_filesystem.so.1
  Reading symbols from /lib/libdl.so.2...done.
  Loaded symbols for /lib/libdl.so.2
  Reading symbols from /lib/tls/librt.so.1...done.
  Loaded symbols for /lib/tls/librt.so.1
  Reading symbols from /lib/tls/libpthread.so.0...done.
  Loaded symbols for /lib/tls/libpthread.so.0
  #0  0x0045b7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
  (gdb)
  Thread 4 (process 30121):
  #0  0x0045b7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
  #1  0x00500be6 in __nanosleep_nocancel () from /lib/tls/libc.so.6
  #2  0x005009ec in sleep () from /lib/tls/libc.so.6
  #3  0x08049eb1 in CoreClass::doLoop (this=0xbff53690) at example.cpp:105
  #4  0x0804a614 in main_int (argc=3, argv=0xbff53824) at example.cpp:189
  #5  0x0804b1d2 in main (argc=3, argv=0xbff53824) at example.cpp:195
  
  Thread 3 (process 30123):
  #0  0x00659434 in start_thread () from /lib/tls/libpthread.so.0
  #1  0x00540f0e in clone () from /lib/tls/libc.so.6
  
  Thread 2 (process 30128):
  #0  0x00659434 in start_thread () from /lib/tls/libpthread.so.0
  #1  0x00540f0e in clone () from /lib/tls/libc.so.6
  
  Thread 1 (process 30124):
  #0  0x0045b7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
  #1  0x0049c825 in raise () from /lib/tls/libc.so.6
  #2  0x0049e289 in abort () from /lib/tls/libc.so.6
  #3  0x00495da1 in __assert_fail () from /lib/tls/libc.so.6
  #4  0x00a92c97 in qpid::sys::Thread::join (this=0xb7f4c270)
      at qpid/sys/posix/Thread.cpp:58
  #5  0x005e3b3a in ~ManagementAgentImpl (this=0xb7f2c008)
      at qpid/agent/ManagementAgentImpl.cpp:99
  #6  0x005e05c9 in ~Singleton (this=0x86fc050)
      at qpid/agent/ManagementAgentImpl.cpp:70
  #7  0x08049d19 in shutdown () at example.cpp:158
  #8  <signal handler called>
  #9  0x0045b7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
  #10 0x0049cc49 in sigprocmask () from /lib/tls/libc.so.6
  #11 0x00500955 in sleep () from /lib/tls/libc.so.6
  #12 0x005e9e2c in qpid::management::ManagementAgentImpl::PublishThread::run (
      this=0xb7f4c264) at qpid/agent/ManagementAgentImpl.cpp:924
  #13 0x00a92beb in qpid::sys::(anonymous namespace)::runRunnable (p=0x0)
      at qpid/sys/posix/Thread.cpp:35
  #14 0x006593cc in start_thread () from /lib/tls/libpthread.so.0
  #15 0x00540f0e in clone () from /lib/tls/libc.so.6



Version-Release number of selected component (if applicable):
qpidc-0.5.752581-30.(src.rpm)

How reproducible:
95% with current reproducer (see below)

Steps to Reproduce:
1. extract src.rpm of qpidc-0.5.752581-30 + apply patches + compile qpid (bootstrap+configure+make)
2. compile qmf-agent
3. put test.sh below to qmf-agent subdir
4. run './test.sh 3' and wait for core files
5. the test ends after 3 cores are found + you should see a lot of running proceses in mem (rhel5 only) - you're there


Actual results:
QMF Agent does not shutdown properly

Expected results:
QMF Agent should shutdown properly

Additional info:

The reproducer:
[root@mrg-qe-02 qmf-agent]# cat test.sh
#!/bin/bash
# run the script after you have compiled qmf-agent './test.sh 3' where
# parameter is the number of core files you want to get

# feel free to tune usleep lines to get reasonable qmf-agent run frequency for
# your machine

ulimit -c unlimited

start_ts=${SECONDS}
cnt=0
export LD_LIBRARY_PATH="../../src/.libs"
while [ "${cnt}" -lt "$1" ]; do

  (./qmf-agent 127.0.0.1 99999) &
  pid=$!

  usleep ${RANDOM}
  # on slow machine
  # usleep $((${RANDOM}*10))

  kill -2 $pid

  cnt=$(ls core.* 2>/dev/null | wc -l)

  usleep $((${RANDOM}*100))
  # on slow machine
  # usleep $((${RANDOM}*200))

  echo -n ${cnt}
done

echo "${cnt} cores, dur:$((${SECONDS}-${start_ts})) secs[s]"

Comment 1 Frantisek Reznicek 2009-10-30 09:03:00 UTC
Feel free to push for 1.3 if needed, but be aware that there is most probably dependency to bug 521138, investigating now...

Comment 2 Frantisek Reznicek 2009-10-30 11:05:37 UTC
One more piece of information to the observation beta]

I got qpid::sys::Thread::join() assertion which might be the source of the aborts (this is coming from rhel4.8 x86_64)
...
2009-oct-29 13:32:30 warning Connection closed
Resource deadlock avoided
qmf-agent: qpid/sys/posix/Thread.cpp:58: void qpid::sys::Thread::join(): Assertion `0' failed.
./test.sh: line 21:  6919 Aborted                 (core dumped) ( ./qmf-agent 127.0.0.1 99999 )
...

Comment 3 Ken Giusti 2009-10-30 13:22:14 UTC
Ha!  Good catch - and I immediately see the problem:

qmf-agent is written incorrectly.   It attempts to do the entire system cleanup from a *signal handler*!   This is not good, as lots of code is run during cleanup, and a good chunk of it is not able to run safely from a signal handler.

I'm 99.44/100% sure this is the problem (but I'll try to fix/test it shortly).

Other than being a bad example for our customers to follow, I don't think that this should be a 1.2 blocking issue.

Opinions?

-K

Comment 4 Ken Giusti 2009-10-30 13:37:39 UTC
Suggested fix submitted upstream:

https://issues.apache.org/jira/browse/QPID-2179

Comment 5 Ken Giusti 2009-10-30 14:22:00 UTC
Frantisek - be aware: After applying a fix, I'm seeing a problem with the test.sh script where it causes many instances of the qmf-agent to be run simultaneously. 

I point this out because, after a while my system exhausts its thread resources and we abort().  This causes a core file.  Note well: this core is not due to the signal bug!   

Running out of pthread resources is NAB.

Just FYI: I'm seeing this output when I run out of threads:


2009-10-30 09:49:58 warning Connection closed
2009-10-30 09:49:58 warning Connecting failed: Connection refused
2009-10-30 09:49:58 warning Connection closed
+ echo -n 2
2+ '[' 2 -lt 3 ']'
+ pid=26411
+ usleep 24210
+ ./qmf-agent 127.0.0.1 99999
+ kill -2 26411
./test.sh: fork: retry: Resource temporarily unavailable   <<<<!!!!
++ ls core.20190 core.26376
Resource temporarily unavailable
qmf-agent: qpid/sys/posix/Thread.cpp:44: qpid::sys::ThreadPrivate::ThreadPrivate(qpid::sys::Runnable*): Assertion `0' failed.
Resource temporarily unavailable
qmf-agent: qpid/sys/posix/Thread.cpp:44: qpid::sys::ThreadPrivate::ThreadPrivate(qpid::sys::Runnable*): Assertion `0' failed.
Resource temporarily unavailable
qmf-agent: qpid/sys/posix/Thread.cpp:44: qpid::sys::ThreadPrivate::ThreadPrivate(qpid::sys::Runnable*): Assertion `0' failed.
2009-10-30 09:49:59 warning Connecting failed: Connection refused
2009-10-30 09:49:59 warning Connection closed
++ wc -l
+ cnt=2
+ usleep 2624800
2009-10-30 09:50:00 warning Connecting failed: Connection refused
2009-10-30 09:50:00 warning Connecting failed: Connection refused
...
2009-10-30 09:50:02 warning Connecting failed: Connection refused
2009-10-30 09:50:02 warning Connection closed
./test.sh: line 32: 19262 Aborted                 (core dumped) ( ./qmf-agent 127.0.0.1 99999 )
./test.sh: line 32: 25331 Aborted                 (core dumped) ( ./qmf-agent 127.0.0.1 99999 )
./test.sh: line 32: 26150 Aborted                 (core dumped) ( ./qmf-agent 127.0.0.1 99999 )


Doing a "ps -ef | grep qmf-agent" shows the test has created thousands of qmf-agents:


kgiusti  16110     1  0 09:27 pts/0    00:00:00 ./qmf-agent 127.0.0.1 99999
kgiusti  16127     1  0 09:27 pts/0    00:00:00 ./qmf-agent 127.0.0.1 99999
kgiusti  16135     1  0 09:27 pts/0    00:00:00 ./qmf-agent 127.0.0.1 99999
kgiusti  16158     1  0 09:27 pts/0    00:00:00 ./qmf-agent 127.0.0.1 99999
kgiusti  16206     1  0 09:27 pts/0    00:00:00 ./qmf-agent 127.0.0.1 99999
kgiusti  16216     1  0 09:27 pts/0    00:00:00 ./qmf-agent 127.0.0.1 99999
kgiusti  16267     1  0 09:27 pts/0    00:00:00 ./qmf-agent 127.0.0.1 99999
kgiusti  16284     1  0 09:27 pts/0    00:00:00 ./qmf-agent 127.0.0.1 99999
kgiusti  16292     1  0 09:27 pts/0    00:00:00 ./qmf-agent 127.0.0.1 99999
kgiusti  16328     1  0 09:27 pts/0    00:00:00 ./qmf-agent 127.0.0.1 99999
kgiusti  16406     1  0 09:27 pts/0    00:00:00 ./qmf-agent 127.0.0.1 99999
kgiusti  16415     1  0 09:27 pts/0    00:00:00 ./qmf-agent 127.0.0.1 99999
.....
..... etc.

-K