Bug 506285

Summary: qpid::sys::Mutex throws exception in destructor
Product: Red Hat Enterprise MRG Reporter: Gordon Sim <gsim>
Component: qpid-cppAssignee: Gordon Sim <gsim>
Status: CLOSED ERRATA QA Contact: Jan Sarenik <jsarenik>
Severity: medium Docs Contact:
Priority: high    
Version: 1.1.1CC: iboverma, jsarenik, tao
Target Milestone: 1.1.6   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-14 17:32:13 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:
Attachments:
Description Flags
Suggested alteration
none
latest fix
none
Improved fix
none
Test none

Description Gordon Sim 2009-06-16 15:06:26 UTC
If this ever occurs when already handling an exception the process will be terminated, thus it is fundamentally unsafe.

Comment 1 Gordon Sim 2009-06-16 16:54:07 UTC
Created attachment 348133 [details]
Suggested alteration

This replaces the exception with an abort, hopefully making the error more visible and easier to identify.

Comment 2 Gordon Sim 2009-06-16 18:35:27 UTC
Created attachment 348148 [details]
latest fix

This extends the same treatment to the destructor of the Condition class also.

Comment 3 Gordon Sim 2009-06-17 19:02:20 UTC
Created attachment 348321 [details]
Improved fix

Prints an error statement before the abort.

Comment 4 Gordon Sim 2009-06-17 19:06:18 UTC
Created attachment 348322 [details]
Test

The following test if built against the fixed library should result in an abort. Built against an earlier revision (with NDEBUG[1]), it should throw an exception that is caught, and then exit 'normally' i.e. with 0 exit code - this is the _wrong_ behaviour.

[1] g++ -DNDEBUG -lqpidcommon test.cpp -o test

Comment 5 Gordon Sim 2009-06-22 15:17:22 UTC
Fix is in -18 and -19.

Comment 7 Irina Boverman 2009-06-24 18:49:06 UTC
Below is the link to the current hotfix that we've made available to (primarily) address the issues with the server heartbeat functionality:

http://people.redhat.com/~fhirtz/.tsx_112hf2_0624/

This has both the RHEL4 and RHEL5 versions. Packages for hotfix have version 0.5.752581-20 for qpidc package set and rhm-0.5.3206-4.el4 or rhm-0.5.3206-5.el5 for the store (just a different revision number for RHEL4 and RHEL5).

Note that upgrading the store is a *must* and will not unfortunately be picked up if you simply install the qpid packages (but qpidd will then core on starting if the store module is loaded).

Comment 9 Jan Sarenik 2009-07-03 09:44:13 UTC
Reproduced and verified on RHEL5 i386

== on qpidc-devel 0.5.752581-17 ==

rhel5:~# ./test; echo $?
Failure on main thread: Device or resource busy (/usr/include/qpid/sys/posix/Mutex.h:112)
0

== on qpidc-devel 0.5.752581-22 ==

rhel5:~# ./test; echo $?
Device or resource busy
Aborted
134

Comment 10 Jan Sarenik 2009-07-03 09:53:04 UTC
Verified on RHEL5 x86_64, qpidc-devel 0.5.752581-22

I am unable to reproduce/verify it on RHEL4 the same way
I did it on RHEL5. Any hints?

Comment 11 Jan Sarenik 2009-07-03 10:56:19 UTC
It did not complain when compiling without -I... but despite that
it is vital.

g++ -DNDEBUG -I/usr/include/qpid-boost -lqpidcommon test.cpp -o test

Comment 12 Jan Sarenik 2009-07-03 12:09:58 UTC
Verified also on qpidc-devel-0.5.752581-21.el4, RHEL4, both archs

Comment 14 errata-xmlrpc 2009-07-14 17:32:13 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/RHBA-2009-1153.html