Boost C++ Libraries: Ticket #1230: mbstate uninitialized https://svn.boost.org/trac10/ticket/1230 <p> In boost_1_34_1/libs/filesystem/src/path.cpp the functions to_internal and to_external both call the converter without initializing the state. The type mbstate_t is a POD so state must be initialized before the call. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1230 Trac 1.4.3 Marshall Clow Wed, 26 Sep 2007 17:08:14 GMT component changed; owner set https://svn.boost.org/trac10/ticket/1230#comment:1 https://svn.boost.org/trac10/ticket/1230#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Beman Dawes</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">filesystem</span> </li> </ul> Ticket Beman Dawes Sun, 25 Nov 2007 15:27:02 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/1230#comment:2 https://svn.boost.org/trac10/ticket/1230#comment:2 <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> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.35.0</span> </li> </ul> <p> It isn't clear to me mbstate <strong>needs</strong> to be initialized. But doing so is harmless, so it now does so. </p> <p> Thanks for the report, </p> <p> --Beman </p> Ticket Jan-Erik.Dahlin@… Mon, 26 Nov 2007 09:43:20 GMT <link>https://svn.boost.org/trac10/ticket/1230#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1230#comment:3</guid> <description> <p> It <strong>needs</strong> to be initialized. As the name implies the mbstate tracks the state of a multibyte access, e.g. if the previous access or conversion only was a partial translation (this can happen if the previous read operation only got half the multibyte character and the other half comes in the current read). </p> <p> If we start with an uninitialized mbstate the current access can accidentally be performed as a continuation of a partial access. That will produce unexpected results. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>vital</dc:creator> <pubDate>Thu, 26 Feb 2009 11:17:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1230#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1230#comment:4</guid> <description> <p> Hello[[BR]] It really must be initialized. We have a crash inside boost due to this bug in 1.34.1. I found corresponding bug to gcc (but left as "not a bug") where the reason of crash was also unitizalized state (<a class="ext-link" href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28059"><span class="icon">​</span>http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28059</a>) <br /><br /> Stack of crash:<br /> <a class="missing ticket">#0</a> 0xb7f6c410 in <span class="underline">kernel_vsyscall ()<br /> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1" title="#1: Bugs: boost.build causes ftjam to segfault (closed: Wont Fix)">#1</a> 0xb6c66085 in raise () from /lib/tls/i686/cmov/libc.so.6<br /> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2" title="#2: Bugs: list::size should be const (closed: fixed)">#2</a> 0xb6c67a01 in abort () from /lib/tls/i686/cmov/libc.so.6<br /> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3" title="#3: Bugs: automatic conversion and overload proble (closed: fixed)">#3</a> 0xb6e86480 in </span>gnu_cxx::<span class="underline">verbose_terminate_handler () from ../lib32/libstdc++.so.6<br /> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4" title="#4: Bugs: any_ptr in any library documentation? (closed: Fixed)">#4</a> 0xb6e83d05 in std::set_unexpected () from ../lib32/libstdc++.so.6<br /> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5" title="#5: Bugs: shared_ptr and self-owning objects (closed: Fixed)">#5</a> 0xb6e83d42 in std::terminate () from ../lib32/libstdc++.so.6<br /> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6" title="#6: Bugs: tie in utility.hpp and tuple.hpp clash. (closed: Duplicate)">#6</a> 0xb6e83e6a in </span>cxa_throw () from ../lib32/libstdc++.so.6<br /> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7" title="#7: Bugs: g++ 2.96 requires NO_STRINGSTREAM (closed: Fixed)">#7</a> 0xb7be2220 in boost::throw_exception&lt;boost::filesystem::basic_filesystem_error&lt;boost::filesystem::basic_path&lt;std::basic_string&lt;wchar_t, std::char_traits&lt;wchar_t&gt;, std::allocator&lt;wchar_t&gt; &gt;, boost::filesystem::wpath_traits&gt; &gt; &gt; (e=@0xbf9a6fac) </p> <blockquote> <p> at throw_exception.hpp:39[[BR]] </p> </blockquote> <p> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8" title="#8: Bugs: prop in undirected graph + out_edges (closed: Works For Me)">#8</a> 0xb7be159e in boost::filesystem::wpath_traits::to_external (ph=@0xbf9a7138, src=@0xbf9a701c) </p> <blockquote> <p> at boost/boost/libs/filesystem/src/path.cpp:94[[BR]] </p> </blockquote> <p> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9" title="#9: Bugs: config_info ambiguity error (closed: Invalid)">#9</a> 0xb76b8b43 in boost::filesystem::basic_path&lt;std::basic_string&lt;wchar_t, std::char_traits&lt;wchar_t&gt;, std::allocator&lt;wchar_t&gt; &gt;, boost::filesystem::wpath_traits&gt;::external_directory_string (this=0xbf9a7138) at path.hpp:303[[BR]] ... </p> </description> <category>Ticket</category> </item> </channel> </rss>