Menu

cppcheck main branch segfault nr2

Martin
2020-09-08
2020-09-08
  • Martin

    Martin - 2020-09-08

    Hi,

    cppcheck built from the main branch currently segfaults when run with "--enable=all" for the code below (stripped down to the minimum code required for the segfault to appear). The segfault disappears when the two INFO() lines are removed. INFO() is a logging macro.
    This does not happen for cppcheck2.1.

    Could you please check?

    Thanks,
    Martin

    Checking SessionWorker.cpp ...
    Segmentation fault (core dumped) .

    void SessionWorker::processSessionDataFinishReason()
    {
    if(m_SessionRetries < SESSION_RETRIES)
    {
    if(m_CurrentSession->isSessionSuccess())
    {
    std::string nextSession = s_NextSessionMap[m_CurrentSession->getSessionType()];
    if(nextSession.empty())
    {
    requestStopThread();
    }
    else
    {
    INFO(std::string{"Current session: "} + m_CurrentSession->getSessionType());
    INFO(std::string{"Next session: "} + nextSession);
    }
    }
    }
    }

     
  • Daniel Marjamäki

    Thanks! I can reproduce. I created ticket https://trac.cppcheck.net/ticket/9882

     

Log in to post a comment.