https://gitlab.synchro.net/main/sbbs/-/issues/495#note_3091
So here's the BT from a crash on Windows today (using code from a week ago, so mqtt.c line numbers don't match current SHA), but it's clearly the same crash in strlen() by way of vasprintf():```> sbbs.dll!common_strnlen_c<unsigned char>(const unsigned char * const string, const unsigned int maximum_count) Line 36 C++ sbbs.dll!common_strnlen_simd<0,unsigned char>(const unsigned char * const string, const unsigned int maximum_count) Line 94 C++ sbbs.dll!common_strnlen<unsigned char>(const unsigned char * const string, const unsigned int maximum_count) Line 153 C++ sbbs.dll!strnlen(const char * string, unsigned int maximum_count) Line 165 C++ sbbs.dll!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::standard_base<char,__crt_stdio_output::string_output_adapter<char>>>::type_case_s_compute_narrow_string_length(const int maximum_length, char __formal) Line 2268 C++ sbbs.dll!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::standard_base<char,__crt_stdio_output::string_output_adapter<char>>>::type_case_s() Line 2255 C++ sbbs.dll!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::standard_base<char,__crt_stdio_output::string_output_adapter<char>>>::state_case_type() Line 1999 C++ sbbs.dll!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::standard_base<char,__crt_stdio_output::string_output_adapter<char>>>::process() Line 1644 C++ sbbs.dll!common_vsprintf<__crt_stdio_output::standard_base,char>(const unsigned __int64 options, char * const buffer, const unsigned int buffer_count, const char * const format, __crt_locale_pointers * const locale, char * const arglist) Line 163 C++ sbbs.dll!__stdio_common_vsprintf(unsigned __int64 options, char * buffer, unsigned int buffer_count, const char * format, __crt_locale_pointers * locale, char * arglist) Line 235 C++ [External Code] s
bbs.dll!vasprintf(char * * strptr, const char * format, char * va) Line 60 C sbbs.dll!strListAppendFormat(char * * * list, const char * format, ...) Line 321 C sbbs.dll!mqtt_client_on(mqtt * mqtt, int on, int sock, client_t * client, int update) Line 614 C websrvr.dll!client_off(unsigned int sock) Line 772 C websrvr.dll!http_session_thread(void * arg) Line 6775 C websrvr.dll!invoke_thread_procedure(void(*)(void *) procedure, void * const context) Line 82 C++ websrvr.dll!thread_start<void (__cdecl*)(void *)>(void * const parameter) Line 115 C++ [External Code] mqtt->client_list = {first=0x0760c020 {data=0x06cb0710 next=0x077ca988 {data=0x06cd4f48 next=0x076666c0 {data=0x06cd49f0 ...} ...} ...} ...}client_list.mutex = {DebugInfo=0x00782620 {Type=0 CreatorBackTraceIndex=0 CriticalSection=websrvr.dll!0x01a945dc {DebugInfo=...} ...} ...}client_list.count = 9client_list.sem = 0x00000000list = 0x131e8af0 {0x07bf2cc0 "2152\tHTTP\tGuest\t98.7.221.143\t<no name>\t56584\t1674288933"}```I don't see anything obviously wrong and this problem only happens like once in every millions calls to mqtt_client_on(), so I'm probably just going to punt and use an alternative approach to appending a new formatted string to the (temporary) client_list.
--- SBBSecho 3.20-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)