Bug 487055 - memcheck/tests/x86-linux/scalar fails running in Docker
Summary: memcheck/tests/x86-linux/scalar fails running in Docker
Status: RESOLVED FIXED
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-26 08:16 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented 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.
Comment 3 Paul Floyd 2025-10-26 08:16:22 UTC
Doesn't seem to have fixed the nightly failures, plus this added a stupid typo causing a few failures.

commit 4ccb893e7b35e63060e717aa34dc51aecb73b9f2
Author: Paul Floyd <pjfloyd@wanadoo.fr>
Date:   Sat Oct 25 17:56:50 2025 +0200

    Bug 487055 - memcheck/tests/x86-linux/scalar fails running in Docker
    
    Also move to 3.27.0.GIT.
    
    Will this fix some of the failures in the nightly tests?