site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Apr 15, 2010, at 7:20 PM, Dave Keck wrote:
On i386 10.6, waitid() corrupts the stack, resulting in a crash (bug #7871139):
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?
The kernel is writing the wrong size value into your siginfo_t variable. It looks like it's writing the 64-bit version of siginfo_t, but your 32-bit process has a smaller siginfo_t type. (siginfo_t has pointer and longint fields that change size.) If you don't need the siginfo_t's values, you should be able to get away with passing a bigger buffer to waitid(). The 64-bit type is less than twice as big as the 32-bit type, so this should do the trick: siginfo_t info[2]; waitid(P_PID, pid, info, (WEXITED | WNOWAIT)); -- Greg Parker gparker@apple.com Runtime Wrangler _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Greg Parker