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/17403] New: atomic_full_barrier is incorrect for x86 and x86_64


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

            Bug ID: 17403
           Summary: atomic_full_barrier is incorrect for x86 and x86_64
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: triegel at redhat dot com
                CC: drepper.fsp at gmail dot com

atomic_full_barrier on these archs currently is just a compiler barrier,
whereas it should use mfence to be an actual full barrier.

This bug doesn't seem to cause incorrect behavior currently:
* nptl/pthread_mutex_setprioceiling.c has a full barrier immediately followed
by a futex syscall, which is a full barrier too effectively.
* sysdeps/nptl/fork.c seems to only need an acquire barrier, so on x86 the
current compiler-only barrier that the full barrier will result in is
sufficient.
* Other generic code that uses full barriers (eg, sem_post) currently has
custom asm versions on x86/x86_64.  However, once we remove those, the lack of
a correct full barrier will be a bug.

Nonetheless, I think we need to fix the full barriers as soon as we add other
code that uses atomic_full_barrier and is used on x86/x86_64.

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