summary refs log tree commit diff stats
path: root/gitlab/issues/target_missing/host_missing/accel_missing/929.toml
blob: 40603a068ebc9a7076e1bfe6dcb38062b8663a8a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
id = 929
title = "qemu-user syscall clone fails"
state = "closed"
created_at = "2022-03-22T20:08:51.061Z"
closed_at = "2022-03-23T00:25:03.539Z"
labels = []
url = "https://gitlab.com/qemu-project/qemu/-/issues/929"
host-os = "Linux"
host-arch = "x86_64"
qemu-version = "6.2.0` and `6.2.90 (v7.0.0-rc0-52-g330724977b)"
guest-os = "n/a"
guest-arch = "n/a"
description = """This seems very similar to the issue reported here (https://bugs.launchpad.net/qemu/+bug/1926996). When attempting to perform the clone syscall, an error of -1 is returned where I would expect it to succeed. Running the same executable outside of qemu works as expected."""
reproduce = """1. gcc clone.c
2. qemu-x86_64 a.out"""
additional = """I've tried building with gcc, zig cc, and clang and the output of each works fine when running natively, but running under qemu fails. I originally discovered it when cross compiling to riscv64 but it doesn't seem to be limited to that architecture.

```
// clone.c

#include <linux/sched.h>
#include <sched.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <stdio.h>

int main(void) {

  long pid = syscall( SYS_clone, 0, 0, 0, 0, 0 );

  if (pid < 0) {
    printf( "error %ld\\n", pid );
  } else if (pid == 0) {
    printf( "child %ld\\n", pid );
  } else {
    printf( "parent %ld\\n", pid );
  }

  return 0;
}
```"""