[Bug sanitizer/48076] Unsafe double checked locking in __emutls_get_address

2012-11-28 Thread torvald at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48076 --- Comment #7 from torvald at gcc dot gnu.org 2012-11-28 14:29:47 UTC --- (In reply to comment #6) > There seems to be a similar bug in code generated for function static > variables. > The fast-path load is a plain load rather than atomic

[Bug sanitizer/48076] Unsafe double checked locking in __emutls_get_address

2012-11-27 Thread dvyukov at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48076 --- Comment #6 from Dmitry Vyukov 2012-11-28 03:56:50 UTC --- There seems to be a similar bug in code generated for function static variables. The fast-path load is a plain load rather than atomic acquire load. On Sat, Nov 24, 2012 at 3

[Bug sanitizer/48076] Unsafe double checked locking in __emutls_get_address

2012-11-27 Thread dvyukov at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48076 Dmitry Vyukov changed: What|Removed |Added CC||dvyukov at google dot com --- C

[Bug sanitizer/48076] Unsafe double checked locking in __emutls_get_address

2012-11-27 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48076 --- Comment #4 from Richard Henderson 2012-11-27 22:05:34 UTC --- Created attachment 28798 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28798 proposed patch This should fix the race that I eventually saw (read), as well as one th

[Bug sanitizer/48076] Unsafe double checked locking in __emutls_get_address

2012-11-27 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48076 Richard Henderson changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed|

[Bug sanitizer/48076] Unsafe double checked locking in __emutls_get_address

2012-11-27 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48076 --- Comment #2 from Richard Henderson 2012-11-27 18:01:17 UTC --- Are you sure this isn't a false-positive? The way I read this code, it is certainly possible for the optimizer (or the processor) to prefetch emutls_key before the load of