[Debian-med-packaging] Bug#753485: samtools: python-pysam FTBFS on mips/mipsel due to issues in samtools
Andreas Tille
andreas at fam-tille.de
Tue Jul 8 07:55:03 UTC 2014
Hi Aleksandar,
thanks a lot for your explanation of the patch! That's really
appreciated and your help is really needed here. I think we whould
wait until upstream has updated their sources before we upload to
make sure they are happy with the patch. (Any member of Debian
Med team feel free to override my suggestion!)
Thanks again
Andreas.
On Mon, Jul 07, 2014 at 01:11:48PM +0000, Aleksandar Zlicic wrote:
> Hi, Dominique
>
> System endianness issue refers to a bug in function swap_endian_data (bam.c:160).
>
> Function swap_endian_data() is used on big-endian architectures when data is read from input BAM files and/or written to output BAM files, for converting multibyte integer values from little endian to big endian byte order and vice versa (depending on the operation).
>
> Additional argument to the function is_host specifies whether the input data is in host byte order or not (reading or writing), since swapping of BAM auxiliary array length values has to be done at different times for reading and writing.
>
> -static void swap_endian_data(const bam1_core_t *c, int data_len, uint8_t *data)
> +static void swap_endian_data(const bam1_core_t *c, int data_len, uint8_t *data, int is_host)
>
> + if(!is_host) bam_swap_endian_4p(s+1);
>
> - bam_swap_endian_4p(s+1);
> + if(is_host) bam_swap_endian_4p(s+1);
> + s += n * Bsize + 4;
>
> The last line in this change updates pointer 's' so that it points to the next uxiliary data tag-value pair (there are 'n' elements, each element of the array is Bsize bytes long; additional 4 bytes are for the 4-byte integer where length of array is stored).
>
> The following fixes 'for' loop limits (there are 'n' elements and each element is Bsize bytes long):
>
> - for (i = 0; i < n; i += 2)
> + for (i = 0; i < n*Bsize; i += 2)
>
> - for (i = 0; i < n; i += 4)
> + for (i = 0; i < n*Bsize; i += 4)
>
>
> Changes in fix_alignment.patch are to avoid unaligned memory access for architectures that don't allow it.
>
> I am currently adapting changes to the latest version of samtools. When I'm done I will contact upstream.
>
> Best Regards
> Aleksandar Zlicic
>
>
> _______________________________________________
> Debian-med-packaging mailing list
> Debian-med-packaging at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-packaging
--
http://fam-tille.de
More information about the Debian-med-packaging
mailing list