Skip to content
Snippets Groups Projects
  • Nicolas Joly's avatar
    370e828e
    Fix scancel(1) uninitialized condition variable · 370e828e
    Nicolas Joly authored
    Still testing 16.05 on my NetBSD/amd64 workstation ...
    Just encountered a crash with scancel(1).
    njoly@lanfeust [~]> sbatch --wrap "sleep 3600"
    Submitted batch job 4680
    njoly@lanfeust [~]> scancel 4680
    scancel: Error detected by libpthread: Invalid condition variable.
    Detected by file "/local/src/NetBSD/src/lib/libpthread/pthread_cond.c", line 140, function "pthread_cond_timedwait".
    See pthread(3) for information.
    zsh: abort (core dumped)  scancel 4680
    Checking the code show indeed that pthread_cond_wait() call from scancel.c:_signal_job_by_str() use an uninitialised condition variable "num_active_threads_cond"
    The attached patch, which add the missing pthread_cond_init() seems to fix it.
    bug 2753
    370e828e
    History
    Fix scancel(1) uninitialized condition variable
    Nicolas Joly authored
    Still testing 16.05 on my NetBSD/amd64 workstation ...
    Just encountered a crash with scancel(1).
    njoly@lanfeust [~]> sbatch --wrap "sleep 3600"
    Submitted batch job 4680
    njoly@lanfeust [~]> scancel 4680
    scancel: Error detected by libpthread: Invalid condition variable.
    Detected by file "/local/src/NetBSD/src/lib/libpthread/pthread_cond.c", line 140, function "pthread_cond_timedwait".
    See pthread(3) for information.
    zsh: abort (core dumped)  scancel 4680
    Checking the code show indeed that pthread_cond_wait() call from scancel.c:_signal_job_by_str() use an uninitialised condition variable "num_active_threads_cond"
    The attached patch, which add the missing pthread_cond_init() seems to fix it.
    bug 2753