Bug#846731: Bug#775434: Bug#846731: Bug#775434: libbio-scf-perl: FTBFS on mips64el, ppc64el, s390x - tests

2016-12-06 Thread gregor herrmann
On Wed, 07 Dec 2016 00:11:25 +0200, Niko Tyni wrote:

> The attached patch fixes this for me on sid/amd64.
> 
> Eyeballs and/or testing would be welcome. Tagging just #846731 for now,
> but I expect the bugs are about the same issue and should probably
> be merged.

I can confirm that with this patch the build failures I've been
seeing goes away.


Cheers,
gregor

-- 
 .''`.  https://info.comodo.priv.at/ - Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   NP: B.B. King and Eric Clapton


signature.asc
Description: Digital Signature


Bug#846731: Bug#775434: libbio-scf-perl: FTBFS on mips64el, ppc64el, s390x - tests

2016-12-06 Thread Niko Tyni
tag 846731 patch
thanks

On Sun, Dec 04, 2016 at 05:52:10PM +0200, Niko Tyni wrote:
> On Sat, Dec 03, 2016 at 04:40:53PM +0100, gregor herrmann wrote:
> > On Wed, 26 Oct 2016 13:26:42 +0100, Iain Lane wrote:
> > 
> > > On Thu, Jan 15, 2015 at 05:17:10PM +, James Cowgill wrote:
> > 
> > > > libbio-scp-perl FTBFS on mips64el, ppc64el, and s390x with similar
> > > > testsuite failures:
> > 
> > > > Although I haven't investigated this, the build produces many pointer
> > > > casting warnings which seem likely to have caused these errors:
> > > > 
> > > > SCF.xs: In function 'XS_Bio__SCF_get_scf_pointer':
> > > > SCF.xs:57:20: warning: cast from pointer to integer of different size 
> > > > [-Wpointer-to-int-cast]
> > > >   ret_val = newSViv((int)scf_data);

> GCC started to default to PIE between the latest perl upload and the
> one before that. I think that made it use different memory locations,
> so the cast to int now overflows.

The attached patch fixes this for me on sid/amd64.

Eyeballs and/or testing would be welcome. Tagging just #846731 for now,
but I expect the bugs are about the same issue and should probably
be merged.
-- 
Niko Tyni   nt...@debian.org
>From 5e57fc339478e5204d0465b63ff5a5e927a565ad Mon Sep 17 00:00:00 2001
From: Niko Tyni 
Date: Wed, 7 Dec 2016 00:02:25 +0200
Subject: [PATCH] Fix overflowing casts from pointer to integer

This fixes test failures on 64-bit platforms using memory addresses over
2**32, like those where Perl is built as PIE (position independent
executable).

Bug-Debian: https://bugs.debian.org/846731
---
 SCF.xs | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/SCF.xs b/SCF.xs
index a55879b..10a88bd 100644
--- a/SCF.xs
+++ b/SCF.xs
@@ -54,7 +54,7 @@ char *file_name
 	/* Reading SCF file, into internal structure */
 	if ( (scf_data = read_scf(file_name)) == NULL )
 		croak("get_scf_pointer(...) : failed on read_scf(%s)\n", file_name);
-	ret_val = newSViv((int)scf_data);
+	ret_val = newSViv(PTR2IV(scf_data));
 	RETVAL = ret_val;
 	OUTPUT:
 	RETVAL
@@ -77,20 +77,20 @@ FILE *file_handle
 	croak("get_scf_fpointer(...) : failed on mfreopen(...)\n");
 	if ( (scf_data = mfread_scf(mf)) == NULL )
 		croak("get_scf_fpointer(...) : failed on fread_scf(...)\n");
-	ret_val = newSViv((int)scf_data);
+	ret_val = newSViv(PTR2IV(scf_data));
 	RETVAL = ret_val;
 	OUTPUT:
 	RETVAL
 
 void
 scf_free(scf_pointer)
-int scf_pointer
+long scf_pointer
 CODE:
 	scf_deallocate((Scf *)scf_pointer);
 
 SV *
 get_comments(scf_pointer)
-int scf_pointer
+long scf_pointer
 	CODE:
 	Scf *scf_data = (Scf *)scf_pointer;
 	SV *ret_val;
@@ -102,7 +102,7 @@ int scf_pointer
 
 void
 set_comments(scf_pointer, comments)
-int scf_pointer
+long scf_pointer
 char *comments
 	CODE:
 	Scf *scf_data = (Scf *)scf_pointer;
@@ -115,7 +115,7 @@ char *comments
 
 SV * 
 scf_write(scf_pointer, file_name)
-int scf_pointer
+long scf_pointer
 char *file_name
 	CODE:
 	Scf *scf_data = (Scf *)scf_pointer;
@@ -129,7 +129,7 @@ char *file_name
 	
 SV * 
 scf_fwrite(scf_pointer, file_handle)
-int scf_pointer
+long scf_pointer
 FILE *file_handle
 	CODE:
 mFILE *mf;
@@ -152,7 +152,7 @@ FILE *file_handle
 
 SV *
 get_from_header(scf_pointer, what)
-int scf_pointer
+long scf_pointer
 int what
 	CODE:
 	/* what = { 0 samples, 1 bases, 2 version, 3 sample size, 4 code_set } */
@@ -176,7 +176,7 @@ int what
 
 SV *
 get_at(scf_pointer, index, what)
-int scf_pointer
+long scf_pointer
 int index
 int what
 	CODE:
@@ -234,7 +234,7 @@ int what
 
 void 
 set_base_at(scf_pointer, index, what, value)
-int scf_pointer
+long scf_pointer
 int index
 int what
 char value
@@ -247,7 +247,7 @@ char value
 
 void
 set_at(scf_pointer, index, what, value)
-int scf_pointer
+long scf_pointer
 int index
 int what
 unsigned int value
-- 
2.10.2



Processed: Re: Bug#846731: Bug#775434: libbio-scf-perl: FTBFS on mips64el, ppc64el, s390x - tests

2016-12-06 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> tag 846731 patch
Bug #846731 [src:libbio-scf-perl] libbio-scf-perl: FTBFS: Test failures
Added tag(s) patch.
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
846731: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=846731
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#846731: Bug#775434: libbio-scf-perl: FTBFS on mips64el, ppc64el, s390x - tests

2016-12-04 Thread Niko Tyni
On Sat, Dec 03, 2016 at 04:40:53PM +0100, gregor herrmann wrote:
> On Wed, 26 Oct 2016 13:26:42 +0100, Iain Lane wrote:
> 
> > On Thu, Jan 15, 2015 at 05:17:10PM +, James Cowgill wrote:
> 
> > > libbio-scp-perl FTBFS on mips64el, ppc64el, and s390x with similar
> > > testsuite failures:
> 
> > > Although I haven't investigated this, the build produces many pointer
> > > casting warnings which seem likely to have caused these errors:
> > > 
> > > SCF.xs: In function 'XS_Bio__SCF_get_scf_pointer':
> > > SCF.xs:57:20: warning: cast from pointer to integer of different size 
> > > [-Wpointer-to-int-cast]
> > >   ret_val = newSViv((int)scf_data);
> > 
> > We are noticing this on ubuntu/amd64 too - not sure right now why
> > debian/amd64 doesn't have it.
> 
> Now also in Debian: #846731
> (And I can reproduce it locally).
> 
> Interestingly, it still built some weeks ago on the
> reproducible-build hosts:
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/libbio-scf-perl.html
> (also i386 and armhf)

GCC started to default to PIE between the latest perl upload and the
one before that. I think that made it use different memory locations,
so the cast to int now overflows.

I believe the above architectures, and Ubuntu amd64 as well, were
defaulting to PIE earlier so that's why they run into this when
Debian/amd64 was still fine.
-- 
Niko Tyni   nt...@debian.org



Bug#846731: Bug#775434: libbio-scf-perl: FTBFS on mips64el, ppc64el, s390x - tests

2016-12-03 Thread gregor herrmann
Control: tag 846731 + confirmed

On Wed, 26 Oct 2016 13:26:42 +0100, Iain Lane wrote:

> On Thu, Jan 15, 2015 at 05:17:10PM +, James Cowgill wrote:

> > libbio-scp-perl FTBFS on mips64el, ppc64el, and s390x with similar
> > testsuite failures:

> > Although I haven't investigated this, the build produces many pointer
> > casting warnings which seem likely to have caused these errors:
> > 
> > SCF.xs: In function 'XS_Bio__SCF_get_scf_pointer':
> > SCF.xs:57:20: warning: cast from pointer to integer of different size 
> > [-Wpointer-to-int-cast]
> >   ret_val = newSViv((int)scf_data);
> 
> We are noticing this on ubuntu/amd64 too - not sure right now why
> debian/amd64 doesn't have it.

Now also in Debian: #846731
(And I can reproduce it locally).

Interestingly, it still built some weeks ago on the
reproducible-build hosts:
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/libbio-scf-perl.html
(also i386 and armhf)


Cheers,
gregor

-- 
 .''`.  https://info.comodo.priv.at/ - Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   NP: Walter Tessaris: Aria d'Irlanda


signature.asc
Description: Digital Signature