summary refs log tree commit diff stats
path: root/results/scraper/fex/186
diff options
context:
space:
mode:
Diffstat (limited to 'results/scraper/fex/186')
-rw-r--r--results/scraper/fex/18640
1 files changed, 40 insertions, 0 deletions
diff --git a/results/scraper/fex/186 b/results/scraper/fex/186
new file mode 100644
index 000000000..23cc5c6d9
--- /dev/null
+++ b/results/scraper/fex/186
@@ -0,0 +1,40 @@
+Ensure gettid == getpid
+Currently FEX doesn't maintain that gettid == getpid.

+This is noticed by some applications and confuses them.

+We should ensure that the guest application's primary thread is FEX's primary thread.

+The frontend should spin off its own worker threads instead.

+Alternatively we can return the primary's guest thread's tid for the getpid syscall, but I think that may cause issues in some cases?

+```cpp

+#include <stdio.h>

+#include <unistd.h>

+

+int main() {

+      pid_t pid = getpid();

+      pid_t tid = gettid();

+      if (pid != tid) {

+            printf("FAIL! Something is mucking with us! pid != tid ; %d != %d\n", pid, tid);

+      }

+      else {

+            printf("SUCCESS! TID == PID\n");

+      }

+      return 0;

+}

+```

+

+Real environment

+```bash

+ryanh@Ryan-TR2:~$ ./a.out

+SUCCESS! TID == PID

+```

+

+FEX

+```bash

+ryanh@Ryan-TR2:~/work/FEXNew/Build$ ./Bin/ELFLoader  -U -c irjit -n 500 -- ~/a.out

+[DEBUG] We installed 2314 instructions to the tables

+[DEBUG] Precompiling: 0 blocks...

+[DEBUG] Done

+FAIL! Something is mucking with us! pid != tid ; 30155 != 30157

+[DEBUG] Reason we left VM: 3

+[DEBUG] Used 1455012 bytes for compiling

+[DEBUG] Managed to load? No

+```
\ No newline at end of file