Skip to content

Title: SIGSEGV crash with abstime=0x0 in pthread_cond_timedwait during tok->wait() #564

Description

@ravoshsamari

Description:
We're experiencing a reproducible crash in the Paho MQTT C++ library during MQTT connection establishment. The crash occurs in the tok->wait() function when waiting for MQTT connection completion.
Crash Details:
Signal: SIGSEGV (Segmentation fault)
Location: pthread_cond_timedwait with abstime=0x0 (NULL pointer)
Stack Trace:
#0 0x76c421e0 in _pthread_cond_timedwait (...)
#1 0x76c4256e in pthread_cond_wait (...)
#2 through #5: std::condition_variable::wait(...)
#6 mqtt::token::wait()
#7 Proxy::init (our application)
Root Cause Analysis:
The crash appears to be caused by signal interruption (likely SIGTERM) during the MQTT library's internal condition variable operations. When a signal interrupts std::condition_variable::wait(), it can corrupt the condition variable's internal state, leading to a NULL pointer being passed to pthread_cond_timedwait.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions