Skip to content

Determinism tests fail if ASLR can't be disabled #3460

@stevenengler

Description

@stevenengler

The determinism tests are failing for me. They have been failing for a while:

$ ./setup test determinism
[...]
The following tests FAILED:
	42 - determinism1-compare-shadow (Failed)
	46 - determinism2-shadow-compare (Failed)

determinism1:

$ diff /shadow/build/src/test/determinism/determinism1a-shadow.data/hosts/testnode1/test-determinism.1000.strace /shadow/build/src/test/determinism/determinism1b-shadow.data/hosts/testnode1/test-determinism.1000.strace
12c12
< 00:00:01.000000000 [tid 1000] ioctl(3, 21505, 140732830198864) = -25 (ENOTTY)
---
> 00:00:01.000000000 [tid 1000] ioctl(3, 21505, 140736331501840) = -25 (ENOTTY)
17c17
< 00:00:01.000000000 [tid 1000] ioctl(3, 21505, 140732830198864) = -25 (ENOTTY)
---
> 00:00:01.000000000 [tid 1000] ioctl(3, 21505, 140736331501840) = -25 (ENOTTY)

determinism2:

$ diff /shadow/build/src/test/determinism/determinism2a-shadow.data/hosts/peer1/test-phold.1000.strace /shadow/build/src/test/determinism/determinism2b-shadow.data/hosts/peer1/test-phold.1000.strace
26c26
< 00:00:01.000000000 [tid 1000] futex(<pointer>, 129, 2147483647, <pointer>, <pointer>, 401523232) = 0
---
> 00:00:01.000000000 [tid 1000] futex(<pointer>, 129, 2147483647, <pointer>, <pointer>, 408764464) = 0

These look like pointers (but we don't know they're pointers because of the ioctl and futex syscalls).

Earlier I see:

00:00:00.194137 [70289:shadow] n/a [WARN] [n/a] [shadow.rs:180] [shadow_rs::shadow] Could not disable address space layout randomization. This may affect determinism: ENOSYS: Function not implemented

Stack backtrace:
   0: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
             at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.89/src/backtrace.rs:27:14
   1: shadow_rs::shadow::run_shadow
             at /shadow/src/main/shadow.rs:178:11
   2: main_runShadow
             at /shadow/src/main/shadow.rs:473:22
   3: main
             at /shadow/src/main/main.c:17:12
   4: __libc_start_call_main
   5: __libc_start_main@@GLIBC_2.34
   6: _start

It seems likely that ASLR isn't being disabled, so the pointers aren't deterministic in the strace.

Maybe we should make our determinism test better handle the case where ASLR can't be disabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: TestingUnit and integration tests and frameworksType: BugError or flaw producing unexpected results

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions