On x86, this compiles into movdqa which segfaults on unaligned access.
This kind of failure has been seen when running against glibc 2.39,
which incidentally changed the printf implementation to move away from
alloca() for this data to instead append it at the end of an existing
"scratch buffer", with arbitrary alignment, whereas alloca() was
probably more likely to be naturally aligned.
reported at /gcc.gnu. org/pipermail/ gcc-patches/ 2024-March/ 647635. html
https:/
On x86, this compiles into movdqa which segfaults on unaligned access.
This kind of failure has been seen when running against glibc 2.39,
which incidentally changed the printf implementation to move away from
alloca() for this data to instead append it at the end of an existing
"scratch buffer", with arbitrary alignment, whereas alloca() was
probably more likely to be naturally aligned.
Tested by adding the patch to the Ubuntu gcc-14 package in /launchpad. net/~schopin/ +archive/ ubuntu/ libquadmath
https:/
Signed-off-by: Simon Chopin <email address hidden> printf/ printf_ fp.c | 2 +-
---
libquadmath/
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libquadmath/ printf/ printf_ fp.c b/libquadmath/ printf/ printf_ fp.c .d86aa650d38 100644 printf/ printf_ fp.c printf/ printf_ fp.c printf_ fp (struct __quadmath_ printf_ file *fp,
index 8effcee88fa.
--- a/libquadmath/
+++ b/libquadmath/
@@ -363,7 +363,7 @@ __quadmath_
/* Fetch the argument value. */
{
- fpnum = **(const __float128 **) args[0];
+ memcpy(&fpnum, *(void* const *) args[0], sizeof(fpnum));
/* Check for special values: not a number or infinity. */
if (isnanq (fpnum))