Boost C++ Libraries: Ticket #12122: Socket get_option throwing length_error exceptions https://svn.boost.org/trac10/ticket/12122 <p> We've seen some indeterminate behavior when calling get_option(no_delay). Occasionally we'll see the length_error exception get thrown from within socket_option::boolean::resize() even though we're passing in an error_code to get_option(). Occasionally we'll get an unexpected result from the option as well (the option will be off even though it was set to on). We'll manually add more details to the exception in question so we can investigate what unexpected size the resize() function is encountering. Also, I noticed it's not the first time this exception was encountered by someone: </p> <p> <a class="ext-link" href="https://sourceforge.net/p/asio/mailman/message/6494499/"><span class="icon">​</span>https://sourceforge.net/p/asio/mailman/message/6494499/</a> </p> <p> A few things should really happen here regardless of the root issue: </p> <ol><li>An exception should not be thrown when an error_code is passed in. These resize() functions need support for error_code so it can be passed through by the corresponding get_option() overload. </li></ol><ol start="2"><li>The exception message in resize() should contain more details. In particular, it should mention the value of the passed in size 's', and possibly the result of the size() member function as well. </li></ol><p> We've seen this happen on Windows v6.0.6002 and v6.1.7601. We'll add more details here about the unexpected size value we're encountering once we have them. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12122 Trac 1.4.3 Chris White <chriswhitemsu@…> Wed, 01 Jun 2016 21:03:22 GMT <link>https://svn.boost.org/trac10/ticket/12122#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12122#comment:1</guid> <description> <p> We saw this happen with our more detailed exception message. </p> <p> socket_option::boolean::resize() was called with s = 0. </p> <p> socket_option::boolean::size() returned 4 at that time. </p> </description> <category>Ticket</category> </item> </channel> </rss>