Subject: amd64 alignment problem - gcc's fault or libpthread's?
To: None <email@example.com, firstname.lastname@example.org>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
Date: 02/27/2004 17:02:24
This is a multipart MIME message.
Content-Type: text/plain; charset=us-ascii
I've found that programs using "va_start" occasionally
dump core because the vararg code involves "movaps"
instructions, but the stack location is not aliged
properly (needs 16-byte alignment).
I've submitted a bug report to gcc about this (c/14321).
Now, after thinking about it, I'm not quite sure
anymore that this is really gcc's fault.
I could only trigger the problem if the vararg using
code is called from a thread. I don't know the ABI
requirements, but in case a 16-byte stack alignment
is required, and our libpthread doesn't ensure it,
it would be libpthread's fault.
I'll append a small test program which coredumps for me.
Can anyone tell me what stack alignment is required by
the ABI, before I further accuse gcc?
Content-Type: text/plain ; name="fptest.c"; charset=us-ascii
Content-Disposition: attachment; filename="fptest.c"
sprintf(buf, "%.*g\n", 12, 1.234);
pthread_create(&t, 0, thr, 0);