Bug 506285 - qpid::sys::Mutex throws exception in destructor
Summary: qpid::sys::Mutex throws exception in destructor
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: 1.1.1
Hardware: All
OS: Linux
high
medium
Target Milestone: 1.1.6
: ---
Assignee: Gordon Sim
QA Contact: Jan Sarenik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-16 15:06 UTC by Gordon Sim
Modified: 2018-10-20 00:58 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-14 17:32:13 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1153 0 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging bug fixing update 2009-07-14 17:31:48 UTC

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


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