Bug 470167

Summary: ManagementAgent::Singleton destructor aborts
Product: Red Hat Enterprise MRG Reporter: Matthew Farrellee <matt>
Component: qpid-qmfAssignee: Ted Ross <tross>
Status: CLOSED ERRATA QA Contact: Jeff Needle <jneedle>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 1.0CC: freznice, tross
Target Milestone: 1.1   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-02-04 15:35:51 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:
Bug Depends On:    
Bug Blocks: 469388    

Description Matthew Farrellee 2008-11-06 04:09:56 UTC
Using qpid trunk from svn, r711740.

This issue was originally reported: https://bugzilla.redhat.com/show_bug.cgi?id=469388

The code failing for BZ469388 did not shutdown the ManagementAgent::Singleton before exiting. The new code does shut it down, by delete'ing it, and still the daemon aborts.


Code in condor_master...

ManagementAgent::Singleton *singleton;

void
initialize()
{
...
   singleton = new ManagementAgent::Singleton();
...
}

void
shutdown()
{
   dprintf(D_ALWAYS, "MgmtMasterPlugin shutting down...\n");
   dprintf(D_ALWAYS, "...%p\n", singleton);
   if (singleton) {
      dprintf(D_ALWAYS, "...deleting ManagementAgent\n");
      delete singleton;
      singleton = NULL;
      dprintf(D_ALWAYS, "...deleted ManagementAgent\n");
   }
}

Log showing the master abort instead of shutting down cleanly...

11/5 21:57:03 All daemons are gone.  Exiting.
11/5 21:57:03 MgmtMasterPlugin shutting down...
11/5 21:57:03 ...0x85bc7a8
11/5 21:57:03 ...deleting ManagementAgent
Invalid argument
condor_master: /usr/local/include/qpid/sys/posix/Mutex.h:116: void qpid::sys::Mutex::lock(): Assertion `0' failed.
Stack dump for process 18099 at timestamp 1225943823 (12 frames)
./release_dir/sbin/condor_master(dprintf_dump_stack+0xa6)[0x80f095c]
./release_dir/sbin/condor_master[0x80f0b56]
[0x110400]
/lib/libc.so.6(abort+0x101)[0x52bf91]
/lib/libc.so.6(__assert_fail+0xee)[0x52393e]
/home/matt/Documents/Condor/Installation/libexec/MgmtMasterPlugin-plugin.so(_ZN4qpid3sys5Mutex4lockEv+0x60)[0x25b62c]
/usr/local/lib/libqpidclient.so.0(_ZN4qpid6client10Dispatcher3runEv+0x92c)[0x2d62ac]
/usr/local/lib/libqpidclient.so.0(_ZN4qpid6client19SubscriptionManager3runEv+0x35)[0x308385]
/usr/local/lib/libqmfagent.so.0(_ZN4qpid10management19ManagementAgentImpl16ConnectionThread3runEv+0x7b5)[0x347975]
/usr/local/lib/libqpidcommon.so.0[0xf58bc1]
/lib/libpthread.so.0[0x69350b]
/lib/libc.so.6(clone+0x5e)[0x5d4b2e]
zsh: abort      ./release_dir/sbin/condor_master -t -f

Comment 1 Ted Ross 2008-11-06 18:32:59 UTC
To verify this fix, use the qmf-agent example.  You are looking for a clean shutdown when you ^C the program (no SEGVs or unhandled exceptions).

Run the example with no broker.  Verify shutdown.

Start a broker and run the example.  Verify shutdown.

Run the example on a broker, stop the broker, then verify shutdown.

The shutdown of qmf-agent should be clean in all cases.

Comment 3 Frantisek Reznicek 2008-11-20 08:47:59 UTC
RHTS test qpid_test_qmf_agent_bz470167 validates that this issue has been fixed.
->VERIFIED

Comment 5 errata-xmlrpc 2009-02-04 15:35:51 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-0035.html