Bug 487055 - memcheck/tests/x86-linux/scalar fails running in Docker
Summary: memcheck/tests/x86-linux/scalar fails running in Docker
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (other bugs)
Version First Reported In: 3.24 GIT
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Paul Floyd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-15 12:37 UTC by Paul Floyd
Modified: 2025-10-18 11:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Floyd 2024-05-15 12:37:29 UTC
The end of the unfiltered log is

-----------------------------------------------------
 34:           __NR_nice 1s 0m
-----------------------------------------------------
==263012== Syscall param nice(inc) contains uninitialised byte(s)
==263012==    at 0x415AD57: syscall (in /usr/lib/libc-2.17.so)
==263012==    by 0x8049EC2: main (scalar.c:193)
==263012== 
scalar: scalar.c:193: main: Assertion `-1 != res' failed.

That means that ftime is not failing.

Probably a difference in the Docker virtualization.
Comment 1 Paul Floyd 2024-05-15 16:19:14 UTC
Out by one, it was 'nice' not 'ftime'. This patch works form me

--- a/memcheck/tests/x86-linux/scalar.c
+++ b/memcheck/tests/x86-linux/scalar.c
@@ -32,6 +32,11 @@ int main(void)
    long  x0  = px[0];
    long  res;
 
+   int in_docker = 0;
+   if (access("/.dockerenv", F_OK) == 0) {
+      in_docker = 1;
+   }
+
    // All __NR_xxx numbers are taken from x86
 
    // __NR_restart_syscall 0  // XXX: not yet handled, perhaps should be...
@@ -190,7 +195,12 @@ int main(void)
 
    // __NR_nice 34
    GO(__NR_nice, "1s 0m");
-   SY(__NR_nice, x0); SUCC;
+   SY(__NR_nice, x0);
+   if (in_docker) {
+      FAIL;
+   } else {
+      SUCC;
+   }
 
    // __NR_ftime 35
    GO(__NR_ftime, "ni");

(also need to update the expected).
Comment 2 Paul Floyd 2024-05-15 16:30:20 UTC
On second thoughts, just SUCC_OR_FAIL would be easier, but test a bit less.