Boost C++ Libraries: Ticket #3895: Faulty output of tags by diagnostic_information() in G++ MinGW https://svn.boost.org/trac10/ticket/3895 <p> When the diagnostic_information() function is called with a boost::exception the output of the tag information is faulty. </p> <p> This can be seen in the output of example_io.cpp when compiled using g++ (TDM-2 mingw32) 4.4.1 </p> <pre class="wiki"> Caught 'read_error' exception. ------------------------------------------------- Source file name: tmp1.txt Destination file name: tmp2.txt File name: tmp1.txt OS error: 0 Failed function: fread Output from diagnostic_information(): example_io.cpp(78): Throw in function void my_fread(void*, size_t, size_t, const boost::shared_ptr&lt;_iobuf&gt;&amp;) Dynamic exception type: N5boost16exception_detail10clone_implI11fread_errorEE std::exception::what: example_io error [P17tag_file_name_dst] = tmp2.txt [P17tag_file_name_src] = tmp1.txt [PN5boost14errinfo_errno_E] = 0, "No error" [PN5boost18errinfo_file_name_E] = tmp1.txt [PN5boost20errinfo_file_handle_E] = [ type: N5boost10error_infoINS_20errinfo_fil e_handle_ENS_8weak_ptrI6_iobufEEEE, size: 12, dump: 08 d5 48 00 b8 09 17 77 70 0 f 2d 00 ] [PN5boost21errinfo_api_function_E] = fread Caught 'open_error' exception. ------------------------------------------------- File name: tmp1.txt OS error: 2 Failed function: fopen Output from diagnostic_information(): example_io.cpp(67): Throw in function boost::shared_ptr&lt;_iobuf&gt; my_fopen(const c har*, const char*) Dynamic exception type: N5boost16exception_detail10clone_implI11fopen_errorEE std::exception::what: example_io error [PN5boost14errinfo_errno_E] = 2, "No such file or directory" [PN5boost18errinfo_file_name_E] = tmp1.txt [PN5boost21errinfo_api_function_E] = fopen [PN5boost23errinfo_file_open_mode_E] = rb </pre><p> The operating system in use is Windows Vista </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3895 Trac 1.4.3 andrew mcardle <andrewmcardle1@…> Wed, 03 Feb 2010 15:38:39 GMT <link>https://svn.boost.org/trac10/ticket/3895#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3895#comment:1</guid> <description> <p> On closer inspection it seems to be due to the fact that typeid().name returns a system specific name. To demonstrate this change tag_type_name() to call the typeid() function and print to stdout: </p> <pre class="wiki"> template &lt;class T&gt; inline char const * tag_type_name() { #ifdef BOOST_NO_TYPEID return BOOST_CURRENT_FUNCTION; #else std::cout&lt;&lt;typeid(T*).name(); return typeid(T*).name(); #endif } </pre><p> If this counts as a bug or a feature, I am now unsure, however it does not seem to be a problem with the library itself. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Wed, 03 Feb 2010 18:48:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3895#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3895#comment:2</guid> <description> <p> Yes, this is due to typeid.name(). Note that by design, the diagnostic_information string is not user-friendly and may not be pretty. </p> <p> That said, since I don't have mingw handy, could you please run this code with the latest trunk version? It should look a lot better now. </p> </description> <category>Ticket</category> </item> <item> <author>andrew mcardle <andrewmcardle1@…></author> <pubDate>Wed, 03 Feb 2010 19:45:54 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3895#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3895#comment:3</guid> <description> <p> Recompiled example_io.cpp with the trunk version (59443), seems to be working perfectly: </p> <pre class="wiki">Caught 'read_error' exception. ------------------------------------------------- Source file name: tmp1.txt Destination file name: tmp2.txt File name: tmp1.txt OS error: 0 Failed function: fread Output from diagnostic_information(): example_io.cpp(78): Throw in function void my_fread(void*, size_t, size_t, const boost::shared_ptr&lt;_iobuf&gt;&amp;) Dynamic exception type: boost::exception_detail::clone_impl&lt;fread_error&gt; std::exception::what: example_io error [tag_file_name_dst*] = tmp2.txt [tag_file_name_src*] = tmp1.txt [boost::errinfo_errno_*] = 0, "No error" [boost::errinfo_file_name_*] = tmp1.txt [boost::errinfo_file_handle_*] = [ type: N5boost10error_infoINS_20errinfo_file_h andle_ENS_8weak_ptrI6_iobufEEEE, size: 12, dump: 68 67 49 00 b8 09 17 77 58 0f 3 3 00 ] [boost::errinfo_api_function_*] = fread Caught 'open_error' exception. ------------------------------------------------- File name: tmp1.txt OS error: 2 Failed function: fopen Output from diagnostic_information(): example_io.cpp(67): Throw in function boost::shared_ptr&lt;_iobuf&gt; my_fopen(const c har*, const char*) Dynamic exception type: boost::exception_detail::clone_impl&lt;fopen_error&gt; std::exception::what: example_io error [boost::errinfo_errno_*] = 2, "No such file or directory" [boost::errinfo_file_name_*] = tmp1.txt [boost::errinfo_api_function_*] = fopen [boost::errinfo_file_open_mode_*] = rb </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Wed, 03 Feb 2010 20:20:07 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/3895#comment:4 https://svn.boost.org/trac10/ticket/3895#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> Ah, not entirely perfect, a bit of mangling can be seen in the boost::errinfo_file_handle_ value. Should be good in trunk revision <a class="missing ticket">#59449</a>. </p> Ticket andrew mcardle <andrewmcardle1@…> Thu, 04 Feb 2010 17:41:35 GMT <link>https://svn.boost.org/trac10/ticket/3895#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3895#comment:5</guid> <description> <p> Tried with latest trunk version, all fine now: </p> <pre class="wiki"> Caught 'read_error' exception. ------------------------------------------------- Source file name: tmp1.txt Destination file name: tmp2.txt File name: tmp1.txt OS error: 0 Failed function: fread Output from diagnostic_information(): example_io.cpp(78): Throw in function void my_fread(void*, size_t, size_t, const boost::shared_ptr&lt;_iobuf&gt;&amp;) Dynamic exception type: boost::exception_detail::clone_impl&lt;fread_error&gt; std::exception::what: example_io error [tag_file_name_dst*] = tmp2.txt [tag_file_name_src*] = tmp1.txt [boost::errinfo_errno_*] = 0, "No error" [boost::errinfo_file_name_*] = tmp1.txt [boost::errinfo_file_handle_*] = [ type: boost::error_info&lt;boost::errinfo_file_h andle_, boost::weak_ptr&lt;_iobuf&gt; &gt;, size: 12, dump: 68 67 49 00 b8 09 17 77 58 0f 25 00 ] [boost::errinfo_api_function_*] = fread Caught 'open_error' exception. ------------------------------------------------- File name: tmp1.txt OS error: 2 Failed function: fopen Output from diagnostic_information(): example_io.cpp(67): Throw in function boost::shared_ptr&lt;_iobuf&gt; my_fopen(const c har*, const char*) Dynamic exception type: boost::exception_detail::clone_impl&lt;fopen_error&gt; std::exception::what: example_io error [boost::errinfo_errno_*] = 2, "No such file or directory" [boost::errinfo_file_name_*] = tmp1.txt [boost::errinfo_api_function_*] = fopen [boost::errinfo_file_open_mode_*] = rb </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Thu, 04 Feb 2010 18:40:41 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3895#comment:6 https://svn.boost.org/trac10/ticket/3895#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Thanks, Andrew. </p> Ticket