Boost C++ Libraries: Ticket #10700: Crash while sending message of length > 1025 using boost::log::sinks::syslog_backend https://svn.boost.org/trac10/ticket/10700 <p> Crash using syslog_backend in libs\log\src\syslog_backend.cpp in the function syslog_udp_socket::send_message. It happens when trying to send the message of the length greater than 1025. It is true that according to RFC3164 packet size for sending is limited to 1025, but the crash should not occur anyway. The message should rather be truncated to the length of 1025. Actual debug assertion failure happens in _vsprintf_s_l function while validating return status and the message "Buffer too small" appears. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10700 Trac 1.4.3 Andrey Semashev Mon, 27 Oct 2014 10:00:34 GMT <link>https://svn.boost.org/trac10/ticket/10700#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10700#comment:1</guid> <description> <p> Can you provide a backtrace of the crash? </p> </description> <category>Ticket</category> </item> <item> <author>Anton Ianovski <Anton.Ianovski@…></author> <pubDate>Mon, 27 Oct 2014 10:04:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10700#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10700#comment:2</guid> <description> <blockquote class="citation"> <blockquote> <p> avserver.exe!_vsprintf_s_l(char * string, unsigned int sizeInBytes, const char * format, localeinfo_struct * plocinfo, char * ap) Line 244 C </p> </blockquote> </blockquote> <blockquote> <p> avserver.exe!vsprintf_s(char * string, unsigned int sizeInBytes, const char * format, char * ap) Line 261 C avserver.exe!boost::log::v2s_mt_nt5::aux::vsnprintf(char * buf, unsigned int size, const char * format, char * args) Line 56 C++ avserver.exe!boost::log::v2s_mt_nt5::aux::snprintf(char * buf, unsigned int size, const char * format, ...) Line 91 C++ avserver.exe!boost::log::v2s_mt_nt5::sinks::`anonymous namespace'::syslog_udp_socket::send_message(int pri, const char * local_host_name, const boost::asio::ip::basic_endpoint&lt;boost::asio::ip::udp&gt; &amp; target, const char * message) Line 389 C++ avserver.exe!boost::log::v2s_mt_nt5::sinks::syslog_backend::implementation::udp_socket_based::send(boost::log::v2s_mt_nt5::sinks::syslog::level lev, const std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &amp; formatted_message) Line 442 C++ avserver.exe!boost::log::v2s_mt_nt5::sinks::syslog_backend::consume(const boost::log::v2s_mt_nt5::record_view &amp; rec, const std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &amp; formatted_message) Line 473 C++ avserver.exe!boost::log::v2s_mt_nt5::sinks::basic_formatting_sink_frontend&lt;char&gt;::feed_record&lt;boost::mutex,boost::log::v2s_mt_nt5::sinks::syslog_backend&gt;(const boost::log::v2s_mt_nt5::record_view &amp; rec, boost::mutex &amp; backend_mutex, boost::log::v2s_mt_nt5::sinks::syslog_backend &amp; backend) Line 446 C++ avserver.exe!boost::log::v2s_mt_nt5::sinks::asynchronous_sink&lt;boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue&gt;::run() Line 331 C++ avserver.exe!boost::_mfi::mf0&lt;void,boost::log::v2s_mt_nt5::sinks::asynchronous_sink&lt;boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue&gt; &gt;::operator()(boost::log::v2s_mt_nt5::sinks::asynchronous_sink&lt;boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue&gt; * p) Line 49 C++ avserver.exe!boost::_bi::list1&lt;boost::_bi::value&lt;boost::log::v2s_mt_nt5::sinks::asynchronous_sink&lt;boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue&gt; *&gt; &gt;::operator()&lt;boost::_mfi::mf0&lt;void,boost::log::v2s_mt_nt5::sinks::asynchronous_sink&lt;boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue&gt; &gt;,boost::_bi::list0&gt;(boost::_bi::type&lt;void&gt; <span class="underline">formal, boost::_mfi::mf0&lt;void,boost::log::v2s_mt_nt5::sinks::asynchronous_sink&lt;boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue&gt; &gt; &amp; f, boost::_bi::list0 &amp; a, int </span>formal) Line 254 C++ avserver.exe!boost::_bi::bind_t&lt;void,boost::_mfi::mf0&lt;void,boost::log::v2s_mt_nt5::sinks::asynchronous_sink&lt;boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue&gt; &gt;,boost::_bi::list1&lt;boost::_bi::value&lt;boost::log::v2s_mt_nt5::sinks::asynchronous_sink&lt;boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue&gt; *&gt; &gt; &gt;::operator()() Line 21 C++ avserver.exe!boost::detail::thread_data&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf0&lt;void,boost::log::v2s_mt_nt5::sinks::asynchronous_sink&lt;boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue&gt; &gt;,boost::_bi::list1&lt;boost::_bi::value&lt;boost::log::v2s_mt_nt5::sinks::asynchronous_sink&lt;boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue&gt; *&gt; &gt; &gt; &gt;::run() Line 118 C++ avserver.exe!boost::`anonymous namespace'::thread_start_function(void * param) Line 217 C++ avserver.exe!_callthreadstartex() Line 376 C avserver.exe!_threadstartex(void * ptd) Line 359 C kernel32.dll!75aa86e3() Unknown [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll] ntdll.dll!770bbe99() Unknown ntdll.dll!770bbe6c() Unknown </p> </blockquote> </description> <category>Ticket</category> </item> <item> <author>Anton Ianovski <Anton.Ianovski@…></author> <pubDate>Mon, 27 Oct 2014 10:06:36 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/10700 https://svn.boost.org/trac10/ticket/10700 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">Boost_SyslogBackend_Crash.txt</span> </li> </ul> <p> Crash backtrace </p> Ticket Andrey Semashev Thu, 30 Oct 2014 00:25:06 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/10700#comment:3 https://svn.boost.org/trac10/ticket/10700#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> Should be fixed in <a class="ext-link" href="https://github.com/boostorg/log/commit/755b2c27b798776bdb49ba139065a1b2270e25c6"><span class="icon">​</span>https://github.com/boostorg/log/commit/755b2c27b798776bdb49ba139065a1b2270e25c6</a>. </p> Ticket