Bug 506285 - qpid::sys::Mutex throws exception in destructor
qpid::sys::Mutex throws exception in destructor
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp (Show other bugs)
1.1.1
All Linux
high Severity medium
: 1.1.6
: ---
Assigned To: Gordon Sim
Jan Sarenik
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-16 11:06 EDT by Gordon Sim
Modified: 2011-08-12 12:21 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-07-14 13:32:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Suggested alteration (989 bytes, patch)
2009-06-16 12:54 EDT, Gordon Sim
no flags Details | Diff
latest fix (1.38 KB, patch)
2009-06-16 14:35 EDT, Gordon Sim
no flags Details | Diff
Improved fix (1.41 KB, patch)
2009-06-17 15:02 EDT, Gordon Sim
no flags Details | Diff
Test (633 bytes, text/x-c++src)
2009-06-17 15:06 EDT, Gordon Sim
no flags Details

  None (edit)
Description Gordon Sim 2009-06-16 11:06:26 EDT
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 12:54:07 EDT
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 14:35:27 EDT
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 15:02:20 EDT
Created attachment 348321 [details]
Improved fix

Prints an error statement before the abort.
Comment 4 Gordon Sim 2009-06-17 15:06:18 EDT
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 11:17:22 EDT
Fix is in -18 and -19.
Comment 7 Irina Boverman 2009-06-24 14:49:06 EDT
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 05:44:13 EDT
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 05:53:04 EDT
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 06:56:19 EDT
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 08:09:58 EDT
Verified also on qpidc-devel-0.5.752581-21.el4, RHEL4, both archs
Comment 14 errata-xmlrpc 2009-07-14 13:32:13 EDT
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

Note You need to log in before you can comment on or make changes to this bug.