[Boost.Format] Assertion failure for empty strings in VS2005
Hello, Since introduction of VC 8, boost::format causes an assertion failure, if empty strings are provided as format arguments, e.g. std::string arg; boost::format frmt("%s"); // Alternatively use: "%1%" std::string res = (frmt % arg).str(); This defect is well known since end of 2005 (e.g. by Mick Hollins et al. in the thread "[Boost.Format] empty string argument causes VC 8.0 to assert" or by J.S.Otis in the thread "Assertion failure usign boost::format with Visual C++ 2005" The defect was well-analyzed by Caleb Epstein and I share his opinion, that this is due to a defect in boost::io::detail::mk_str, which provides a null pointer as argument to std::string::append, which violates its preconditions. The null pointer effectively is a result of some streambuf::pbase() call, which is allowed to return a null result under well-defined conditions. My question is: Has this error been fixed since then? Thanks in advance, Daniel Krügler
Daniel Krügler ha escrito:
Hello,
Since introduction of VC 8, boost::format causes an assertion failure, if empty strings are provided as format arguments, e.g.
std::string arg; boost::format frmt("%s"); // Alternatively use: "%1%" std::string res = (frmt % arg).str();
This defect is well known since end of 2005 (e.g. by Mick Hollins et al. in the thread
"[Boost.Format] empty string argument causes VC 8.0 to assert"
or by J.S.Otis in the thread
"Assertion failure usign boost::format with Visual C++ 2005"
The defect was well-analyzed by Caleb Epstein and I share his opinion, that this is due to a defect in boost::io::detail::mk_str, which provides a null pointer as argument to std::string::append, which violates its preconditions. The null pointer effectively is a result of some streambuf::pbase() call, which is allowed to return a null result under well-defined conditions.
My question is: Has this error been fixed since then?
Thanks in advance,
Daniel, my hunch is that Boost.Format is not being actively maintained, so whether this is fixed or not pretty much depends on individual contributions. Do you feel qualified to write, test and propose a patch? If so, please submit such a patch to the list and I (or someone else with CVS write access) can commit it. Best regards, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
Joaquín Mª López Muñoz wrote:
Daniel, my hunch is that Boost.Format is not being actively maintained, so whether this is fixed or not pretty much depends on individual contributions. Do you feel qualified to write, test and propose a patch? If so, please submit such a patch to the list and I (or someone else with CVS write access) can commit it.
Thanks for your quick answer, Joaquín. I think I can prepare such a tested patch proposal up to the coming weekend (in the moment I have some deadline constraints...). I hope this is not too late. Does there actually exist an estimate for the Boost 1.34 release? Greetings from Bremen, Daniel
Daniel Krügler ha escrito:
Joaquín Mª López Muñoz wrote:
Daniel, my hunch is that Boost.Format is not being actively maintained, so whether this is fixed or not pretty much depends on individual contributions. Do you feel qualified to write, test and propose a patch? If so, please submit such a patch to the list and I (or someone else with CVS write access) can commit it.
Thanks for your quick answer, Joaquín. I think I can prepare such a tested patch proposal up to the coming weekend (in the moment I have some deadline constraints...). I hope this is not too late. Does there actually exist an estimate for the Boost 1.34 release?
We're in the bugfixing stage with no definite deadline AFAIK, so if your patch comes in this weekend I don't think there'll be any problem to make it into the release branch. Permission has to be asked for first though.
Greetings from Bremen,
Daniel
Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
For everyone interested: Yesterday night I compared the official 1.33_1 with the current HEAD version and found that user cepstein already had fixed the discussed problem of boost::format at March, 6th, 2006 in revision 1.28.6.1. Greetings from Bremen, Daniel Krügler
... regrettably the fix seems incomplete. So I will propose a further patch and counter example. Greetings from Bremen, Daniel Krügler
For those interested: Bug report (including proof of existence) and proposed patch can be found at http://sourceforge.net/tracker/index.php?func=detail&aid=1506914&group_id=7586&atid=107586 Greetings from Bremen, Daniel Krügler
Daniel Krügler ha escrito:
For those interested:
Bug report (including proof of existence) and proposed patch can be found at
http://sourceforge.net/tracker/index.php?func=detail&aid=1506914&group_id=7586&atid=107586
Greetings from Bremen,
Daniel Krügler
Fix commited to the trunk and RC_1_34_0 branches according to Daniel's instructions. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
participants (2)
-
Daniel Krügler
-
Joaquín Mª López Muñoz