Boost logo

Boost Users :

Subject: Re: [Boost-users] shared_ptr leaking memory and crashing / gcc 3.4.6
From: Michael (boost_at_[hidden])
Date: 2008-11-01 17:21:07


Peter Dimov wrote:
>> Anybody interested in this or could point me to a different boost list?
>>
>> Michael wrote:
>>> Hello,
>>>
>>> I figured that shared_ptr (boost 3.4, but I don't think this is
>>> really a boost problem) will lose memory in the following example
> ...
>>> int main(int argc, char** argv)
>>> {
>>> while (true)
>>> {
>>> XRef myX;
>>> try
>>> {
>>> myX = getx();
>>> }
>>> catch(...)
>>> {
>>> }
>>> }
>>> }
> ...
>>> Platform is FreeBSD 6, gcc 3.4.6. It only happens when compiled like
>>> above (without optimization).
>
> I'm interested in principle in everything concerning shared_ptr, but I'm
> not sure what we can do about this specific case. Maybe report it to the
> GCC Bugzilla? Is 3.4.6 even being maintained?
Thanks for your response.

I'm not certain if 3.4.6 is still maintained (the gcc site is not very
specific about this), but since it is still shipped with some OSes as
default I thought it might me worthwhile to put a warning somewhere in
the boost documentation (sth like "known issues") to save somebody else
from getting hit by this (in my case it was a server process crashing
once a week for no apparent reason). Posting a bug at the gcc mailing
list would only be an option if I can track this further down so I can
report it without referring to boost (otherwise I'm pretty sure they
will tell me to report this to the boost mailing list :). I don't know
shared_ptr's internals (yet) and if this relates to something that is
very specific to shared_ptr or a general issue that is easy to put in a
small example case. So if you or anybody has a clue what might cause
this I could try to get this to the gcc guys. If not, I would just
suggest a warning in the documentation and hope that 3.4 won't be used
by anybody in the near future.

/michael

>
> --
> Peter Dimov
> http://www.pdplayer.com
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net