This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] hppa: Fix stack alignment passed to clone
On 2019-10-19 4:07 p.m., Florian Weimer wrote:
> I think an unaligned stack triggers undefined behavior, so a crash
> would be acceptable in this context. We could maybe add an assert to
> the thread creation (although that will cause backwards compatibility
> concerns on i386 due to the silent ABI change for SSE2).
The pthread_create() function is supposed to return EINVAL if the attributes specified by
the attr argument are invalid. The Open Group specification doesn't say a crash is acceptable
behavior. We don't actually have a "stack" at this point. We have a pointer to memory to
be used as the stack for the new thread.
As I see it, we have two alternatives in the hppa __clone() implementation:
1) Return EINVAL when passed a misaligned pointer, or
2) Align the pointer.
Dave
--
John David Anglin dave.anglin@bell.net