Skip to contentSkip to conversation

meson: add missing semicolon in pthread_condattr_setclock test

PATCH Applied Stepan Popov 6 participants 8 messages Mar 30 Arm/Amlogic Meson SoC support

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meson: add missing semicolon in pthread_condattr_setclock test

The test code was missing a semicolon after the pthread_condattr_t variable declaration.

---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
index d7c4095b39..5447504ea8 100644
@@ -2882,7 +2882,7 @@ config_host_data.set('CONFIG_PTHREAD_CONDATTR_SETCLOCK', cc.links(osdep_prefix +
 
   int main(void)
   {
-    pthread_condattr_t attr
+    pthread_condattr_t attr;
     pthread_condattr_init(&attr);
     pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
     return 0;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

Hi

Quoted 5 lines · Stepan Popov

The test code was missing a semicolon after the pthread_condattr_t variable declaration.

Fixes 657ac98b58 ("thread-posix: use monotonic clock for QemuCond and

QemuSemaphore")

Quoted 20 lines
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -2
index d7c4095b39..5447504ea8 100644
@@ -2882,7 +2882,7 @@ config_host_data.set('CONFIG_PTHREAD_CONDATTR_SETCLOCK', cc.links(osdep_prefix +
 
   int main(void)
   {
-    pthread_condattr_t attr
+    pthread_condattr_t attr;
     pthread_condattr_init(&attr);
     pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
     return 0;
--

2.34.1

#2 lore raw
Quoted 11 lines · Marc-André Lureau

Hi

Quoted 5 lines · Stepan Popov

The test code was missing a semicolon after the pthread_condattr_t variable declaration.

Fixes 657ac98b58 ("thread-posix: use monotonic clock for QemuCond and

QemuSemaphore")

IOW, that commit has been dead code since it was first added years ago, we've never used the monotonic clock

Quoted 12 lines
Quoted 10 lines
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +0 -0
index d7c4095b39..5447504ea8 100644
@@ -2882,7 +2882,7 @@ config_host_data.set('CONFIG_PTHREAD_CONDATTR_SETCLOCK', cc.links(osdep_prefix +
 
Quoted 11 lines
Quoted 10 lines
meson.build +1 -2
   int main(void)
   {
-    pthread_condattr_t attr
+    pthread_condattr_t attr;
     pthread_condattr_init(&attr);
     pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
     return 0;
--

2.34.1

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|
#3 lore raw
Quoted 9 lines · Daniel P. Berrangé
Quoted 7 lines · Marc-André Lureau

Hi

Quoted 4 lines · Stepan Popov

The test code was missing a semicolon after the pthread_condattr_t variable declaration.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Fixes 657ac98b58 ("thread-posix: use monotonic clock for QemuCond and

QemuSemaphore")

IOW, that commit has been dead code since it was first added years ago, we've never used the monotonic clock

Yes. So are we confident enough in that never-tested feature to want to enable it at this point in the release cycle, or should we hold off on this bugfix until 11.1 ?

-- PMM

#4 lore raw
Quoted 15 lines · Peter Maydell
Quoted 14 lines · Daniel P. Berrangé
Quoted 11 lines · Marc-André Lureau

Hi

Quoted 5 lines · Stepan Popov

The test code was missing a semicolon after the pthread_condattr_t variable declaration.

Fixes 657ac98b58 ("thread-posix: use monotonic clock for QemuCond and

QemuSemaphore")

Quoted 6 lines
Quoted 2 lines

IOW, that commit has been dead code since it was first added years ago, we've never used the monotonic clock

Yes. So are we confident enough in that never-tested feature to want to enable it at this point in the release cycle, or should we hold off on this bugfix until 11.1 ?

IMHO waiting until 11.1 is the prudent approach. This is not a regression fix and clearly no one noticed it wasn't doing anything for 3 years since it was introduced, so fixing it can't be that urgent ?

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|
#5 lore raw
In reply to Peter Maydell
Quoted 6 lines · Peter Maydell
Quoted 2 lines

IOW, that commit has been dead code since it was first added years ago, we've never used the monotonic clock

Yes. So are we confident enough in that never-tested feature to want to enable it at this point in the release cycle, or should we hold off on this bugfix until 11.1 ?

In practice the difference between the two is almost always unnoticeable. Because it affects pthread_cond_timedwait, the only difference would mean making a timeout slighly shorter or longer... and just once. It's just unaesthetic to use CLOCK_REALTIME instad of CLOCK_MONOTONIC.

Paolo

Reviewed-by on v1 1/1
#6 lore raw
In reply to Stepan Popov
Quoted 13 lines · Stepan Popov

The test code was missing a semicolon after the pthread_condattr_t variable declaration.

---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +0 -0
index d7c4095b39..5447504ea8 100644

meson.build config_host_data.set('CONFIG_PTHREAD_CONDATTR_SETCLOCK', cc.links(osdep_prefix + · line 2888

Quoted 8 lines
meson.build +1 -1
@@ -2882,7 +2882,7 @@ config_host_data.set('CONFIG_PTHREAD_CONDATTR_SETCLOCK', cc.links(osdep_prefix +
 
   int main(void)
   {
-    pthread_condattr_t attr
+    pthread_condattr_t attr;
     pthread_condattr_init(&attr);
     pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
     return 0;

Good catch:

I guess we've just been silently failing that test since it was introduced then?

Cached compiler stderr:
/home/alex/lsrc/qemu.git/builds/all/meson-private/tmpy5s2fh25/testfile.c: In function 'main':
/home/alex/lsrc/qemu.git/builds/all/meson-private/tmpy5s2fh25/testfile.c:23:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pthread_condattr_init'

     23 |     pthread_condattr_init(&attr);
        |     ^~~~~~~~~~~~~~~~~~~~~
  /home/alex/lsrc/qemu.git/builds/all/meson-private/tmpy5s2fh25/testfile.c:23:28: error: 'attr' undeclared (first use in this function)
     23 |     pthread_condattr_init(&attr);
        |                            ^~~~

/home/alex/lsrc/qemu.git/builds/all/meson-private/tmpy5s2fh25/testfile.c:23:28: note: each undeclared identifier is reported only once for each function it appears in

Using cached compile:
Cached command line: cc -m64 /home/alex/lsrc/qemu.git/builds/all/meson-private/tmppx1fde_i/testfile.c -o /home/alex/lsrc/qemu.git/builds/all/meson-private/tmppx1fde_i/output.exe -pthread -D_FILE_OFFSET_BITS=64 -O0 -std=gnu11

So maybe:

Fixes 657ac98b58c (thread-posix: use monotonic clock for QemuCond and QemuSemaphore)
Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro