* [Bug libstdc++/39909] non-TLS version of std::call_once causes terminate
2009-04-26 13:51 [Bug libstdc++/39909] New: non-TLS version of std::call_once causes terminate jwakely dot gcc at gmail dot com
@ 2009-04-26 14:28 ` paolo dot carlini at oracle dot com
2009-04-26 17:40 ` jwakely dot gcc at gmail dot com
` (8 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-04-26 14:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from paolo dot carlini at oracle dot com 2009-04-26 14:28 -------
Just in case Chris wants to help with this.
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |cfairles at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39909
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/39909] non-TLS version of std::call_once causes terminate
2009-04-26 13:51 [Bug libstdc++/39909] New: non-TLS version of std::call_once causes terminate jwakely dot gcc at gmail dot com
2009-04-26 14:28 ` [Bug libstdc++/39909] " paolo dot carlini at oracle dot com
@ 2009-04-26 17:40 ` jwakely dot gcc at gmail dot com
2009-04-26 17:53 ` paolo dot carlini at oracle dot com
` (7 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: jwakely dot gcc at gmail dot com @ 2009-04-26 17:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from jwakely dot gcc at gmail dot com 2009-04-26 17:40 -------
Created an attachment (id=17707)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17707&action=view)
fix call_once without breaking ABI
Fix call_once to not use the global lock object, but retain the global for ABI
reasons.
__once_proxy detects if it was called by new code that provides the address of
a local lock object, or by old code that uses the global lock.
Without that check any uses of call_once inlined in old objects will be liable
to deadlock (because the global lock won't be unlocked before invoking the
functor) or segfaults (if the pointer is null when __once_proxy uses it).
Multiple concurrent calls to call_once from old object code will still
terminate, but it should be OK for new object code to use call_once freely, and
even for exactly one thread using the old call_once to run concurrently with
new code using call_once (because there would only be the single thread using
the global lock object.)
This patch adds the new symbols to the GLIBCXX_3.4.11 version but they should
be in a new 3.4.12 block - I don't know what I need to do for that.
Tested x86_64/linux --disable-tls
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39909
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/39909] non-TLS version of std::call_once causes terminate
2009-04-26 13:51 [Bug libstdc++/39909] New: non-TLS version of std::call_once causes terminate jwakely dot gcc at gmail dot com
2009-04-26 14:28 ` [Bug libstdc++/39909] " paolo dot carlini at oracle dot com
2009-04-26 17:40 ` jwakely dot gcc at gmail dot com
@ 2009-04-26 17:53 ` paolo dot carlini at oracle dot com
2009-04-26 17:53 ` paolo dot carlini at oracle dot com
` (6 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-04-26 17:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from paolo dot carlini at oracle dot com 2009-04-26 17:53 -------
Thanks Jon, for following up about this. Let's try to close the issue during
the next days...
About 3.4.12, it's just matter of manually editing gnu.ver, adding the block +
manually adding GLIBCXX_3.4.12 to testsuite_abi.cc. Then regression testing
should still succeed after the changes.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39909
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/39909] non-TLS version of std::call_once causes terminate
2009-04-26 13:51 [Bug libstdc++/39909] New: non-TLS version of std::call_once causes terminate jwakely dot gcc at gmail dot com
` (2 preceding siblings ...)
2009-04-26 17:53 ` paolo dot carlini at oracle dot com
@ 2009-04-26 17:53 ` paolo dot carlini at oracle dot com
2009-04-26 18:06 ` jwakely dot gcc at gmail dot com
` (5 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-04-26 17:53 UTC (permalink / raw)
To: gcc-bugs
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-04-26 17:53:15
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39909
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/39909] non-TLS version of std::call_once causes terminate
2009-04-26 13:51 [Bug libstdc++/39909] New: non-TLS version of std::call_once causes terminate jwakely dot gcc at gmail dot com
` (3 preceding siblings ...)
2009-04-26 17:53 ` paolo dot carlini at oracle dot com
@ 2009-04-26 18:06 ` jwakely dot gcc at gmail dot com
2009-04-26 21:39 ` jwakely dot gcc at gmail dot com
` (4 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: jwakely dot gcc at gmail dot com @ 2009-04-26 18:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jwakely dot gcc at gmail dot com 2009-04-26 18:06 -------
Created an attachment (id=17709)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17709&action=view)
use GLIBCXX_3.4.12 version for new symbols
same patch again, with the new symbols using a new version and testsuite
changes included
--
jwakely dot gcc at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #17707|0 |1
is obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39909
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/39909] non-TLS version of std::call_once causes terminate
2009-04-26 13:51 [Bug libstdc++/39909] New: non-TLS version of std::call_once causes terminate jwakely dot gcc at gmail dot com
` (4 preceding siblings ...)
2009-04-26 18:06 ` jwakely dot gcc at gmail dot com
@ 2009-04-26 21:39 ` jwakely dot gcc at gmail dot com
2009-04-29 9:18 ` paolo dot carlini at oracle dot com
` (3 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: jwakely dot gcc at gmail dot com @ 2009-04-26 21:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jwakely dot gcc at gmail dot com 2009-04-26 21:39 -------
(In reply to comment #4)
> same patch again, with the new symbols using a new version and testsuite
> changes included
passes all regression tests both with and without tls
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39909
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/39909] non-TLS version of std::call_once causes terminate
2009-04-26 13:51 [Bug libstdc++/39909] New: non-TLS version of std::call_once causes terminate jwakely dot gcc at gmail dot com
` (5 preceding siblings ...)
2009-04-26 21:39 ` jwakely dot gcc at gmail dot com
@ 2009-04-29 9:18 ` paolo dot carlini at oracle dot com
2009-05-05 21:33 ` redi at gcc dot gnu dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-04-29 9:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from paolo dot carlini at oracle dot com 2009-04-29 09:17 -------
Jon, patch looks generally good to me, can you please send it to the mailing
list for higher visibility? Then we can commit it and close this annoying issue
once and for all ;)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39909
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/39909] non-TLS version of std::call_once causes terminate
2009-04-26 13:51 [Bug libstdc++/39909] New: non-TLS version of std::call_once causes terminate jwakely dot gcc at gmail dot com
` (6 preceding siblings ...)
2009-04-29 9:18 ` paolo dot carlini at oracle dot com
@ 2009-05-05 21:33 ` redi at gcc dot gnu dot org
2009-05-05 21:44 ` redi at gcc dot gnu dot org
2009-05-05 22:14 ` jwakely dot gcc at gmail dot com
9 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu dot org @ 2009-05-05 21:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from redi at gcc dot gnu dot org 2009-05-05 21:33 -------
Subject: Bug 39909
Author: redi
Date: Tue May 5 21:32:38 2009
New Revision: 147137
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147137
Log:
2009-05-05 Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/39909
* include/std/mutex (__get_once_functor_lock, __get_once_mutex,
__set_once_functor_lock_ptr): Replace global lock object with local
locks on global mutex.
* src/mutex.cc (__get_once_functor_lock, __get_once_mutex,
__set_once_functor_lock_ptr): Likewise, keeping old function to
preserve ABI.
(__once_proxy): Use pointer to local lock if set, global lock
otherwise.
* config/abi/pre/gnu.ver: Add new symbols to new ABI version.
* testsuite/util/testsuite_abi.cc: Add GLIBCX_3.4.12 version.
* testsuite/30_threads/call_once/39909.cc: New.
Added:
trunk/libstdc++-v3/testsuite/30_threads/call_once/39909.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/config/abi/pre/gnu.ver
trunk/libstdc++-v3/include/std/mutex
trunk/libstdc++-v3/src/mutex.cc
trunk/libstdc++-v3/testsuite/util/testsuite_abi.cc
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39909
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/39909] non-TLS version of std::call_once causes terminate
2009-04-26 13:51 [Bug libstdc++/39909] New: non-TLS version of std::call_once causes terminate jwakely dot gcc at gmail dot com
` (7 preceding siblings ...)
2009-05-05 21:33 ` redi at gcc dot gnu dot org
@ 2009-05-05 21:44 ` redi at gcc dot gnu dot org
2009-05-05 22:14 ` jwakely dot gcc at gmail dot com
9 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu dot org @ 2009-05-05 21:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from redi at gcc dot gnu dot org 2009-05-05 21:44 -------
Subject: Bug 39909
Author: redi
Date: Tue May 5 21:44:27 2009
New Revision: 147138
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147138
Log:
2009-05-05 Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/39909
* include/std/mutex (__get_once_functor_lock, __get_once_mutex,
__set_once_functor_lock_ptr): Replace global lock object with local
locks on global mutex.
* src/mutex.cc (__get_once_functor_lock, __get_once_mutex,
__set_once_functor_lock_ptr): Likewise, keeping old function to
preserve ABI.
(__once_proxy): Use pointer to local lock if set, global lock
otherwise.
* config/abi/pre/gnu.ver: Add new symbols to new ABI version.
* testsuite/util/testsuite_abi.cc: Add GLIBCX_3.4.12 version.
* testsuite/30_threads/call_once/39909.cc: New.
Added:
branches/gcc-4_4-branch/libstdc++-v3/testsuite/30_threads/call_once/39909.cc
Modified:
branches/gcc-4_4-branch/libstdc++-v3/ChangeLog
branches/gcc-4_4-branch/libstdc++-v3/config/abi/pre/gnu.ver
branches/gcc-4_4-branch/libstdc++-v3/include/std/mutex
branches/gcc-4_4-branch/libstdc++-v3/src/mutex.cc
branches/gcc-4_4-branch/libstdc++-v3/testsuite/util/testsuite_abi.cc
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39909
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/39909] non-TLS version of std::call_once causes terminate
2009-04-26 13:51 [Bug libstdc++/39909] New: non-TLS version of std::call_once causes terminate jwakely dot gcc at gmail dot com
` (8 preceding siblings ...)
2009-05-05 21:44 ` redi at gcc dot gnu dot org
@ 2009-05-05 22:14 ` jwakely dot gcc at gmail dot com
9 siblings, 0 replies; 12+ messages in thread
From: jwakely dot gcc at gmail dot com @ 2009-05-05 22:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from jwakely dot gcc at gmail dot com 2009-05-05 22:14 -------
Fixed for 4.5.0 and 4.4.1
--
jwakely dot gcc at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39909
^ permalink raw reply [flat|nested] 12+ messages in thread