[med-svn] [Git][med-team/bcftools][master] 4 commits: skip_new_test_failing_on_32bit.patch: refresh.
Étienne Mollier (@emollier)
gitlab at salsa.debian.org
Thu Nov 23 11:03:02 GMT 2023
Étienne Mollier pushed to branch master at Debian Med / bcftools
Commits:
079d6fde by Étienne Mollier at 2023-11-23T11:05:58+01:00
skip_new_test_failing_on_32bit.patch: refresh.
- - - - -
f495f810 by Étienne Mollier at 2023-11-23T11:06:20+01:00
tests-pluginpath.patch: refresh.
- - - - -
cc9b561a by Étienne Mollier at 2023-11-23T11:10:58+01:00
fix-bus-error-armhf.patch: new: fix Bus errors.
Thanks: Rob Davies
Closes: #1055669
- - - - -
c089666a by Étienne Mollier at 2023-11-23T12:02:02+01:00
ready to upload to unstable.
- - - - -
5 changed files:
- debian/changelog
- + debian/patches/fix-bus-error-armhf.patch
- debian/patches/series
- debian/patches/skip_new_test_failing_on_32bit.patch
- debian/patches/tests-pluginpath.patch
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+bcftools (1.18-2) unstable; urgency=medium
+
+ * skip_new_test_failing_on_32bit.patch: refresh.
+ * tests-pluginpath.patch: refresh.
+ * fix-bus-error-armhf.patch: new: fix Bus errors.
+ Thanks to Rob Davies (Closes: #1055669)
+
+ -- Étienne Mollier <emollier at debian.org> Thu, 23 Nov 2023 12:01:34 +0100
+
bcftools (1.18-1) unstable; urgency=medium
* Team upload.
=====================================
debian/patches/fix-bus-error-armhf.patch
=====================================
@@ -0,0 +1,523 @@
+commit 752ce93f61aecbde5ef39750cc5fab9537af23cd
+Author: Rob Davies <rmd+git at sanger.ac.uk>
+Date: Mon Nov 20 15:06:39 2023 +0000
+
+ Fix bus error in bcftools merge on armhf (32-bit hard-float)
+
+ While 32-bit ARM mostly allows unaligned access, under certain
+ conditions it can produce a bus error on unaligned access to
+ a float. To prevent this from happening in bcftools merge,
+ update code that accesses data via bcf_info_t::vptr and
+ bcf_fmt_t::p to use uint8_t pointers and the le_to_i* macros
+ in htslib/hts_endian.h. As a side-effect, this also makes bcftools
+ merge work on big-endian platforms should anyone attempt to run
+ it on one.
+
+ Fixes #2036 (test_vcf_merge failures on arm 32-bit with FPU: Bus
+ error).
+
+Bug: https://github.com/samtools/bcftools/issues/2036
+Bug-Debian: https://bugs.debian.org/1055669
+
+--- bcftools.orig/Makefile
++++ bcftools/Makefile
+@@ -245,7 +245,7 @@
+ vcfgtcheck.o: vcfgtcheck.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_vcfutils_h) $(htslib_kbitset_h) $(htslib_hts_os_h) $(bcftools_h) extsort.h
+ vcfindex.o: vcfindex.c $(htslib_vcf_h) $(htslib_tbx_h) $(htslib_kstring_h) $(htslib_bgzf_h) $(bcftools_h)
+ vcfisec.o: vcfisec.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_vcfutils_h) $(htslib_hts_os_h) $(bcftools_h) $(filter_h)
+-vcfmerge.o: vcfmerge.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_vcfutils_h) $(htslib_faidx_h) regidx.h $(bcftools_h) vcmp.h $(htslib_khash_h)
++vcfmerge.o: vcfmerge.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_vcfutils_h) $(htslib_faidx_h) $(htslib_kbitset_h) $(htslib_hts_endian_h) $(bcftools_h) regidx.h vcmp.h $(htslib_khash_h) $(htslib_kbitset_h)
+ vcfnorm.o: vcfnorm.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_faidx_h) $(htslib_khash_str2int_h) $(bcftools_h) rbuf.h abuf.h gff.h
+ vcfquery.o: vcfquery.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_khash_str2int_h) $(htslib_vcfutils_h) $(bcftools_h) $(filter_h) $(convert_h) $(smpl_ilist_h)
+ vcfroh.o: vcfroh.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_kstring_h) $(htslib_kseq_h) $(htslib_bgzf_h) $(bcftools_h) HMM.h $(smpl_ilist_h) $(filter_h)
+--- bcftools.orig/vcfmerge.c
++++ bcftools/vcfmerge.c
+@@ -34,6 +34,7 @@
+ #include <htslib/synced_bcf_reader.h>
+ #include <htslib/vcfutils.h>
+ #include <htslib/faidx.h>
++#include <htslib/hts_endian.h>
+ #include <math.h>
+ #include <ctype.h>
+ #include <time.h>
+@@ -1272,32 +1273,32 @@
+ if ( len==BCF_VL_A || len==BCF_VL_R )
+ {
+ int ifrom = len==BCF_VL_A ? 1 : 0;
+- #define BRANCH(type_t, is_missing, is_vector_end, out_type_t) { \
+- type_t *src = (type_t *) info->vptr; \
++ #define BRANCH(type_t, convert, is_missing, is_vector_end, out_type_t) { \
++ uint8_t *src = info->vptr; \
+ out_type_t *tgt = (out_type_t *) agr->buf; \
+ int iori, inew; \
+- for (iori=ifrom; iori<line->n_allele; iori++) \
++ for (iori=ifrom; iori<line->n_allele; iori++, src += sizeof(type_t)) \
+ { \
++ type_t val = convert(src); \
+ if ( is_vector_end ) break; \
+ if ( is_missing ) continue; \
+ inew = als->map[iori] - ifrom; \
+- tgt[inew] = *src; \
+- src++; \
++ tgt[inew] = val; \
+ } \
+ }
+ switch (info->type) {
+- case BCF_BT_INT8: BRANCH(int8_t, *src==bcf_int8_missing, *src==bcf_int8_vector_end, int); break;
+- case BCF_BT_INT16: BRANCH(int16_t, *src==bcf_int16_missing, *src==bcf_int16_vector_end, int); break;
+- case BCF_BT_INT32: BRANCH(int32_t, *src==bcf_int32_missing, *src==bcf_int32_vector_end, int); break;
+- case BCF_BT_FLOAT: BRANCH(float, bcf_float_is_missing(*src), bcf_float_is_vector_end(*src), float); break;
++ case BCF_BT_INT8: BRANCH(int8_t, le_to_i8, val==bcf_int8_missing, val==bcf_int8_vector_end, int); break;
++ case BCF_BT_INT16: BRANCH(int16_t, le_to_i16, val==bcf_int16_missing, val==bcf_int16_vector_end, int); break;
++ case BCF_BT_INT32: BRANCH(int32_t, le_to_i32, val==bcf_int32_missing, val==bcf_int32_vector_end, int); break;
++ case BCF_BT_FLOAT: BRANCH(float, le_to_float, bcf_float_is_missing(val), bcf_float_is_vector_end(val), float); break;
+ default: fprintf(stderr,"TODO: %s:%d .. info->type=%d\n", __FILE__,__LINE__, info->type); exit(1);
+ }
+ #undef BRANCH
+ }
+ else
+ {
+- #define BRANCH(type_t, is_missing, is_vector_end, out_type_t) { \
+- type_t *src = (type_t *) info->vptr; \
++ #define BRANCH(type_t, convert, is_missing, is_vector_end, out_type_t) { \
++ uint8_t *src = info->vptr; \
+ out_type_t *tgt = (out_type_t *) agr->buf; \
+ int iori,jori, inew,jnew; \
+ for (iori=0; iori<line->n_allele; iori++) \
+@@ -1307,19 +1308,20 @@
+ { \
+ jnew = als->map[jori]; \
+ int kori = iori*(iori+1)/2 + jori; \
++ type_t val = convert(&src[kori * sizeof(type_t)]); \
+ if ( is_vector_end ) break; \
+ if ( is_missing ) continue; \
+ int knew = inew>jnew ? inew*(inew+1)/2 + jnew : jnew*(jnew+1)/2 + inew; \
+- tgt[knew] = src[kori]; \
++ tgt[knew] = val; \
+ } \
+ if ( jori<=iori ) break; \
+ } \
+ }
+ switch (info->type) {
+- case BCF_BT_INT8: BRANCH(int8_t, src[kori]==bcf_int8_missing, src[kori]==bcf_int8_vector_end, int); break;
+- case BCF_BT_INT16: BRANCH(int16_t, src[kori]==bcf_int16_missing, src[kori]==bcf_int16_vector_end, int); break;
+- case BCF_BT_INT32: BRANCH(int32_t, src[kori]==bcf_int32_missing, src[kori]==bcf_int32_vector_end, int); break;
+- case BCF_BT_FLOAT: BRANCH(float, bcf_float_is_missing(src[kori]), bcf_float_is_vector_end(src[kori]), float); break;
++ case BCF_BT_INT8: BRANCH(int8_t, le_to_i8, val==bcf_int8_missing, val==bcf_int8_vector_end, int); break;
++ case BCF_BT_INT16: BRANCH(int16_t, le_to_i16, val==bcf_int16_missing, val==bcf_int16_vector_end, int); break;
++ case BCF_BT_INT32: BRANCH(int32_t, le_to_i32, val==bcf_int32_missing, val==bcf_int32_vector_end, int); break;
++ case BCF_BT_FLOAT: BRANCH(float, le_to_float, bcf_float_is_missing(val), bcf_float_is_vector_end(val), float); break;
+ default: fprintf(stderr,"TODO: %s:%d .. info->type=%d\n", __FILE__,__LINE__, info->type); exit(1);
+ }
+ #undef BRANCH
+@@ -1488,12 +1490,12 @@
+ {
+ int i,j, max_ploidy = 0;
+
+- #define BRANCH(type_t, vector_end) { \
+- type_t *ptr = (type_t*) fmt->p; \
++ #define BRANCH(type_t, convert, vector_end) { \
++ uint8_t *ptr = fmt->p; \
+ for (i=0; i<nsmpl; i++) \
+ { \
+ for (j=0; j<fmt->n; j++) \
+- if ( ptr[j]==vector_end ) break; \
++ if ( convert(&ptr[j * sizeof(type_t)])==vector_end ) break; \
+ if ( j==fmt->n ) \
+ { \
+ /* all fields were used */ \
+@@ -1501,14 +1503,14 @@
+ break; \
+ } \
+ if ( max_ploidy < j ) max_ploidy = j; \
+- ptr += fmt->n; \
++ ptr += fmt->n * sizeof(type_t); \
+ } \
+ }
+ switch (fmt->type)
+ {
+- case BCF_BT_INT8: BRANCH(int8_t, bcf_int8_vector_end); break;
+- case BCF_BT_INT16: BRANCH(int16_t, bcf_int16_vector_end); break;
+- case BCF_BT_INT32: BRANCH(int32_t, bcf_int32_vector_end); break;
++ case BCF_BT_INT8: BRANCH(int8_t, le_to_i8, bcf_int8_vector_end); break;
++ case BCF_BT_INT16: BRANCH(int16_t, le_to_i16, bcf_int16_vector_end); break;
++ case BCF_BT_INT32: BRANCH(int32_t, le_to_i32, bcf_int32_vector_end); break;
+ default: error("Unexpected case: %d\n", fmt->type);
+ }
+ #undef BRANCH
+@@ -1598,19 +1600,22 @@
+ int *map = ma->buf[i].rec[ma->buf[i].cur].map;
+ double *allele_prob = ma->tmpd;
+ int *idx = ma->tmpi;
+- #define BRANCH(src_type_t, src_is_missing, src_is_vector_end, pl2prob_idx) { \
+- src_type_t *src = (src_type_t*) fmt_ori->p; \
++ #define BRANCH(src_type_t, convert, src_is_missing, src_is_vector_end, pl2prob_idx) { \
++ uint8_t *src = fmt_ori->p; \
+ for (j=0; j<nsmpl; j++) \
+ { \
+ for (k=0; k<line->n_allele; k++) allele_prob[k] = 0; \
+ for (k=0; k<line->n_allele; k++) \
+ for (l=0; l<=k; l++) \
+ { \
+- if ( src_is_missing || src_is_vector_end ) { src++; continue; } \
+- double prob = ma->pl2prob[pl2prob_idx]; \
+- allele_prob[k] += prob; \
+- allele_prob[l] += prob; \
+- src++; \
++ src_type_t val = convert(src); \
++ if ( !(src_is_missing) && !(src_is_vector_end) ) \
++ { \
++ double prob = ma->pl2prob[pl2prob_idx]; \
++ allele_prob[k] += prob; \
++ allele_prob[l] += prob; \
++ } \
++ src += sizeof(src_type_t); \
+ } \
+ /* insertion sort by allele probability, descending order, with the twist that REF (idx=0) always comes first */ \
+ allele_prob++; idx[0] = -1; idx++; /* keep REF first */ \
+@@ -1637,9 +1642,9 @@
+ }
+ switch (fmt_ori->type)
+ {
+- case BCF_BT_INT8: BRANCH( int8_t, *src==bcf_int8_missing, *src==bcf_int8_vector_end, *src); break;
+- case BCF_BT_INT16: BRANCH(int16_t, *src==bcf_int16_missing, *src==bcf_int16_vector_end, *src>=0 && *src<PL2PROB_MAX ? *src : PL2PROB_MAX-1); break;
+- case BCF_BT_INT32: BRANCH(int32_t, *src==bcf_int32_missing, *src==bcf_int32_vector_end, *src>=0 && *src<PL2PROB_MAX ? *src : PL2PROB_MAX-1); break;
++ case BCF_BT_INT8: BRANCH( int8_t, le_to_i8, val==bcf_int8_missing, val==bcf_int8_vector_end, val); break;
++ case BCF_BT_INT16: BRANCH(int16_t, le_to_i16, val==bcf_int16_missing, val==bcf_int16_vector_end, val>=0 && val<PL2PROB_MAX ? val : PL2PROB_MAX-1); break;
++ case BCF_BT_INT32: BRANCH(int32_t, le_to_i32, val==bcf_int32_missing, val==bcf_int32_vector_end, val>=0 && val<PL2PROB_MAX ? val : PL2PROB_MAX-1); break;
+ default: error("Unexpected case: %d, PL\n", fmt_ori->type);
+ }
+ #undef BRANCH
+@@ -1735,8 +1740,8 @@
+ continue;
+ }
+
+- #define BRANCH(type_t, vector_end) { \
+- type_t *p_ori = (type_t*) fmt_ori->p; \
++ #define BRANCH(type_t, convert, vector_end) { \
++ uint8_t *p_ori = fmt_ori->p; \
+ if ( !ma->buf[i].rec[irec].als_differ ) \
+ { \
+ /* the allele numbering is unchanged */ \
+@@ -1744,14 +1749,15 @@
+ { \
+ for (k=0; k<fmt_ori->n; k++) \
+ { \
+- if ( p_ori[k]==vector_end ) break; /* smaller ploidy */ \
++ type_t val = convert(&p_ori[k * sizeof(type_t)]); \
++ if ( val==vector_end ) break; /* smaller ploidy */ \
+ ma->smpl_ploidy[ismpl+j]++; \
+- if ( bcf_gt_is_missing(p_ori[k]) ) tmp[k] = 0; /* missing allele */ \
+- else tmp[k] = p_ori[k]; \
++ if ( bcf_gt_is_missing(val) ) tmp[k] = 0; /* missing allele */ \
++ else tmp[k] = val; \
+ } \
+ for (; k<nsize; k++) tmp[k] = bcf_int32_vector_end; \
+ tmp += nsize; \
+- p_ori += fmt_ori->n; \
++ p_ori += fmt_ori->n * sizeof(type_t); \
+ } \
+ ismpl += bcf_hdr_nsamples(hdr); \
+ continue; \
+@@ -1761,27 +1767,28 @@
+ { \
+ for (k=0; k<fmt_ori->n; k++) \
+ { \
+- if ( p_ori[k]==vector_end ) break; /* smaller ploidy */ \
++ type_t val = convert(&p_ori[k * sizeof(type_t)]); \
++ if ( val==vector_end ) break; /* smaller ploidy */ \
+ ma->smpl_ploidy[ismpl+j]++; \
+- if ( bcf_gt_is_missing(p_ori[k]) ) tmp[k] = 0; /* missing allele */ \
++ if ( bcf_gt_is_missing(val) ) tmp[k] = 0; /* missing allele */ \
+ else \
+ { \
+- int al = (p_ori[k]>>1) - 1; \
++ int al = (val>>1) - 1; \
+ al = al<=0 ? al + 1 : ma->buf[i].rec[irec].map[al] + 1; \
+- tmp[k] = (al << 1) | ((p_ori[k])&1); \
++ tmp[k] = (al << 1) | ((val)&1); \
+ } \
+ } \
+ for (; k<nsize; k++) tmp[k] = bcf_int32_vector_end; \
+ tmp += nsize; \
+- p_ori += fmt_ori->n; \
++ p_ori += fmt_ori->n * sizeof(type_t); \
+ } \
+ ismpl += bcf_hdr_nsamples(hdr); \
+ }
+ switch (fmt_ori->type)
+ {
+- case BCF_BT_INT8: BRANCH(int8_t, bcf_int8_vector_end); break;
+- case BCF_BT_INT16: BRANCH(int16_t, bcf_int16_vector_end); break;
+- case BCF_BT_INT32: BRANCH(int32_t, bcf_int32_vector_end); break;
++ case BCF_BT_INT8: BRANCH(int8_t, le_to_i8, bcf_int8_vector_end); break;
++ case BCF_BT_INT16: BRANCH(int16_t, le_to_i16, bcf_int16_vector_end); break;
++ case BCF_BT_INT32: BRANCH(int32_t, le_to_i32, bcf_int32_vector_end); break;
+ default: error("Unexpected case: %d\n", fmt_ori->type);
+ }
+ #undef BRANCH
+@@ -1959,10 +1966,10 @@
+ if ( 2*fmt_ori->n!=line->n_allele*(line->n_allele+1) ) error("Todo: localization of missing or haploid Number=G tags\n");
+
+ // localize
+- #define BRANCH(tgt_type_t, src_type_t, src_is_missing, src_is_vector_end, tgt_set_missing, tgt_set_vector_end) { \
++ #define BRANCH(tgt_type_t, src_type_t, convert, src_is_missing, src_is_vector_end, tgt_set_missing, tgt_set_vector_end) { \
+ for (j=0; j<nsmpl; j++) \
+ { \
+- src_type_t *src = (src_type_t*) fmt_ori->p + j*fmt_ori->n; \
++ uint8_t *src = fmt_ori->p + sizeof(src_type_t)*j*fmt_ori->n; \
+ tgt_type_t *tgt = (tgt_type_t *) ma->tmp_arr + ismpl*nsize; \
+ int *laa = ma->laa + (1+args->local_alleles)*ismpl; \
+ int ii,ij,tgt_idx = 0; \
+@@ -1972,9 +1979,10 @@
+ for (ij=0; ij<=ii; ij++) \
+ { \
+ int src_idx = bcf_alleles2gt(laa[ii],laa[ij]); \
++ src_type_t val = convert(&src[src_idx * sizeof(src_type_t)]); \
+ if ( src_is_missing ) tgt_set_missing; \
+ else if ( src_is_vector_end ) break; \
+- else tgt[tgt_idx] = src[src_idx]; \
++ else tgt[tgt_idx] = val; \
+ tgt_idx++; \
+ } \
+ } \
+@@ -1985,10 +1993,10 @@
+ }
+ switch (fmt_ori->type)
+ {
+- case BCF_BT_INT8: BRANCH(int32_t, int8_t, src[src_idx]==bcf_int8_missing, src[src_idx]==bcf_int8_vector_end, tgt[tgt_idx]=bcf_int32_missing, tgt[tgt_idx]=bcf_int32_vector_end); break;
+- case BCF_BT_INT16: BRANCH(int32_t, int16_t, src[src_idx]==bcf_int16_missing, src[src_idx]==bcf_int16_vector_end, tgt[tgt_idx]=bcf_int32_missing, tgt[tgt_idx]=bcf_int32_vector_end); break;
+- case BCF_BT_INT32: BRANCH(int32_t, int32_t, src[src_idx]==bcf_int32_missing, src[src_idx]==bcf_int32_vector_end, tgt[tgt_idx]=bcf_int32_missing, tgt[tgt_idx]=bcf_int32_vector_end); break;
+- case BCF_BT_FLOAT: BRANCH(float, float, bcf_float_is_missing(src[src_idx]), bcf_float_is_vector_end(src[src_idx]), bcf_float_set_missing(tgt[tgt_idx]), bcf_float_set_vector_end(tgt[tgt_idx])); break;
++ case BCF_BT_INT8: BRANCH(int32_t, int8_t, le_to_i8, val==bcf_int8_missing, val==bcf_int8_vector_end, tgt[tgt_idx]=bcf_int32_missing, tgt[tgt_idx]=bcf_int32_vector_end); break;
++ case BCF_BT_INT16: BRANCH(int32_t, int16_t, le_to_i16, val==bcf_int16_missing, val==bcf_int16_vector_end, tgt[tgt_idx]=bcf_int32_missing, tgt[tgt_idx]=bcf_int32_vector_end); break;
++ case BCF_BT_INT32: BRANCH(int32_t, int32_t, le_to_i16, val==bcf_int32_missing, val==bcf_int32_vector_end, tgt[tgt_idx]=bcf_int32_missing, tgt[tgt_idx]=bcf_int32_vector_end); break;
++ case BCF_BT_FLOAT: BRANCH(float, float, le_to_float, bcf_float_is_missing(val), bcf_float_is_vector_end(val), bcf_float_set_missing(tgt[tgt_idx]), bcf_float_set_vector_end(tgt[tgt_idx])); break;
+ default: error("Unexpected case: %d, %s\n", fmt_ori->type, key);
+ }
+ #undef BRANCH
+@@ -2058,10 +2066,10 @@
+ }
+
+ // localize
+- #define BRANCH(tgt_type_t, src_type_t, src_is_missing, src_is_vector_end, tgt_set_missing, tgt_set_vector_end) { \
++ #define BRANCH(tgt_type_t, src_type_t, convert, src_is_missing, src_is_vector_end, tgt_set_missing, tgt_set_vector_end) { \
+ for (j=0; j<nsmpl; j++) \
+ { \
+- src_type_t *src = (src_type_t*) fmt_ori->p + j*fmt_ori->n; \
++ uint8_t *src = fmt_ori->p + sizeof(src_type_t)*j*fmt_ori->n; \
+ tgt_type_t *tgt = (tgt_type_t *) ma->tmp_arr + ismpl*nsize; \
+ int *laa = ma->laa + (1+args->local_alleles)*ismpl; \
+ int ii,tgt_idx = 0; \
+@@ -2069,9 +2077,10 @@
+ { \
+ if ( laa[ii]==bcf_int32_missing || laa[ii]==bcf_int32_vector_end ) break; \
+ int src_idx = laa[ii] - ibeg; \
++ src_type_t val = convert(&src[src_idx * sizeof(src_type_t)]); \
+ if ( src_is_missing ) tgt_set_missing; \
+ else if ( src_is_vector_end ) break; \
+- else tgt[tgt_idx] = src[src_idx]; \
++ else tgt[tgt_idx] = val; \
+ tgt_idx++; \
+ } \
+ if ( !tgt_idx ) { tgt_set_missing; tgt_idx++; } \
+@@ -2081,10 +2090,10 @@
+ }
+ switch (fmt_ori->type)
+ {
+- case BCF_BT_INT8: BRANCH(int32_t, int8_t, src[src_idx]==bcf_int8_missing, src[src_idx]==bcf_int8_vector_end, tgt[tgt_idx]=bcf_int32_missing, tgt[tgt_idx]=bcf_int32_vector_end); break;
+- case BCF_BT_INT16: BRANCH(int32_t, int16_t, src[src_idx]==bcf_int16_missing, src[src_idx]==bcf_int16_vector_end, tgt[tgt_idx]=bcf_int32_missing, tgt[tgt_idx]=bcf_int32_vector_end); break;
+- case BCF_BT_INT32: BRANCH(int32_t, int32_t, src[src_idx]==bcf_int32_missing, src[src_idx]==bcf_int32_vector_end, tgt[tgt_idx]=bcf_int32_missing, tgt[tgt_idx]=bcf_int32_vector_end); break;
+- case BCF_BT_FLOAT: BRANCH(float, float, bcf_float_is_missing(src[src_idx]), bcf_float_is_vector_end(src[src_idx]), bcf_float_set_missing(tgt[tgt_idx]), bcf_float_set_vector_end(tgt[tgt_idx])); break;
++ case BCF_BT_INT8: BRANCH(int32_t, int8_t, le_to_i8, val==bcf_int8_missing, val==bcf_int8_vector_end, tgt[tgt_idx]=bcf_int32_missing, tgt[tgt_idx]=bcf_int32_vector_end); break;
++ case BCF_BT_INT16: BRANCH(int32_t, int16_t, le_to_i16, val==bcf_int16_missing, val==bcf_int16_vector_end, tgt[tgt_idx]=bcf_int32_missing, tgt[tgt_idx]=bcf_int32_vector_end); break;
++ case BCF_BT_INT32: BRANCH(int32_t, int32_t, le_to_i32, val==bcf_int32_missing, val==bcf_int32_vector_end, tgt[tgt_idx]=bcf_int32_missing, tgt[tgt_idx]=bcf_int32_vector_end); break;
++ case BCF_BT_FLOAT: BRANCH(float, float, le_to_float, bcf_float_is_missing(val), bcf_float_is_vector_end(val), bcf_float_set_missing(tgt[tgt_idx]), bcf_float_set_vector_end(tgt[tgt_idx])); break;
+ default: error("Unexpected case: %d, %s\n", fmt_ori->type, key);
+ }
+ #undef BRANCH
+@@ -2201,7 +2210,7 @@
+ }
+
+ // set the values
+- #define BRANCH(tgt_type_t, src_type_t, src_is_missing, src_is_vector_end, tgt_set_missing, tgt_set_vector_end) { \
++ #define BRANCH(tgt_type_t, src_type_t, convert, src_is_missing, src_is_vector_end, tgt_set_missing, tgt_set_vector_end) { \
+ int j, l, k; \
+ tgt_type_t *tgt = (tgt_type_t *) ma->tmp_arr + ismpl*nsize; \
+ if ( !fmt_ori ) \
+@@ -2214,7 +2223,7 @@
+ ismpl += bcf_hdr_nsamples(hdr); \
+ continue; \
+ } \
+- src_type_t *src = (src_type_t*) fmt_ori->p; \
++ uint8_t *src = fmt_ori->p; \
+ if ( (length!=BCF_VL_G && length!=BCF_VL_A && length!=BCF_VL_R) || (line->n_allele==out->n_allele && !ma->buf[i].rec[irec].als_differ) ) \
+ { \
+ /* alleles unchanged, copy over */ \
+@@ -2224,11 +2233,11 @@
+ { \
+ if ( src_is_vector_end ) break; \
+ else if ( src_is_missing ) tgt_set_missing; \
+- else *tgt = *src; \
+- tgt++; src++; \
++ else *tgt = convert(src); \
++ tgt++; src += sizeof(src_type_t); \
+ } \
+ for (k=l; k<nsize; k++) { tgt_set_vector_end; tgt++; } \
+- src += fmt_ori->n - l; \
++ src += sizeof(src_type_t) * (fmt_ori->n - l); \
+ } \
+ ismpl += bcf_hdr_nsamples(hdr); \
+ continue; \
+@@ -2240,8 +2249,14 @@
+ for (j=0; j<bcf_hdr_nsamples(hdr); j++) \
+ { \
+ tgt = (tgt_type_t *) ma->tmp_arr + (ismpl+j)*nsize; \
+- src = (src_type_t*) fmt_ori->p + j*fmt_ori->n; \
+- if ( (src_is_missing && fmt_ori->n==1) || (++src && src_is_vector_end) ) \
++ src = fmt_ori->p + sizeof(src_type_t) * j * fmt_ori->n; \
++ int tag_missing = src_is_missing && fmt_ori->n==1; \
++ if (!tag_missing) \
++ { \
++ src += sizeof(src_type_t); \
++ tag_missing = src_is_vector_end ; \
++ } \
++ if ( tag_missing ) \
+ { \
+ /* tag with missing value "." */ \
+ tgt_set_missing; \
+@@ -2252,9 +2267,10 @@
+ int ngsize = haploid ? out->n_allele : out->n_allele*(out->n_allele + 1)/2; \
+ if ( ma->buf[i].unkn_allele ) /* Use value from the unknown allele when available */ \
+ { \
+- src = (src_type_t*) fmt_ori->p + j*fmt_ori->n; \
++ src = fmt_ori->p + sizeof(src_type_t)*j*fmt_ori->n; \
+ int iunkn = haploid ? ma->buf[i].unkn_allele : (ma->buf[i].unkn_allele+1)*(ma->buf[i].unkn_allele + 2)/2 - 1; \
+- for (l=0; l<ngsize; l++) { *tgt = src[iunkn]; tgt++; } \
++ src_type_t val = convert(&src[iunkn * sizeof(src_type_t)]); \
++ for (l=0; l<ngsize; l++) { *tgt = val; tgt++; } \
+ } \
+ else if ( mrule && mrule->type==MERGE_MISSING_CONST ) \
+ { \
+@@ -2262,9 +2278,13 @@
+ } \
+ else if ( mrule && mrule->type==MERGE_MISSING_MAX ) \
+ { \
+- src = (src_type_t*) fmt_ori->p + j*fmt_ori->n; \
+- src_type_t max = src[0]; \
+- for (l=1; l<fmt_ori->n; l++) if ( max < src[l] ) max = src[l]; \
++ src = fmt_ori->p + sizeof(src_type_t)*j*fmt_ori->n; \
++ src_type_t max = convert(src); \
++ for (l=1; l<fmt_ori->n; l++) \
++ { \
++ src_type_t val = convert(&src[l * sizeof(src_type_t)]); \
++ if ( max < val ) max = val; \
++ } \
+ for (l=0; l<ngsize; l++) { *tgt = max; tgt++; } \
+ } \
+ else \
+@@ -2278,11 +2298,11 @@
+ for (iori=0; iori<line->n_allele; iori++) \
+ { \
+ inew = ma->buf[i].rec[irec].map[iori]; \
+- src = (src_type_t*) fmt_ori->p + j*fmt_ori->n + iori; \
++ src = fmt_ori->p + (j*fmt_ori->n + iori) * sizeof(src_type_t); \
+ tgt = (tgt_type_t *) ma->tmp_arr + (ismpl+j)*nsize + inew; \
+ if ( src_is_vector_end ) break; \
+ if ( src_is_missing ) tgt_set_missing; \
+- else *tgt = *src; \
++ else *tgt = convert(src); \
+ } \
+ } \
+ else \
+@@ -2297,7 +2317,7 @@
+ jnew = ma->buf[i].rec[irec].map[jori]; \
+ int kori = iori*(iori+1)/2 + jori; \
+ int knew = inew>jnew ? inew*(inew+1)/2 + jnew : jnew*(jnew+1)/2 + inew; \
+- src = (src_type_t*) fmt_ori->p + j*fmt_ori->n + kori; \
++ src = fmt_ori->p + (j*fmt_ori->n + kori) * sizeof(src_type_t); \
+ tgt = (tgt_type_t *) ma->tmp_arr + (ismpl+j)*nsize + knew; \
+ if ( src_is_vector_end ) \
+ { \
+@@ -2305,7 +2325,7 @@
+ break; \
+ } \
+ if ( src_is_missing ) tgt_set_missing; \
+- else *tgt = *src; \
++ else *tgt = convert(src); \
+ } \
+ } \
+ } \
+@@ -2318,19 +2338,25 @@
+ for (j=0; j<bcf_hdr_nsamples(hdr); j++) \
+ { \
+ tgt = (tgt_type_t *) ma->tmp_arr + (ismpl+j)*nsize; \
+- src = (src_type_t*) (fmt_ori->p + j*fmt_ori->size); \
+- if ( (src_is_missing && fmt_ori->n==1) || (++src && src_is_vector_end) ) \
++ src = fmt_ori->p + sizeof(src_type_t) * j * fmt_ori->size; \
++ int tag_missing = src_is_missing && fmt_ori->n==1; \
++ if (!tag_missing) { \
++ src += sizeof(src_type_t); \
++ tag_missing = src_is_vector_end ; \
++ } \
++ if ( tag_missing ) \
+ { \
+ /* tag with missing value "." */ \
+ tgt_set_missing; \
+ for (l=1; l<nsize; l++) { tgt++; tgt_set_vector_end; } \
+ continue; \
+ } \
+- src = (src_type_t*) (fmt_ori->p + j*fmt_ori->size); \
++ src = fmt_ori->p + sizeof(src_type_t) * j *fmt_ori->size; \
+ if ( ma->buf[i].unkn_allele ) /* Use value from the unknown allele when available */ \
+ { \
+ int iunkn = ma->buf[i].unkn_allele; \
+- for (l=0; l<nsize; l++) { *tgt = src[iunkn]; tgt++; } \
++ src_type_t val = convert(&src[iunkn * sizeof(src_type_t)]); \
++ for (l=0; l<nsize; l++) { *tgt = val; tgt++; } \
+ } \
+ else if ( mrule && mrule->type==MERGE_MISSING_CONST ) \
+ { \
+@@ -2338,9 +2364,13 @@
+ } \
+ else if ( mrule && mrule->type==MERGE_MISSING_MAX ) \
+ { \
+- src = (src_type_t*) fmt_ori->p + j*fmt_ori->n; \
+- src_type_t max = src[0]; \
+- for (l=1; l<fmt_ori->n; l++) if ( max < src[l] ) max = src[l]; \
++ src = fmt_ori->p + sizeof(src_type_t)*j*fmt_ori->n; \
++ src_type_t max = convert(src); \
++ for (l=1; l<fmt_ori->n; l++) \
++ { \
++ src_type_t val = convert(&src[l * sizeof(src_type_t)]); \
++ if ( max < val ) max = val; \
++ } \
+ for (l=0; l<nsize; l++) { *tgt = max; tgt++; } \
+ } \
+ else \
+@@ -2354,8 +2384,8 @@
+ tgt = (tgt_type_t *) ma->tmp_arr + (ismpl+j)*nsize + inew; \
+ if ( src_is_vector_end ) break; \
+ if ( src_is_missing ) tgt_set_missing; \
+- else *tgt = *src; \
+- src++; \
++ else *tgt = convert(src); \
++ src += sizeof(src_type_t); \
+ } \
+ } \
+ } \
+@@ -2363,10 +2393,10 @@
+ }
+ switch (type)
+ {
+- case BCF_BT_INT8: BRANCH(int32_t, int8_t, *src==bcf_int8_missing, *src==bcf_int8_vector_end, *tgt=bcf_int32_missing, *tgt=bcf_int32_vector_end); break;
+- case BCF_BT_INT16: BRANCH(int32_t, int16_t, *src==bcf_int16_missing, *src==bcf_int16_vector_end, *tgt=bcf_int32_missing, *tgt=bcf_int32_vector_end); break;
+- case BCF_BT_INT32: BRANCH(int32_t, int32_t, *src==bcf_int32_missing, *src==bcf_int32_vector_end, *tgt=bcf_int32_missing, *tgt=bcf_int32_vector_end); break;
+- case BCF_BT_FLOAT: BRANCH(float, float, bcf_float_is_missing(*src), bcf_float_is_vector_end(*src), bcf_float_set_missing(*tgt), bcf_float_set_vector_end(*tgt)); break;
++ case BCF_BT_INT8: BRANCH(int32_t, int8_t, le_to_i8, le_to_i8(src)==bcf_int8_missing, le_to_i8(src)==bcf_int8_vector_end, *tgt=bcf_int32_missing, *tgt=bcf_int32_vector_end); break;
++ case BCF_BT_INT16: BRANCH(int32_t, int16_t, le_to_i16, le_to_i16(src)==bcf_int16_missing, le_to_i16(src)==bcf_int16_vector_end, *tgt=bcf_int32_missing, *tgt=bcf_int32_vector_end); break;
++ case BCF_BT_INT32: BRANCH(int32_t, int32_t, le_to_i32, le_to_i32(src)==bcf_int32_missing, le_to_i32(src)==bcf_int32_vector_end, *tgt=bcf_int32_missing, *tgt=bcf_int32_vector_end); break;
++ case BCF_BT_FLOAT: BRANCH(float, float, le_to_float, bcf_float_is_missing(le_to_float(src)), bcf_float_is_vector_end(le_to_float(src)), bcf_float_set_missing(*tgt), bcf_float_set_vector_end(*tgt)); break;
+ default: error("Unexpected case: %d, %s\n", type, key);
+ }
+ #undef BRANCH
=====================================
debian/patches/series
=====================================
@@ -1,3 +1,4 @@
tests-pluginpath.patch
skip_new_test_failing_on_32bit.patch
2to3.patch
+fix-bus-error-armhf.patch
=====================================
debian/patches/skip_new_test_failing_on_32bit.patch
=====================================
@@ -9,9 +9,9 @@ Description: Skip single test causing new failures
.
FIXME: This workaround needs to be reconsidered in future versions
---- a/test/test.pl
-+++ b/test/test.pl
-@@ -194,7 +194,7 @@ run_test(\&test_vcf_query,$opts,in=>'que
+--- bcftools.orig/test/test.pl
++++ bcftools/test/test.pl
+@@ -202,7 +202,7 @@
run_test(\&test_vcf_query,$opts,in=>'query.filter.11',out=>'query.81.out',args=>q[-f'[%POS\\t%SAMPLE\\t%GT\\n]' -e'N_PASS(GT="alt")==1']);
run_test(\&test_vcf_query,$opts,in=>'query.filter.11',out=>'query.80.out',args=>q[-f'[%POS\\t%SAMPLE\\t%GT\\n]' -e'N_PASS(GT="alt")!=1']);
run_test(\&test_vcf_query,$opts,in=>'query',out=>'query.64.out',args=>q[-f'%CHROM\\t%POS\\t%INFO\\t%FORMAT\\n' -s D,C]);
=====================================
debian/patches/tests-pluginpath.patch
=====================================
@@ -8,9 +8,9 @@ Description: Set the bcftools plugin path to search system directories
Author: Afif Elghraoui <afif at ghraoui.name>
Forwarded: not-needed
Last-Update: 2015-11-09
---- a/test/test.pl
-+++ b/test/test.pl
-@@ -1582,7 +1582,7 @@ sub test_vcf_plugin
+--- bcftools.orig/test/test.pl
++++ bcftools/test/test.pl
+@@ -1704,7 +1704,7 @@
{
my ($opts,%args) = @_;
if ( !$$opts{test_plugins} ) { return; }
View it on GitLab: https://salsa.debian.org/med-team/bcftools/-/compare/b7a4cde705320c290198b94e82ff3440760d7848...c089666afbac28aa34b4a0c6f8c19d12a43b0a99
--
View it on GitLab: https://salsa.debian.org/med-team/bcftools/-/compare/b7a4cde705320c290198b94e82ff3440760d7848...c089666afbac28aa34b4a0c6f8c19d12a43b0a99
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20231123/e921ecb7/attachment-0001.htm>
More information about the debian-med-commit
mailing list