Control: tags -1 + patch
Colin Watson writes ("Bug#772718: adns: test failure on Ubuntu ppc64el, with
-O3"):
> adns 1.5.0~rc1-1 fails to build on Ubuntu ppc64el; 1.4-2ubuntu1 (which
> was modified to use dh-autoreconf in order to build on newer
> architectures;
The attached patch should fix this. It is in the upstream git and
will be in the next upstream adns release. Indeed I may bring that
release forward.
I don't intend (with my Debian hat on) to upload this to Debian right
now since
- Debian is frozen for jessie
- The actual library and binaries are fine
- AFAIAA the test suite failure does not affect Debian itself
When Debian unfreezes, I will fix this with a new upstream version.
BTW, building with -O3 by default seems a bit mad. But IMO it ought
to work, so this is a real bug.
Thanks,
Ian.
commit d8fa191ed7774818862febd6ade774cb7e149ab9
Author: Ian Jackson <[email protected]>
Date: Wed Dec 10 23:16:37 2014 +0000
Fix for malicious optimisation of memcpy in test suite, which causes
failure with gcc-4.1.9 -O3. See Debian bug #772718.
diff --git a/changelog b/changelog
index a3e7dbb..fedd31a 100644
--- a/changelog
+++ b/changelog
@@ -1,6 +1,8 @@
adns (1.5.1~~) unstable; urgency=low
* Portability fix for systems where socklen_t is bigger than int.
+ * Fix for malicious optimisation of memcpy in test suite, which
+ causes failure with gcc-4.1.9 -O3. See Debian bug #772718.
--
diff --git a/regress/hcommon.c b/regress/hcommon.c
index ebbef94..e63a8cd 100644
--- a/regress/hcommon.c
+++ b/regress/hcommon.c
@@ -281,7 +281,7 @@ void *Hrealloc(void *op, size_t nsz) {
size_t osz;
if (op) { oldnode= (void*)((char*)op - MALLOCHSZ); osz= oldnode->sz; } else
{ osz= 0; }
np= Hmalloc(nsz);
- memcpy(np,op, osz>nsz ? nsz : osz);
+ if (osz) memcpy(np,op, osz>nsz ? nsz : osz);
Hfree(op);
return np;
}
diff --git a/regress/hcommon.c.m4 b/regress/hcommon.c.m4
index c5069ee..330da4d 100644
--- a/regress/hcommon.c.m4
+++ b/regress/hcommon.c.m4
@@ -301,7 +301,7 @@ void *Hrealloc(void *op, size_t nsz) {
if (op) { oldnode= (void*)((char*)op - MALLOCHSZ); osz= oldnode->sz; } else
{ osz= 0; }
np= Hmalloc(nsz);
- memcpy(np,op, osz>nsz ? nsz : osz);
+ if (osz) memcpy(np,op, osz>nsz ? nsz : osz);
Hfree(op);
return np;
}
--
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]