浏览代码

UserspaceEmulator: Default-initialize the siginfo struct used in waitid

Otherwise it'll have some random value from the stack, and the kernel
will not bother setting it to zero.
Also add a debug print and tweak the FIXME message.
AnotherTest 4 年之前
父节点
当前提交
cbd62c472e
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp

+ 3 - 2
Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp

@@ -1358,7 +1358,7 @@ int Emulator::virt$waitid(FlatPtr params_addr)
     mmu().copy_from_vm(&params, params_addr, sizeof(params));
     mmu().copy_from_vm(&params, params_addr, sizeof(params));
 
 
     Syscall::SC_waitid_params host_params = params;
     Syscall::SC_waitid_params host_params = params;
-    siginfo info;
+    siginfo info {};
     host_params.infop = &info;
     host_params.infop = &info;
 
 
     int rc = syscall(SC_waitid, &host_params);
     int rc = syscall(SC_waitid, &host_params);
@@ -1366,7 +1366,8 @@ int Emulator::virt$waitid(FlatPtr params_addr)
         return rc;
         return rc;
 
 
     if (info.si_addr) {
     if (info.si_addr) {
-        // FIXME: Translate this somehow.
+        // FIXME: Translate this somehow once we actually start setting it in the kernel.
+        dbgln("si_addr is set to {:p}, I did not expect this!", info.si_addr);
         TODO();
         TODO();
     }
     }