[med-svn] [Git][med-team/plink2][master] 5 commits: Add some debug code

Andreas Tille (@tille) gitlab at salsa.debian.org
Fri Feb 18 12:03:53 GMT 2022



Andreas Tille pushed to branch master at Debian Med / plink2


Commits:
4369d4ba by Andreas Tille at 2022-02-18T11:45:57+01:00
Add some debug code

- - - - -
8ee51a44 by Andreas Tille at 2022-02-18T12:14:33+01:00
Drop debug code

- - - - -
455de02d by Andreas Tille at 2022-02-18T12:15:15+01:00
Normalise name of autopkgtest script

- - - - -
f4d55d33 by Andreas Tille at 2022-02-18T12:16:59+01:00
Add some debug output

- - - - -
bf51ee93 by Andreas Tille at 2022-02-18T12:35:21+01:00
Fix check

- - - - -


9 changed files:

- + debian/README.test
- debian/bin/simd-dispatch
- debian/changelog
- + debian/docs
- debian/examples
- + debian/patches/debug.patch
- debian/patches/series
- debian/tests/control
- debian/tests/run-sample-analysis → debian/tests/run-unit-test


Changes:

=====================================
debian/README.test
=====================================
@@ -0,0 +1,8 @@
+Notes on how this package can be tested.
+────────────────────────────────────────
+
+This package can be tested by running the provided test:
+
+    sh run-unit-test
+
+in order to confirm its integrity.


=====================================
debian/bin/simd-dispatch
=====================================
@@ -28,4 +28,5 @@ test_and_run_avx2 "@"
 for SIMD in avx sse4.1 ssse3 sse3 sse2 sse mmx ; do test_and_run ${SIMD} "$@" ; done
 
 # fallback to plain option
+set -x
 "$BASE-plain" "$@"


=====================================
debian/changelog
=====================================
@@ -5,6 +5,7 @@ plink2 (2.00~a3-220129+dfsg-1) UNRELEASED; urgency=medium
 
   [ Andreas Tille ]
   * 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
 


=====================================
debian/docs
=====================================
@@ -0,0 +1,2 @@
+debian/tests/run-unit-test
+debian/README.test


=====================================
debian/examples
=====================================
@@ -3,5 +3,4 @@ debian/upstream.docs/toy.ped
 debian/upstream.docs/toy.map
 
 # Expected outputs and script for autopkgtest
-debian/tests/run-sample-analysis
 debian/tests/output_tests/*


=====================================
debian/patches/debug.patch
=====================================
@@ -0,0 +1,49 @@
+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/series
=====================================
@@ -1,3 +1,4 @@
 Fix_Makefile.patch
 use_packaged_libdeflate.patch
 baseline
+debug.patch


=====================================
debian/tests/control
=====================================
@@ -1,3 +1,3 @@
-Tests: run-sample-analysis
+Tests: run-unit-test
 Depends: @
 Restrictions: allow-stderr


=====================================
debian/tests/run-sample-analysis → debian/tests/run-unit-test
=====================================
@@ -4,12 +4,14 @@
 pkg=plink2
 if [ "$AUTOPKGTEST_TMP" = "" ] ; then
   AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
+  trap "rm -rf $AUTOPKGTEST_TMP" 0 INT QUIT ABRT PIPE TERM
 fi
 cd $AUTOPKGTEST_TMP
 
-plink2 --dummy 33 65537 0.1 dosage-freq=0.1 --out tmp_data
-plink2 --pfile tmp_data --export vcf vcf-dosage=DS --out tmp_data2
-plink2 --vcf tmp_data2.vcf dosage=DS --out tmp_data2
-
-rm -f $AUTOPKGTEST_TMP/*
-
+plink2 --debug --dummy 33 65537 0.1 dosage-freq=0.1 --out tmp_data
+if [ ! -e tmp_data.pgen ] ; then
+  echo "plink2 failed to create tmp_data.pgen"
+  exit 1
+fi
+plink2 --debug --pfile tmp_data --export vcf vcf-dosage=DS --out tmp_data2
+plink2 --debug --vcf tmp_data2.vcf dosage=DS --out tmp_data2



View it on GitLab: https://salsa.debian.org/med-team/plink2/-/compare/dd1538b33f33e2e4fe4963acf0a6dc3f960c2b3d...bf51ee937473385bc54b5faca553f59e62120fdd

-- 
View it on GitLab: https://salsa.debian.org/med-team/plink2/-/compare/dd1538b33f33e2e4fe4963acf0a6dc3f960c2b3d...bf51ee937473385bc54b5faca553f59e62120fdd
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/20220218/0770ef69/attachment-0001.htm>


More information about the debian-med-commit mailing list