Opened 8 years ago
Closed 8 years ago
#10700 closed Bugs (fixed)
Crash while sending message of length > 1025 using boost::log::sinks::syslog_backend
Reported by: | Owned by: | Andrey Semashev | |
---|---|---|---|
Milestone: | To Be Determined | Component: | log |
Version: | Boost 1.55.0 | Severity: | Problem |
Keywords: | Crash, syslog_backend, RFC3164 | Cc: |
Description
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.
Attachments (1)
Change History (4)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
avserver.exe!_vsprintf_s_l(char * string, unsigned int sizeInBytes, const char * format, localeinfo_struct * plocinfo, char * ap) Line 244 C
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<boost::asio::ip::udp> & 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<char,std::char_traits<char>,std::allocator<char> > & formatted_message) Line 442 C++ avserver.exe!boost::log::v2s_mt_nt5::sinks::syslog_backend::consume(const boost::log::v2s_mt_nt5::record_view & rec, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & formatted_message) Line 473 C++ avserver.exe!boost::log::v2s_mt_nt5::sinks::basic_formatting_sink_frontend<char>::feed_record<boost::mutex,boost::log::v2s_mt_nt5::sinks::syslog_backend>(const boost::log::v2s_mt_nt5::record_view & rec, boost::mutex & backend_mutex, boost::log::v2s_mt_nt5::sinks::syslog_backend & backend) Line 446 C++ avserver.exe!boost::log::v2s_mt_nt5::sinks::asynchronous_sink<boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue>::run() Line 331 C++ avserver.exe!boost::_mfi::mf0<void,boost::log::v2s_mt_nt5::sinks::asynchronous_sink<boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue> >::operator()(boost::log::v2s_mt_nt5::sinks::asynchronous_sink<boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue> * p) Line 49 C++ avserver.exe!boost::_bi::list1<boost::_bi::value<boost::log::v2s_mt_nt5::sinks::asynchronous_sink<boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue> *> >::operator()<boost::_mfi::mf0<void,boost::log::v2s_mt_nt5::sinks::asynchronous_sink<boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue> >,boost::_bi::list0>(boost::_bi::type<void> formal, boost::_mfi::mf0<void,boost::log::v2s_mt_nt5::sinks::asynchronous_sink<boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue> > & f, boost::_bi::list0 & a, int formal) Line 254 C++ avserver.exe!boost::_bi::bind_t<void,boost::_mfi::mf0<void,boost::log::v2s_mt_nt5::sinks::asynchronous_sink<boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue> >,boost::_bi::list1<boost::_bi::value<boost::log::v2s_mt_nt5::sinks::asynchronous_sink<boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue> *> > >::operator()() Line 21 C++ avserver.exe!boost::detail::thread_data<boost::_bi::bind_t<void,boost::_mfi::mf0<void,boost::log::v2s_mt_nt5::sinks::asynchronous_sink<boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue> >,boost::_bi::list1<boost::_bi::value<boost::log::v2s_mt_nt5::sinks::asynchronous_sink<boost::log::v2s_mt_nt5::sinks::syslog_backend,boost::log::v2s_mt_nt5::sinks::unbounded_fifo_queue> *> > > >::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
comment:3 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Should be fixed in https://github.com/boostorg/log/commit/755b2c27b798776bdb49ba139065a1b2270e25c6.
Can you provide a backtrace of the crash?