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/18435] pthread_once hangs when init routine throws an exception


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

--- Comment #1 from Martin Sebor <msebor at redhat dot com> ---
Created attachment 8326
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8326&action=edit
Proposed patch tested on powerpc64le and x86_64.

The attached patch fixes the problem by replacing the problematic
pthread_cleanup_push and pthread_cleanup_pop macros with a cleanup handler.

2015-05-19  Martin Sebor  <msebor@redhat.com>

        * nptl/pthread_once (CleanupInfo): New struct.
        (clear_once_control): Replace...
        (cleanup_maybe_clear_once_control): ...with this.
        (__pthread_once_slow): Replace calls to pthread_cleanup_push and
        pthread_cleanup_pop with a cleanup object of struct CleanupInfo .
        * nptl/tst-once5.cc: New test.

-- 
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]