This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/20813] New: pthread_exit is inconsistent between libc and libpthread


https://sourceware.org/bugzilla/show_bug.cgi?id=20813

            Bug ID: 20813
           Summary: pthread_exit is inconsistent between libc and
                    libpthread
           Product: glibc
           Version: 2.23
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: nptl
          Assignee: unassigned at sourceware dot org
          Reporter: suckfish at ihug dot co.nz
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

The single-threaded C++ program below compiles with or without -lpthread, but
behaves differently.

The issue appears to be that libc.so provides an implementation of
pthread_exit() that does not do stack-unwinding, but the libpthread.so version
does do stack unwinding.

I believe that either behaviour complies with the standards, but it would be
nice if glibc was consistent in its behaviour.

$ g++ -o temp temp.cc -pthread && ./temp
Hi there!
$ g++ -o temp temp.cc && ./temp
(no output)

This is Fedora glibc-2.23.1-10.fc24.x86_64

-----------------------------

#include <pthread.h>
#include <stdio.h>

struct Foo {
    ~Foo() {
        printf("Hi there!\n");
    }
};

int main()
{
    Foo foo;
    pthread_exit(NULL);
    return 0;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]