public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/100655] New: 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing
@ 2021-05-18 16:36 tschwinge at gcc dot gnu.org
  2021-05-18 17:41 ` [Bug testsuite/100655] " kingoipo at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2021-05-18 16:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100655

            Bug ID: 100655
           Summary: 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to
                    'pthread_cond_clockwait' missing
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: kingoipo at gmail dot com, marxin at gcc dot gnu.org
  Target Milestone: ---

This new testcase recently added in commit
r12-794-g80b4ce1a5190ebe764b1009afae57dcef45f92c2 "TSAN: add new test" FAILs on
one of my testing systems:

    +FAIL: g++.dg/tsan/pthread_cond_clockwait.C   -O0  (test for excess errors)
    +UNRESOLVED: g++.dg/tsan/pthread_cond_clockwait.C   -O0  compilation failed
to produce executable
    +FAIL: g++.dg/tsan/pthread_cond_clockwait.C   -O2  (test for excess errors)
    +UNRESOLVED: g++.dg/tsan/pthread_cond_clockwait.C   -O2  compilation failed
to produce executable

    [...]/gcc/testsuite/g++.dg/tsan/pthread_cond_clockwait.C: In function 'int
main()':
    [...]/gcc/testsuite/g++.dg/tsan/pthread_cond_clockwait.C:26:5: error:
'pthread_cond_clockwait' was not declared in this scope; did you mean
'pthread_cond_wait'?

Apparently 'pthread_cond_clockwait' has been added in glibc 2.30, released
2019-08-01.

Leave it as it is, or conditionalize the testcase in some way?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug testsuite/100655] 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing
  2021-05-18 16:36 [Bug testsuite/100655] New: 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing tschwinge at gcc dot gnu.org
@ 2021-05-18 17:41 ` kingoipo at gmail dot com
  2021-05-18 19:57 ` redi at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: kingoipo at gmail dot com @ 2021-05-18 17:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100655

--- Comment #1 from Michael de Lang <kingoipo at gmail dot com> ---
It'd be fairly trivial to wrap the test in an ifdef:
#ifdef __GLIBC__
#if (__GLIBC__ >= 2 && __GLIBC_MINOR__>= 30) || __GLIBC__>= 3

// test here

#endif
#endif

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug testsuite/100655] 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing
  2021-05-18 16:36 [Bug testsuite/100655] New: 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing tschwinge at gcc dot gnu.org
  2021-05-18 17:41 ` [Bug testsuite/100655] " kingoipo at gmail dot com
@ 2021-05-18 19:57 ` redi at gcc dot gnu.org
  2021-05-19  7:55 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2021-05-18 19:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100655

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
It's not glibc-specific though, it's going to be in the next POSIX standard and
other C libraries.

It's a bit of a hack, but you could include any libstdc++ header and then check
_GLIBCXX_USE_PTHREAD_COND_CLOCKWAIT (because libstdc++ already has autoconf
checks for it).

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug testsuite/100655] 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing
  2021-05-18 16:36 [Bug testsuite/100655] New: 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing tschwinge at gcc dot gnu.org
  2021-05-18 17:41 ` [Bug testsuite/100655] " kingoipo at gmail dot com
  2021-05-18 19:57 ` redi at gcc dot gnu.org
@ 2021-05-19  7:55 ` rguenth at gcc dot gnu.org
  2021-05-19 13:27 ` marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-05-19  7:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100655

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-05-19

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed, I also see this.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug testsuite/100655] 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing
  2021-05-18 16:36 [Bug testsuite/100655] New: 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing tschwinge at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-05-19  7:55 ` rguenth at gcc dot gnu.org
@ 2021-05-19 13:27 ` marxin at gcc dot gnu.org
  2021-05-19 14:07 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-05-19 13:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100655

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #2)
> It's not glibc-specific though, it's going to be in the next POSIX standard
> and other C libraries.
> 
> It's a bit of a hack, but you could include any libstdc++ header and then
> check _GLIBCXX_USE_PTHREAD_COND_CLOCKWAIT (because libstdc++ already has
> autoconf checks for it).

Can you please prepare such a patch?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug testsuite/100655] 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing
  2021-05-18 16:36 [Bug testsuite/100655] New: 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing tschwinge at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-05-19 13:27 ` marxin at gcc dot gnu.org
@ 2021-05-19 14:07 ` redi at gcc dot gnu.org
  2021-05-20  9:56 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2021-05-19 14:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100655

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
--- a/gcc/testsuite/g++.dg/tsan/pthread_cond_clockwait.C
+++ b/gcc/testsuite/g++.dg/tsan/pthread_cond_clockwait.C
@@ -4,6 +4,10 @@

 #include <pthread.h>

+// Include this to get the libstdc++ _GLIBCXX_USE_PTHREAD_COND_CLOCKWAIT
+// macro that indicates pthread_cond_clockwait is available.
+#include <type_traits>
+
 pthread_cond_t cv;
 pthread_mutex_t mtx;

@@ -23,7 +27,9 @@ int main() {
     struct timespec ts;
     clock_gettime(CLOCK_MONOTONIC, &ts);
     ts.tv_sec += 10;
+#ifdef _GLIBCXX_USE_PTHREAD_COND_CLOCKWAIT
     pthread_cond_clockwait(&cv, &mtx, CLOCK_MONOTONIC, &ts);
+#endif
     pthread_mutex_unlock(&mtx);

     pthread_join(tid, NULL);

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug testsuite/100655] 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing
  2021-05-18 16:36 [Bug testsuite/100655] New: 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing tschwinge at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-05-19 14:07 ` redi at gcc dot gnu.org
@ 2021-05-20  9:56 ` redi at gcc dot gnu.org
  2021-05-20 12:58 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2021-05-20  9:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100655

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug testsuite/100655] 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing
  2021-05-18 16:36 [Bug testsuite/100655] New: 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing tschwinge at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-05-20  9:56 ` redi at gcc dot gnu.org
@ 2021-05-20 12:58 ` redi at gcc dot gnu.org
  2021-05-20 18:50 ` bernd.edlinger at hotmail dot de
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2021-05-20 12:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100655

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
           Assignee|redi at gcc dot gnu.org            |unassigned at gcc dot gnu.org

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug testsuite/100655] 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing
  2021-05-18 16:36 [Bug testsuite/100655] New: 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing tschwinge at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2021-05-20 12:58 ` redi at gcc dot gnu.org
@ 2021-05-20 18:50 ` bernd.edlinger at hotmail dot de
  2021-11-11 20:12 ` msebor at gcc dot gnu.org
  2023-11-27  9:33 ` tschwinge at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: bernd.edlinger at hotmail dot de @ 2021-05-20 18:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100655

Bernd Edlinger <bernd.edlinger at hotmail dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bernd.edlinger at hotmail dot de

--- Comment #6 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
Jonathan,

what was the problem why you wanted to add the dg-shouldfail ?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug testsuite/100655] 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing
  2021-05-18 16:36 [Bug testsuite/100655] New: 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing tschwinge at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2021-05-20 18:50 ` bernd.edlinger at hotmail dot de
@ 2021-11-11 20:12 ` msebor at gcc dot gnu.org
  2023-11-27  9:33 ` tschwinge at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-11-11 20:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100655

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org
           Keywords|                            |build
   Last reconfirmed|2021-05-19 00:00:00         |2021-11-11

--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> ---
The test still fails to compile with today's top of trunk.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug testsuite/100655] 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing
  2021-05-18 16:36 [Bug testsuite/100655] New: 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing tschwinge at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2021-11-11 20:12 ` msebor at gcc dot gnu.org
@ 2023-11-27  9:33 ` tschwinge at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2023-11-27  9:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100655

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
           Assignee|unassigned at gcc dot gnu.org      |aoliva at gcc dot gnu.org
             Status|NEW                         |RESOLVED

--- Comment #8 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
PASSes as of commit r14-5476-gf5d94999ee6a7bd247c3d74959ebdd46334d7804
"testsuite: tsan: add fallback overload for pthread_cond_clockwait".

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-11-27  9:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 16:36 [Bug testsuite/100655] New: 'g++.dg/tsan/pthread_cond_clockwait.C' FAILs due to 'pthread_cond_clockwait' missing tschwinge at gcc dot gnu.org
2021-05-18 17:41 ` [Bug testsuite/100655] " kingoipo at gmail dot com
2021-05-18 19:57 ` redi at gcc dot gnu.org
2021-05-19  7:55 ` rguenth at gcc dot gnu.org
2021-05-19 13:27 ` marxin at gcc dot gnu.org
2021-05-19 14:07 ` redi at gcc dot gnu.org
2021-05-20  9:56 ` redi at gcc dot gnu.org
2021-05-20 12:58 ` redi at gcc dot gnu.org
2021-05-20 18:50 ` bernd.edlinger at hotmail dot de
2021-11-11 20:12 ` msebor at gcc dot gnu.org
2023-11-27  9:33 ` tschwinge at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).