diff --git a/src/platform/x86_64/ipc/signal.c b/src/platform/x86_64/ipc/signal.c index 26621fa..05d6351 100644 --- a/src/platform/x86_64/ipc/signal.c +++ b/src/platform/x86_64/ipc/signal.c @@ -24,8 +24,23 @@ int platformSignalSetup(Thread *t) { void *trampoline = uxmalloc(sigstubSize); if(!trampoline) return -1; + void *siginfo = umalloc(sizeof(siginfo_t)); + if(!siginfo) { + free(trampoline); + return -1; + } + + void *sigctx = umalloc(PLATFORM_CONTEXT_SIZE); + if(!sigctx) { + free(trampoline); + free(siginfo); + return -1; + } + memcpy(trampoline, sigstub, sigstubSize); t->signalTrampoline = (uintptr_t) trampoline; + t->siginfo = (uintptr_t) siginfo; + t->signalUserContext = (uintptr_t) sigctx; return 0; }