Boost C++ Libraries: Ticket #3549: Crash from serializing an unregistered class https://svn.boost.org/trac10/ticket/3549 <p> If an attempt is made to serialize an unregistered class and the program gets to line 377 of boost/archive/detail/oserializer.hpp (revision 57090), the program will crash from dereferencing a null pointer. To fix it, comment out or remove line 380, and take out the comma on the line before it. This may provide less debugging information than intended, but I'm not sure that information is available since it was supposed to be coming from the null pointer. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3549 Trac 1.4.3 Robert Ramey Fri, 23 Oct 2009 16:24:47 GMT <link>https://svn.boost.org/trac10/ticket/3549#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3549#comment:1</guid> <description> <p> Hmmm - where exactly does this crash? </p> <p> archive_exception.cpp line # 40 constructs this exception and it explicitly checks for a null pointer. </p> <p> Need more information here. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>jeff.jackowski@…</author> <pubDate>Fri, 23 Oct 2009 16:32:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3549#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3549#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/3549#comment:1" title="Comment 1">ramey</a>: </p> <blockquote class="citation"> <p> Hmmm - where exactly does this crash? </p> <p> archive_exception.cpp line # 40 constructs this exception and it explicitly checks for a null pointer. </p> <p> Need more information here. </p> <p> Robert Ramey </p> </blockquote> <p> It crashes before it can construct the exception. The code I'm looking at (boost/archive/detail/oserializer.hpp, line 376) is: </p> <p> if(NULL == true_type){ </p> <blockquote> <p> boost::serialization::throw_exception( </p> <blockquote> <p> archive_exception( </p> <blockquote> <p> archive_exception::unregistered_class, true_type-&gt;get_debug_info() </p> </blockquote> <p> ) </p> </blockquote> <p> ); </p> </blockquote> <p> } </p> <p> Evaluating the second parameter to archive_exception will dereference a null pointer. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Fri, 23 Oct 2009 16:55:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3549#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3549#comment:3</guid> <description> <p> fixed on my machine - will migrate to trunk and beyond. </p> <p> Note: I suspect that this will only occur when RTTI is not enabled for one's machine. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>jeff.jackowski@…</author> <pubDate>Fri, 23 Oct 2009 19:10:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3549#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3549#comment:4</guid> <description> <p> The problem occurred for me with MSVS 2008 with RTTI enabled. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Sun, 25 Oct 2009 19:01:11 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3549#comment:5 https://svn.boost.org/trac10/ticket/3549#comment:5 <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 case I did make a change so I I don't see how this can happen. It's the best I can do without a failing test case. </p> <p> Robert Ramey </p> Ticket