[med-svn] [Git][med-team/plink2][master] 6 commits: New upstream version 2.00~a3-220217+dfsg
Andreas Tille (@tille)
gitlab at salsa.debian.org
Sat Feb 19 11:18:47 GMT 2022
Andreas Tille pushed to branch master at Debian Med / plink2
Commits:
16f76ff3 by Andreas Tille at 2022-02-19T11:40:29+01:00
New upstream version 2.00~a3-220217+dfsg
- - - - -
3b494d60 by Andreas Tille at 2022-02-19T11:40:29+01:00
routine-update: New upstream version
- - - - -
3b299d59 by Andreas Tille at 2022-02-19T11:40:32+01:00
Update upstream source from tag 'upstream/2.00_a3-220217+dfsg'
Update to upstream version '2.00~a3-220217+dfsg'
with Debian dir c17cede28d372d829f359c3a1f1c7e7fdcacbd07
- - - - -
2653fec2 by Andreas Tille at 2022-02-19T11:49:51+01:00
Remove debugging patches
- - - - -
cedbb9ac by Andreas Tille at 2022-02-19T11:50:38+01:00
Upstream fixed segfault issues that occured when using gcc-11
- - - - -
ef757425 by Andreas Tille at 2022-02-19T12:17:48+01:00
Upstream claimed that bugs are closed and I did so in d/changelog. Unfortunately autopkgtest keeps on segfaulting
- - - - -
10 changed files:
- debian/changelog
- − debian/patches/debug.patch
- − debian/patches/debug2.patch
- − debian/patches/debug3.patch
- debian/patches/series
- plink2.cc
- plink2_cmdline.cc
- plink2_matrix.cc
- plink2_merge.cc
- plink2_psam.cc
Changes:
=====================================
debian/changelog
=====================================
@@ -1,15 +1,11 @@
-plink2 (2.00~a3-220129+dfsg-1) UNRELEASED; urgency=medium
+plink2 (2.00~a3-220217+dfsg-1) UNRELEASED; urgency=medium
- [ Dylan Aïssi ]
+ * Team upload.
* New upstream version
-
- [ Andreas Tille ]
+ Closes: #1000782, #1004037
* Standards-Version: 4.6.0 (routine-update)
- * Add some debug code
- TODO: autopkgtest: /usr/bin/plink2: line 8: 156 Segmentation fault "${cmd}" "$@"
- -> see bug #1004037
- -- Dylan Aïssi <daissi at debian.org> Sat, 04 Dec 2021 09:28:56 +0100
+ -- Andreas Tille <tille at debian.org> Sat, 19 Feb 2022 11:51:01 +0100
plink2 (2.00~a3-211011+dfsg-1) unstable; urgency=medium
=====================================
debian/patches/debug.patch deleted
=====================================
@@ -1,49 +0,0 @@
-From 5ee527d39176d5d612014ce39a1e1ecbe59b3d9c Mon Sep 17 00:00:00 2001
-From: Christopher Chang <chrchang523 at gmail.com>
-Date: Thu, 17 Feb 2022 19:08:02 -0800
-Subject: [PATCH] add terminal --debug prints
-Origin: https://github.com/chrchang/plink-ng/commit/5ee527d39176d5d612014ce39a1e1ecbe59b3d9c.patch
-
----
- 2.0/plink2.cc | 6 ++++++
- 2.0/plink2_cmdline.cc | 6 ++++++
- 2 files changed, 12 insertions(+)
-
-diff --git a/plink2.cc b/2.0/plink2.cc
-index c9ed51a5..83b28814 100644
---- a/plink2.cc
-+++ b/plink2.cc
-@@ -10944,7 +10944,13 @@ int main(int argc, char** argv) {
- reterr = kPglRetWriteFail;
- }
- if (bigstack_ua) {
-+ if (g_debug_on) {
-+ fputs("--debug: Trying to free bigstack_ua.\n", stdout);
-+ }
- free(bigstack_ua);
- }
-+ if (g_debug_on) {
-+ fputs("--debug: Exiting.\n", stdout);
-+ }
- return S_CAST(int32_t, reterr);
- }
-diff --git a/plink2_cmdline.cc b/2.0/plink2_cmdline.cc
-index 4c49ccee..b02aace5 100644
---- a/plink2_cmdline.cc
-+++ b/plink2_cmdline.cc
-@@ -526,9 +526,15 @@ BoolErr CleanupLogfile(uint32_t print_end_time) {
- }
- BoolErr ret_boolerr = 0;
- if (g_logfile) {
-+ if (g_debug_on) {
-+ printf("--debug: g_log_failed = %u.\n", g_log_failed);
-+ }
- if (!g_log_failed) {
- logputs_silent("\n");
- logputs_silent(g_logbuf);
-+ if (g_debug_on) {
-+ fputs("--debug: Trying to close log.\n", stdout);
-+ }
- if (unlikely(fclose(g_logfile))) {
- fflush(stdout);
- fprintf(stderr, "Error: Failed to finish writing to log: %s.\n", strerror(errno));
=====================================
debian/patches/debug2.patch deleted
=====================================
@@ -1,47 +0,0 @@
-Author: Andreas Tille <tille at debian.org>
-Last-Update: Fri, 18 Feb 2022 13:20:18 +0100
-Description: Attempt to track down SIGSEGV
-
-(gdb) run
-Starting program: /usr/lib/plink2/plink2-sse2 --debug --pfile tmp_data --export vcf vcf-dosage=DS --out tmp_data2
-[Thread debugging using libthread_db enabled]
-Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
-[New Thread 0x7ffff4cc7640 (LWP 3957708)]
-[New Thread 0x7ffff44c6640 (LWP 3957709)]
-[New Thread 0x7fffe3cc5640 (LWP 3957710)]
-PLINK v2.00a3 64-bit (29 Jan 2022) www.cog-genomics.org/plink/2.0/
-(C) 2005-2022 Shaun Purcell, Christopher Chang GNU General Public License v3
-Logging to tmp_data2.log.
-Options in effect:
- --debug
- --export vcf vcf-dosage=DS
- --out tmp_data2
- --pfile tmp_data
-
-Start time: Fri Feb 18 13:19:13 2022
-31998 MiB RAM detected; reserving 15999 MiB for main workspace.
-Using up to 4 compute threads.
-[New Thread 0x7ffff7fc5640 (LWP 3957711)]
---debug: setting pheno_cols[0].nonmiss. = nullptr
-
-Thread 1 "plink2-sse2" received signal SIGSEGV, Segmentation fault.
-0x00005555556fb6ff in plink2::LoadPsam (psamname=psamname at entry=0x7fffffffbe70 "tmp_data.psam", pheno_range_list_ptr=<optimized out>, fam_cols=..., pheno_ct_max=<optimized out>,
- missing_pheno=<optimized out>, affection_01=0, max_thread_ct=4, piip=0x7fffffff8880, sample_include_ptr=0x7fffffff87a0, founder_info_ptr=0x7fffffff87b8, sex_nm_ptr=0x7fffffff87a8,
- sex_male_ptr=0x7fffffff87b0, pheno_cols_ptr=0x7fffffff8780, pheno_names_ptr=0x7fffffff8790, raw_sample_ct_ptr=0x7fffffff8738, pheno_ct_ptr=0x7fffffff8730,
- max_pheno_name_blen_ptr=0x7fffffff87c0) at ../plink2_psam.cc:614
-warning: Source file is more recent than executable.
-614 pheno_cols[pheno_idx].nonmiss = nullptr;
-
-
---- a/plink2_psam.cc
-+++ b/plink2_psam.cc
-@@ -608,6 +608,9 @@ PglErr LoadPsam(const char* psamname, co
- }
- for (uint32_t pheno_idx = 0; pheno_idx != pheno_ct; ++pheno_idx) {
- // ensure cleanup works if initialization fails in the middle
-+ if (g_debug_on) {
-+ fprintf(stdout, "--debug: setting pheno_cols[%d].nonmiss. = nullptr\n", pheno_idx); fflush(stdout);
-+ }
- pheno_cols[pheno_idx].nonmiss = nullptr;
- }
- uint32_t cat_pheno_idx = 0;
=====================================
debian/patches/debug3.patch deleted
=====================================
@@ -1,35 +0,0 @@
-From ca19133b358b7a4a4083f50df15ba278152749dd Mon Sep 17 00:00:00 2001
-From: Christopher Chang <chrchang523 at gmail.com>
-Date: Fri, 18 Feb 2022 08:31:30 -0800
-Subject: [PATCH] more Debian debug-prints
-Origin: https://github.com/chrchang/plink-ng/commit/ca19133b358b7a4a4083f50df15ba278152749dd.patch
-
----
- 2.0/plink2.cc | 2 +-
- 2.0/plink2_common.h | 4 ++++
- 2.0/plink2_psam.cc | 1 +
- 3 files changed, 6 insertions(+), 1 deletion(-)
-
---- a/plink2_common.h
-+++ b/plink2_common.h
-@@ -1015,6 +1015,10 @@ typedef struct PhenoColStruct {
- PhenoDtype type_code;
-
- uint32_t nonnull_category_ct;
-+#ifdef __LP64__
-+ // This may be needed to avoid segfaults on some machines?
-+ uint32_t padding;
-+#endif
- } PhenoCol;
-
- void InitPheno();
---- a/plink2_psam.cc
-+++ b/plink2_psam.cc
-@@ -606,6 +606,7 @@ PglErr LoadPsam(const char* psamname, co
- goto LoadPsam_ret_NOMEM;
- }
- }
-+ DPrintf("sizeof(PhenoCol): %" PRIuPTR " pheno_cols: %lx\n", sizeof(PhenoCol), R_CAST(uintptr_t, pheno_cols));
- for (uint32_t pheno_idx = 0; pheno_idx != pheno_ct; ++pheno_idx) {
- // ensure cleanup works if initialization fails in the middle
- if (g_debug_on) {
=====================================
debian/patches/series
=====================================
@@ -1,6 +1,3 @@
Fix_Makefile.patch
use_packaged_libdeflate.patch
baseline
-debug.patch
-debug2.patch
-debug3.patch
=====================================
plink2.cc
=====================================
@@ -71,7 +71,7 @@ static const char ver_str[] = "PLINK v2.00a3"
#ifdef USE_MKL
" Intel"
#endif
- " (29 Jan 2022)";
+ " (17 Feb 2022)";
static const char ver_str2[] =
// include leading space if day < 10, so character length stays the same
""
@@ -10944,7 +10944,13 @@ int main(int argc, char** argv) {
reterr = kPglRetWriteFail;
}
if (bigstack_ua) {
+ if (g_debug_on) {
+ fputs("--debug: Trying to free bigstack_ua.\n", stdout);
+ }
free(bigstack_ua);
}
+ if (g_debug_on) {
+ fputs("--debug: Exiting.\n", stdout);
+ }
return S_CAST(int32_t, reterr);
}
=====================================
plink2_cmdline.cc
=====================================
@@ -526,9 +526,15 @@ BoolErr CleanupLogfile(uint32_t print_end_time) {
}
BoolErr ret_boolerr = 0;
if (g_logfile) {
+ if (g_debug_on) {
+ printf("--debug: g_log_failed = %u.\n", g_log_failed);
+ }
if (!g_log_failed) {
logputs_silent("\n");
logputs_silent(g_logbuf);
+ if (g_debug_on) {
+ fputs("--debug: Trying to close log.\n", stdout);
+ }
if (unlikely(fclose(g_logfile))) {
fflush(stdout);
fprintf(stderr, "Error: Failed to finish writing to log: %s.\n", strerror(errno));
@@ -3571,6 +3577,12 @@ PglErr CmdlineParsePhase1(const char* ver_str, const char* ver_str2, const char*
PglErr reterr = kPglRetSuccess;
{
int argc = *argc_ptr;
+ if (argc < 1) {
+ fputs(ver_str, stdout);
+ fputs(ver_str2, stdout);
+ fputs("Error: This application must be invoked with positive argc.\n", stderr);
+ goto CmdlineParsePhase1_ret_INVALID_CMDLINE;
+ }
const char* const* argvk = TO_CONSTCPCONSTP(*argv_ptr);
char** subst_argv = nullptr;
uint32_t first_arg_idx = 1;
=====================================
plink2_matrix.cc
=====================================
@@ -234,7 +234,7 @@ static inline double MultiplyBySgn(double aa, double bb) {
uint32_t SvdcmpC(int32_t m, double* a, double* w, double* v) {
// C port of PLINK stats.cpp svdcmp().
// Now thread-safe.
- double* rv1 = &(w[(uint32_t)m]);
+ double* rv1 = &(w[S_CAST(uint32_t, m)]);
int32_t n = m;
int32_t flag;
int32_t l = 0; // suppress compile warning
@@ -474,12 +474,12 @@ BoolErr InvertMatrix(int32_t dim, double* matrix, MatrixInvertBuf1* dbl_1d_buf,
BoolErr InvertFmatrixFirstHalf(int32_t dim, uint32_t stride, const float* matrix, double* half_inverted, MatrixInvertBuf1* dbl_1d_buf, double* dbl_2d_buf) {
const float* read_row = matrix;
double* write_row = half_inverted;
- for (uint32_t row_idx = 0; row_idx != (uint32_t)dim; ++row_idx) {
- for (uint32_t col_idx = 0; col_idx != (uint32_t)dim; ++col_idx) {
- write_row[col_idx] = (double)read_row[col_idx];
+ for (uint32_t row_idx = 0; row_idx != S_CAST(uint32_t, dim); ++row_idx) {
+ for (uint32_t col_idx = 0; col_idx != S_CAST(uint32_t, dim); ++col_idx) {
+ write_row[col_idx] = S_CAST(double, read_row[col_idx]);
}
read_row = &(read_row[stride]);
- write_row = &(write_row[(uint32_t)dim]);
+ write_row = &(write_row[S_CAST(uint32_t, dim)]);
}
return (!SvdcmpC(dim, half_inverted, dbl_1d_buf, dbl_2d_buf));
=====================================
plink2_merge.cc
=====================================
@@ -2886,7 +2886,8 @@ PglErr ScanPvarsAndMergeHeader(const PmergeInfo* pmip, MiscFlags misc_flags, uin
// depending on --sort-vars setting.
// See also SortChr() in plink2_data.cc. This is a bit simpler since we
// don't need the sort_idxs to be dense.
- const uint32_t chr_code_end = cip->max_code + 1 + name_ct;
+ const uint32_t max_code_p1 = cip->max_code + 1;
+ const uint32_t chr_code_end = max_code_p1 + name_ct;
uint32_t* chr_idx_to_sort_idx;
if (unlikely(bigstack_end_alloc_u32(chr_code_end, &chr_idx_to_sort_idx))) {
goto ScanPvarsAndMergeHeader_ret_NOMEM;
@@ -2907,12 +2908,13 @@ PglErr ScanPvarsAndMergeHeader(const PmergeInfo* pmip, MiscFlags misc_flags, uin
}
const char** nonstd_names = cip->nonstd_names;
for (uint32_t name_idx = 0; name_idx != name_ct; ++name_idx) {
- nonstd_sort_buf[name_idx].strptr = nonstd_names[name_idx];
+ // bugfix (17 Feb 2022): first non-null nonstd_names[] entry is at
+ // [max_code_p1], not [0]
+ nonstd_sort_buf[name_idx].strptr = nonstd_names[name_idx + max_code_p1];
nonstd_sort_buf[name_idx].orig_idx = name_idx;
}
// nonstd_names are not allocated in main workspace, so can't overread.
StrptrArrSortMain(name_ct, 0, (sort_vars_mode != kSortAscii), nonstd_sort_buf);
- const uint32_t max_code_p1 = cip->max_code + 1;
for (uint32_t name_idx = 0; name_idx != name_ct; ++name_idx) {
chr_idx_to_sort_idx[max_code_p1 + nonstd_sort_buf[name_idx].orig_idx] = name_code_start + name_idx;
}
=====================================
plink2_psam.cc
=====================================
@@ -1252,7 +1252,7 @@ PglErr LoadPhenos(const char* pheno_fname, const RangeList* pheno_range_list_ptr
goto LoadPhenos_ret_MALFORMED_INPUT_WW;
}
SetBit(first_sample_uidx, already_seen);
- if (unlikely(S_CAST(uintptr_t, tmp_bigstack_end - bigstack_base_copy) < pheno_info_alloc_byte_ct) * (xid_idx_end - xid_idx_start)) {
+ if (unlikely(S_CAST(uintptr_t, tmp_bigstack_end - bigstack_base_copy) < (pheno_info_alloc_byte_ct * (xid_idx_end - xid_idx_start)))) {
goto LoadPhenos_ret_NOMEM;
}
tmp_bigstack_end -= pheno_info_alloc_byte_ct;
View it on GitLab: https://salsa.debian.org/med-team/plink2/-/compare/3d93c55f45ed39d3162c8ac9b4cfaec43341d221...ef75742520e1e53041640db547b7994241ac301c
--
View it on GitLab: https://salsa.debian.org/med-team/plink2/-/compare/3d93c55f45ed39d3162c8ac9b4cfaec43341d221...ef75742520e1e53041640db547b7994241ac301c
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/20220219/fe767119/attachment-0001.htm>
More information about the debian-med-commit
mailing list