[Boost.date-time] Problem with leak with time_from_string? Incorrect use, or other problem?

We have observed leaky behavior while using the Boost.date-time libraries, with time_from_string specifically. The leak is simple to replicate for us, on both Win32 (Visual Studio .NET 2005) and on Linux (GCC 3.x). This code snippet leaks for us, at a rate of about a MB every 10 seconds: while (true) { time_from_string("2002-01-20 23:59:59"); } As far as I can tell, ptime (what time_from_string returns) is an object that doesn't need to be deallocated with a Boost API function. So, why are we leaking here? Did we compile Boost incorrectly? Is there a way to link Boost that can trigger a leak? (from_iso_string() also appears to leak for us, by the way, while to_iso_string does not. It looks like time_from_string and to_iso_string are in the same neighborhood, so I'm betting they share the same fix.) Any and all help appreciated. This is a blocking issue for us. Stewart

On Wed, 22 Feb 2006 20:18:53 -0800, Stewart Loving-Gibbard wrote
We have observed leaky behavior while using the Boost.date-time libraries, with time_from_string specifically. The leak is simple to replicate for us, on both Win32 (Visual Studio .NET 2005) and on Linux (GCC 3.x).
This code snippet leaks for us, at a rate of about a MB every 10 seconds:
while (true) { time_from_string("2002-01-20 23:59:59"); }
As far as I can tell, ptime (what time_from_string returns) is an object that doesn't need to be deallocated with a Boost API function. So, why are we leaking here? Did we compile Boost incorrectly? Is there a way to link Boost that can trigger a leak?
(from_iso_string() also appears to leak for us, by the way, while to_iso_string does not. It looks like time_from_string and to_iso_string are in the same neighborhood, so I'm betting they share the same fix.)
Any and all help appreciated. This is a blocking issue for us.
It's a problem in the standard library. Have a look at this recent thread. A few key emails: http://lists.boost.org/Archives/boost/2006/02/100969.php http://lists.boost.org/Archives/boost/2006/02/101039.php http://lists.boost.org/Archives/boost/2006/02/101122.php As you'll see in the last email I've made some patches, but it isn't comprehensive. In particular, time_from_string is in one of those areas that I don't believe I can patch easily. If you're doing any non-trivial C++, I think you'll want to request support from the vendor or apply their workarounds since date-time is hardly the only code likely to be using basic_iostream. Jeff

Jeff: Thank you for your prompt and extremely helpful response. I've formally requested a hot-fix from Microsoft, opening a technical support issue with a case #, etc. In the meantime I will probably be forced to attempt the workaround, but I strongly encourage anyone else out there who is affected by the bug to also file a formal hotfix request as well. If Microsoft is inundated with hot-fix requests, they will surely do the right thing at some point. But, if all we do is post in forums, they have an excuse to ignore us. Stewart Jeff Garland wrote:
This code snippet leaks for us, at a rate of about a MB every 10 seconds:
while (true) { time_from_string("2002-01-20 23:59:59"); }
It's a problem in the standard library. Have a look at this recent thread. A few key emails:
http://lists.boost.org/Archives/boost/2006/02/100969.php http://lists.boost.org/Archives/boost/2006/02/101039.php http://lists.boost.org/Archives/boost/2006/02/101122.php
As you'll see in the last email I've made some patches, but it isn't comprehensive. In particular, time_from_string is in one of those areas that I don't believe I can patch easily.
If you're doing any non-trivial C++, I think you'll want to request support from the vendor or apply their workarounds since date-time is hardly the only code likely to be using basic_iostream.
Jeff
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

How do you request the hotfix?
Stewart Loving-Gibbard
This code snippet leaks for us, at a rate of about a MB every 10 seconds:
while (true) { time_from_string("2002-01-20 23:59:59"); }
It's a problem in the standard library. Have a look at this recent thread. A few key emails:
http://lists.boost.org/Archives/boost/2006/02/100969.php http://lists.boost.org/Archives/boost/2006/02/101039.php http://lists.boost.org/Archives/boost/2006/02/101122.php
As you'll see in the last email I've made some patches, but it isn't comprehensive. In particular, time_from_string is in one of those areas that I don't believe I can patch easily.
If you're doing any non-trivial C++, I think you'll want to request support from the vendor or apply their workarounds since date-time is hardly the only code likely to be using basic_iostream.
Jeff
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users ---------------------------------- --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments.

Calderon Hector wrote:
How do you request the hotfix?
Let me be clear that there is, as of yet, no hotfix available from MS for this issue. I did formally request one be made available, however. I called 800-936-5800, and used one of my MSDN support incidents to request a technical support issue. If it results in my getting a hotfix, I believe I will not be charged for my incident. If you do not have MSDN, I believe you might have to pony up the $250 charge on your credit card before you are granted an audience with a tech. Same refund-if-hotfix policy should apply here, however. I tried the workaround, by the way -- the rebuild of the runtime libraries failed midway through. I've reported this. Stewart
*/Stewart Loving-Gibbard
/* wrote: Jeff:
Thank you for your prompt and extremely helpful response.
I've formally requested a hot-fix from Microsoft, opening a technical support issue with a case #, etc. In the meantime I will probably be forced to attempt the workaround, but I strongly encourage anyone else out there who is affected by the bug to also file a formal hotfix request as well.
participants (3)
-
Calderon Hector
-
Jeff Garland
-
Stewart Loving-Gibbard