Boost C++ Libraries: Ticket #3525: problem with example response_file.cpp https://svn.boost.org/trac10/ticket/3525 <p> The example works as advertised when the provided response file is used. If I modify the response file as follows: </p> <p> -I bar1234567890123456789012345678901234567890 -I biz --magic=10 </p> <p> then the output is garbled: </p> <p> Include paths: bar12�\pA5678A<sub>bar12 </sub></p> <p> I can fix the problem if I add </p> <blockquote> <p> string sss= ss.str(); </p> </blockquote> <p> and replace the tokenizer line with </p> <blockquote> <p> tokenizer&lt;char_separator&lt;char&gt; &gt; tok(sss, sep); </p> </blockquote> <p> I'm not too sure why the problem occurs, as ss.str() is supposed to return a copy. </p> <p> I work on Linux, gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3525 Trac 1.4.3 s.ochsenknecht@… Thu, 29 Oct 2009 18:23:43 GMT <link>https://svn.boost.org/trac10/ticket/3525#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3525#comment:1</guid> <description> <p> valgrind shows the errors. </p> <p> stringstream::str() returns a *copy* of the string. This is a temporary object. The tokenizer does further operations on the string which is descruted already. The string has to live as long as the tokenizer. </p> <p> So, its not a bug of program_options. I think the testcase has to be adapted. I will attach a patch soon ... </p> <p> </p> </description> <category>Ticket</category> </item> <item> <author>s.ochsenknecht@…</author> <pubDate>Thu, 29 Oct 2009 18:26:27 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/3525 https://svn.boost.org/trac10/ticket/3525 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">patch_ticket3525.diff</span> </li> </ul> <p> patch </p> Ticket Sascha Ochsenknecht <s.ochsenknecht@…> Wed, 18 Nov 2009 08:14:10 GMT cc set https://svn.boost.org/trac10/ticket/3525#comment:2 https://svn.boost.org/trac10/ticket/3525#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">s.ochsenknecht@…</span> added </li> </ul> Ticket Sascha Ochsenknecht Fri, 20 Nov 2009 10:03:09 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3525#comment:3 https://svn.boost.org/trac10/ticket/3525#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/57808" title="correct usage of tokenizer, memory bug, Fixes #3525">[57808]</a>) correct usage of tokenizer, memory bug, Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3525" title="#3525: Bugs: problem with example response_file.cpp (closed: fixed)">#3525</a> </p> Ticket Sascha Ochsenknecht Sun, 06 Dec 2009 12:20:37 GMT milestone changed https://svn.boost.org/trac10/ticket/3525#comment:4 https://svn.boost.org/trac10/ticket/3525#comment:4 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.41.0</span> → <span class="trac-field-new">Boost 1.42.0</span> </li> </ul> Ticket