Opened 10 years ago

Closed 10 years ago

#6315 closed bug (fixed)

[pthread] Unkillable thread

Reported by: Adek336 Owned by: axeld
Priority: normal Milestone: R1
Component: System/Kernel Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All


After reducing the testcase a lot, I ended up with

#include <iostream>
#include <pthread.h>
#include <stdlib.h>
#include <unistd.h>

pthread_cond_t ptcond;
pthread_mutex_t *ptmux;

void* fun(void*)

    while (true)
    for(;;) sleep(1000);

main(int argc, char *argv[])
    pthread_mutex_t ptm;
    ptmux = &ptm;
    pthread_t pt;
    pthread_create(&pt, 0, fun, 0);
    for(;;) sleep(100);

The main thread for this process is unkillable. Interestingly, sending SIGTERM, SIGINT or SIGKILL to the other thread kills the process.

Change History (5)

comment:1 by Adek336, 10 years ago

hrev37286, VBox 3.1, gcc4+2 hybrid

comment:2 by Adek336, 10 years ago

When ptm is made global, the thread is no longer unkillable.

comment:3 by anevilyak, 10 years ago

Component: - GeneralSystem/Kernel
Owner: changed from nobody to axeld
Version: R1/alpha2R1/Development

comment:4 by Adek336, 10 years ago

Reproducible in hrev36937, gcc4+2 hybrid, VBox 3.1; not reproducible in hrev36005, gcc4+2 hybrid, VBox 3.1.

comment:5 by bonefish, 10 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev37509.

Note: See TracTickets for help on using tickets.