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 libc/20198] New: quick_exit incorrectly destroys C++11 thread objects.


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

            Bug ID: 20198
           Summary: quick_exit incorrectly destroys C++11 thread objects.
           Product: glibc
           Version: 2.25
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: johan.karlsson at enea dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

C++11 describes that quick_exit() should not destroy thread object but since
quick_exit in glibc shares functionality with exit() it accidentally does.

In short __call_tls_dtors() should not internally be called when calling
quick_exit().


The following example should not call abort:
#include <cstdlib>

struct A
{
  ~A() { abort(); }
};

thread_local A a;

int 
main()
{
  (void)a;

  // std::exit(0);
  // std::_Exit(0);
  std::quick_exit(0);

  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]