Recently-cloned users with network profiles attempting to connect causes segfault #733

Closed
opened 2026-10-05 04:41:44 +02:00 by adam · 0 comments
Owner

Description:
Cloning users from a template user with pre-existing network and server configurations causes ZNC to crash once they start attempting to connect to IRC.

Steps to reproduce:

  1. Install ZNC normally (with debug symbols if you like) Bug presents in 1.6.1 and 1.6.3, haven't tested latest git.
  2. Run ZNC, create your admin and template users
  3. Make sure your template user has a network profile and server address that works
  4. Clone the template user a couple times. Bug presents when the second clone attempts to connect to IRC.

gdb log (using the instructions found here)

Signal        Stop      Print   Pass to program Description
SIGPIPE       No        No      Yes             Broken pipe
Starting program: /usr/local/bin/znc -D
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff409e700 (LWP 116631)]

Program received signal SIGSEGV, Segmentation fault.
0x00000000005dad6c in CCron::Stop (this=0x0) at src/Csocket.cpp:738
738     src/Csocket.cpp: No such file or directory.
#0  0x00000000005dad6c in CCron::Stop (this=0x0) at src/Csocket.cpp:738
No locals.
#1  0x00000000005dadae in CCron::Reset (this=0x0) at src/Csocket.cpp:753
No locals.
#2  0x000000000063bf3e in CIRCNetwork::JoinChans (this=0xa717d0)
    at src/IRCNetwork.cpp:866
        idx = 0
        pChan = 0xa6ccc0
        a = 0
        start = 0
        uJoins = 0
        sChans = std::__debug::set with 1 elements = {[0] = 0xa6ccc0}
#3  0x000000000063ea1f in CIRCNetwork::IRCConnected (this=0xa717d0)
    at src/IRCNetwork.cpp:1256
No locals.
#4  0x0000000000669ac2 in CIRCSock::ReadLine (this=0xa747b0, sData=...)
    at src/IRCSock.cpp:203
        vClients = std::__debug::vector of length 0, capacity 0
        sRest = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = ":Welcome to the StormBit IRC Network template_!template@bnc.stormbit.net",
          static CaseSensitive = CaseSensitivity::CaseSensitive,
          static CaseInsensitive = CaseSensitivity::CaseInsensitive}
        sTmp = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static CaseSensitive = CaseSensitivity::CaseSensitive,
          static CaseInsensitive = CaseSensitivity::CaseInsensitive}
        sServer = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "xfcab.stormbit.net", static CaseSensitive = CaseSensitivity::CaseSensitive,
          static CaseInsensitive = CaseSensitivity::CaseInsensitive}
        uRaw = 1
        sNick = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "template_", static CaseSensitive = CaseSensitivity::CaseSensitive,
          static CaseInsensitive = CaseSensitivity::CaseInsensitive}
        sLine = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = ":xfcab.stormbit.net 001 template_ :Welcome to the StormBit IRC Network template_!template@bnc.stormbit.net", static CaseSensitive = CaseSensitivity::CaseSensitive,
          static CaseInsensitive = CaseSensitivity::CaseInsensitive}
        bReturn = false
        sCmd = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "001", static CaseSensitive = CaseSensitivity::CaseSensitive,
          static CaseInsensitive = CaseSensitivity::CaseInsensitive}
#5  0x00000000005e17a2 in Csock::PushBuff (this=0xa747b0,
    data=0xa7ca70 ":xfcab.stormbit.net NOTICE Auth :Welcome to \002StormBit\002!\r\n:xfcab.stormbit.net 001 template_ :Welcome to the StormBit IRC Network template_!template@bnc.stormbit.net\r\n:xfcab.stormbit.net 002 template_ :"..., len=4096,
    bStartAtZero=false) at src/Csocket.cpp:2316
        sUTF8 = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = ":xfcab.stormbit.net 001 template_ :Welcome to the StormBit IRC Network template_!template@bnc.stormbit.net\r\n",
          static CaseSensitive = CaseSensitivity::CaseSensitive,
          static CaseInsensitive = CaseSensitivity::CaseInsensitive}
        sBuff = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = ":xfcab.stormbit.net 001 template_ :Welcome to the StormBit IRC Network template_!template@bnc.stormbit.net\r\n",
          static CaseSensitive = CaseSensitivity::CaseSensitive,
          static CaseInsensitive = CaseSensitivity::CaseInsensitive}
        iFind = 107
        iStartPos = 0
#6  0x00000000005e4eb5 in CSocketManager::Loop (this=0xa20a18) at src/Csocket.cpp:3364
        iLen = 4096
        cBuff = {
          m_pBuffer = 0xa7ca70 ":xfcab.stormbit.net NOTICE Auth :Welcome to \002StormBit\002!\r\n:xfcab.stormbit.net 001 template_ :Welcome to the StormBit IRC Network template_!template@bnc.stormbit.net\r\n:xfcab.stormbit.net 002 template_ :"...}
        bytes = 4096
        pcSock = 0xa747b0
        iErrno = CSocketManager::SUCCESS
        itSock = {first = , second = CSocketManager::SUCCESS}
        mpeSocks = std::__debug::map with 1 elements = {
          [0xa747b0] = CSocketManager::SUCCESS}
        iMilliNow = 1478582159735
#7  0x00000000005e532c in CSocketManager::DynamicSelectLoop (this=0xa20a18,
    iLowerBounds=100000, iUpperBounds=600000000, iMaxResolution=3600)
    at src/Csocket.cpp:3422
No locals.
#8  0x00000000005fd045 in CZNC::Loop (this=0xa20940) at src/znc.cpp:221
        sError = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static CaseSensitive = CaseSensitivity::CaseSensitive,
          static CaseInsensitive = CaseSensitivity::CaseInsensitive}
        eState = CZNC::ECONFIG_NOTHING
#9  0x00000000005c464e in main (argc=2, argv=0x7fffffffe578) at src/main.cpp:414
        sa = {__sigaction_handler = {sa_handler = 0x5c3252 <die(int)>,
            sa_sigaction = 0x5c3252 <die(int)>}, sa_mask = {__val = {
              0 <repeats 16 times>}}, sa_flags = -2147483648,
          sa_restorer = 0x766df0 <__libc_csu_init>}
        iRet = 0
        bMakeConf = false
        sConfigError = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static CaseSensitive = CaseSensitivity::CaseSensitive,
          static CaseInsensitive = CaseSensitivity::CaseInsensitive}
        sConfig = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static CaseSensitive = CaseSensitivity::CaseSensitive,
          static CaseInsensitive = CaseSensitivity::CaseInsensitive}
        sDataDir = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static CaseSensitive = CaseSensitivity::CaseSensitive,
          static CaseInsensitive = CaseSensitivity::CaseInsensitive}
        iArg = -1
        iOptIndex = -1
        bMakePem = false
        pZNC = 0xa20940
        bMakePass = false
        bAllowRoot = false
        bForeground = true
***Description:*** Cloning users from a template user with pre-existing network and server configurations causes ZNC to crash once they start attempting to connect to IRC. ***Steps to reproduce:*** 1. Install ZNC normally (with debug symbols if you like) Bug presents in 1.6.1 and 1.6.3, haven't tested latest git. 2. Run ZNC, create your admin and template users 3. Make sure your template user has a network profile and server address that works 4. Clone the template user a couple times. Bug presents when the second clone attempts to connect to IRC. ***gdb log ([using the instructions found here](http://wiki.znc.in/Debugging))*** ``` Signal Stop Print Pass to program Description SIGPIPE No No Yes Broken pipe Starting program: /usr/local/bin/znc -D [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ffff409e700 (LWP 116631)] Program received signal SIGSEGV, Segmentation fault. 0x00000000005dad6c in CCron::Stop (this=0x0) at src/Csocket.cpp:738 738 src/Csocket.cpp: No such file or directory. #0 0x00000000005dad6c in CCron::Stop (this=0x0) at src/Csocket.cpp:738 No locals. #1 0x00000000005dadae in CCron::Reset (this=0x0) at src/Csocket.cpp:753 No locals. #2 0x000000000063bf3e in CIRCNetwork::JoinChans (this=0xa717d0) at src/IRCNetwork.cpp:866 idx = 0 pChan = 0xa6ccc0 a = 0 start = 0 uJoins = 0 sChans = std::__debug::set with 1 elements = {[0] = 0xa6ccc0} #3 0x000000000063ea1f in CIRCNetwork::IRCConnected (this=0xa717d0) at src/IRCNetwork.cpp:1256 No locals. #4 0x0000000000669ac2 in CIRCSock::ReadLine (this=0xa747b0, sData=...) at src/IRCSock.cpp:203 vClients = std::__debug::vector of length 0, capacity 0 sRest = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = ":Welcome to the StormBit IRC Network template_!template@bnc.stormbit.net", static CaseSensitive = CaseSensitivity::CaseSensitive, static CaseInsensitive = CaseSensitivity::CaseInsensitive} sTmp = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static CaseSensitive = CaseSensitivity::CaseSensitive, static CaseInsensitive = CaseSensitivity::CaseInsensitive} sServer = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "xfcab.stormbit.net", static CaseSensitive = CaseSensitivity::CaseSensitive, static CaseInsensitive = CaseSensitivity::CaseInsensitive} uRaw = 1 sNick = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "template_", static CaseSensitive = CaseSensitivity::CaseSensitive, static CaseInsensitive = CaseSensitivity::CaseInsensitive} sLine = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = ":xfcab.stormbit.net 001 template_ :Welcome to the StormBit IRC Network template_!template@bnc.stormbit.net", static CaseSensitive = CaseSensitivity::CaseSensitive, static CaseInsensitive = CaseSensitivity::CaseInsensitive} bReturn = false sCmd = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "001", static CaseSensitive = CaseSensitivity::CaseSensitive, static CaseInsensitive = CaseSensitivity::CaseInsensitive} #5 0x00000000005e17a2 in Csock::PushBuff (this=0xa747b0, data=0xa7ca70 ":xfcab.stormbit.net NOTICE Auth :Welcome to \002StormBit\002!\r\n:xfcab.stormbit.net 001 template_ :Welcome to the StormBit IRC Network template_!template@bnc.stormbit.net\r\n:xfcab.stormbit.net 002 template_ :"..., len=4096, bStartAtZero=false) at src/Csocket.cpp:2316 sUTF8 = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = ":xfcab.stormbit.net 001 template_ :Welcome to the StormBit IRC Network template_!template@bnc.stormbit.net\r\n", static CaseSensitive = CaseSensitivity::CaseSensitive, static CaseInsensitive = CaseSensitivity::CaseInsensitive} sBuff = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = ":xfcab.stormbit.net 001 template_ :Welcome to the StormBit IRC Network template_!template@bnc.stormbit.net\r\n", static CaseSensitive = CaseSensitivity::CaseSensitive, static CaseInsensitive = CaseSensitivity::CaseInsensitive} iFind = 107 iStartPos = 0 #6 0x00000000005e4eb5 in CSocketManager::Loop (this=0xa20a18) at src/Csocket.cpp:3364 iLen = 4096 cBuff = { m_pBuffer = 0xa7ca70 ":xfcab.stormbit.net NOTICE Auth :Welcome to \002StormBit\002!\r\n:xfcab.stormbit.net 001 template_ :Welcome to the StormBit IRC Network template_!template@bnc.stormbit.net\r\n:xfcab.stormbit.net 002 template_ :"...} bytes = 4096 pcSock = 0xa747b0 iErrno = CSocketManager::SUCCESS itSock = {first = , second = CSocketManager::SUCCESS} mpeSocks = std::__debug::map with 1 elements = { [0xa747b0] = CSocketManager::SUCCESS} iMilliNow = 1478582159735 #7 0x00000000005e532c in CSocketManager::DynamicSelectLoop (this=0xa20a18, iLowerBounds=100000, iUpperBounds=600000000, iMaxResolution=3600) at src/Csocket.cpp:3422 No locals. #8 0x00000000005fd045 in CZNC::Loop (this=0xa20940) at src/znc.cpp:221 sError = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static CaseSensitive = CaseSensitivity::CaseSensitive, static CaseInsensitive = CaseSensitivity::CaseInsensitive} eState = CZNC::ECONFIG_NOTHING #9 0x00000000005c464e in main (argc=2, argv=0x7fffffffe578) at src/main.cpp:414 sa = {__sigaction_handler = {sa_handler = 0x5c3252 <die(int)>, sa_sigaction = 0x5c3252 <die(int)>}, sa_mask = {__val = { 0 <repeats 16 times>}}, sa_flags = -2147483648, sa_restorer = 0x766df0 <__libc_csu_init>} iRet = 0 bMakeConf = false sConfigError = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static CaseSensitive = CaseSensitivity::CaseSensitive, static CaseInsensitive = CaseSensitivity::CaseInsensitive} sConfig = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static CaseSensitive = CaseSensitivity::CaseSensitive, static CaseInsensitive = CaseSensitivity::CaseInsensitive} sDataDir = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static CaseSensitive = CaseSensitivity::CaseSensitive, static CaseInsensitive = CaseSensitivity::CaseInsensitive} iArg = -1 iOptIndex = -1 bMakePem = false pZNC = 0xa20940 bMakePass = false bAllowRoot = false bForeground = true ``` <!-- github-sync-id:188161218 -->
adam closed this issue 2026-10-05 04:41:44 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#733