• src/sbbs3/ftpsrvr.cpp mailsrvr.cpp main.cpp services.cpp websrvr.cpp

    From Deucе@VERT to Git commit to main/sbbs/master on Wed Mar 11 00:53:17 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/61695ba1a683ef1a7a50223c
    Modified Files:
    src/sbbs3/ftpsrvr.cpp mailsrvr.cpp main.cpp services.cpp websrvr.cpp Log Message:
    Ensure absolutely nothing executes after thread_down()

    Round 1 (2fb010d6c3) moved heavy shared-resource ops before thread_down
    but left lprintf calls after it. Every lprintf goes through lputs which
    calls mqtt_lputs(&mqtt, ...) — and cleanup destroys mqtt via
    mqtt_shutdown(). In services.cpp, the post-thread_down lprintf calls active_clients() which iterates the service[] array reading
    protected_uint32 values (CRITICAL_SECTIONs on Windows) that cleanup
    destroys at line 1807. Since all server DLLs share the CRT heap,
    corruption from any server is detected when another server calls free().

    Move all remaining lprintf calls before thread_down. For log messages
    that reported the thread_down() return value as "threads remain", use protected_uint32_value(thread_count) - 1 as an approximation instead.

    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net