Re: [Boost-bugs] [Boost C++ Libraries] #2681: lwm_pthread fails to catch initialization error

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2681: lwm_pthread fails to catch initialization error
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-01-27 15:32:32


#2681: lwm_pthread fails to catch initialization error
---------------------------------------------------------------------+------
  Reporter: Olivier Langlois <olivier.langlois_at_[hidden]> | Owner: anthonyw
      Type: Bugs | Status: new
 Milestone: Boost 1.38.0 | Component: threads
   Version: Boost 1.37.0 | Severity: Problem
Resolution: | Keywords:
---------------------------------------------------------------------+------
Changes (by Olivier Langlois <olivier.langlois_at_[hidden]>):

 * cc: olivier.langlois_at_[hidden] (added)

Comment:

 I can give more details on how I stumbled on the problem. I had this bad
 statement in my code which had the intent of reseting boost::shared_ptr

 // reset shared pointer
 my_ptr = boost::shared_ptr<MyClass>(static_cast<MyClass *>(NULL));

 So for each 'reset', a new ref counter with its mutex was created. After
 few thousands of 'reset', pthread_mutex_init() eventually returned ENOMEM
 which was not catched by boost as described in the initial description.

 and finally on the next pthread_mutex_lock with the unitialized mutex, on
 my OS (CentOS 4), the program just block inside the call and never return.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2681#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC