waitid() corrupts stack
waitid() corrupts stack
- Subject: waitid() corrupts stack
- From: Dave Keck <email@hidden>
- Date: Thu, 15 Apr 2010 16:20:03 -1000
Hey list,
On i386 10.6, waitid() corrupts the stack, resulting in a crash (bug #7871139):
=========================
// Compile using:
// gcc -arch i386 waitid_crash.c -o waitid_crash
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
void letscrashyay(pid_t pid)
{
siginfo_t info;
waitid(P_PID, pid, &info, (WEXITED | WNOWAIT));
}
int main()
{
pid_t pid = 0;
pid = fork();
if (!pid)
return execl("/bin/ls", "/bin/ls", NULL);
letscrashyay(pid);
return 0;
}
=========================
The program works when compiled for x86_64. Is waitid() safe to use
from 64-bit? Perhaps there's a workaround to use it under i386?
Thanks,
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden