<div dir="ltr">Ok, I don't know why that particular line would fail, but I've added another debug-print before it on GitHub.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 18, 2022 at 4:24 AM Andreas Tille <<a href="mailto:andreas@fam-tille.de">andreas@fam-tille.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi Chris,<br>
<br>
Am Thu, Feb 17, 2022 at 07:13:49PM -0800 schrieb Chris Chang:<br>
> I was unable to replicate this issue on a Debian EC2 instance.  However,<br>
> there are very few things that happen between printing "End time:" and<br>
> program exit, so I have added a bunch of debug-prints (active when the<br>
> --debug flag is passed in) to the latest GitHub commit that should reveal<br>
> which of those few things is triggering the segfault; let me know if you<br>
> are able to run this build.<br>
<br>
I think the issue is a bit more complex.  Debian provides a wrapper<br>
which calls the best / most performant plink2.  The issue seems to<br>
occure for SFX=avx.  First I do:<br>
<br>
<br>
   /usr/lib/plink2/plink2-avx --debug --dummy 33 65537 0.1 dosage-freq=0.1 --out tmp_data<br>
<br>
This works.  In the next step I fire up gdb then which results in<br>
<br>
<br>
(gdb) run<br>
Starting program: /usr/lib/plink2/plink2-avx --debug --pfile tmp_data --export vcf vcf-dosage=DS --out tmp_data2<br>
[Thread debugging using libthread_db enabled]<br>
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".<br>
[New Thread 0x7ffff4cc7640 (LWP 2931408)]<br>
[New Thread 0x7ffff44c6640 (LWP 2931409)]<br>
[New Thread 0x7fffebcc5640 (LWP 2931411)]<br>
PLINK v2.00a3 SSE4.2 (29 Jan 2022)             <a href="http://www.cog-genomics.org/plink/2.0/" rel="noreferrer" target="_blank">www.cog-genomics.org/plink/2.0/</a><br>
(C) 2005-2022 Shaun Purcell, Christopher Chang   GNU General Public License v3<br>
Logging to tmp_data2.log.<br>
Options in effect:<br>
  --debug<br>
  --export vcf vcf-dosage=DS<br>
  --out tmp_data2<br>
  --pfile tmp_data<br>
<br>
Start time: Fri Feb 18 11:58:49 2022<br>
31998 MiB RAM detected; reserving 15999 MiB for main workspace.<br>
Using up to 4 compute threads.<br>
[New Thread 0x7ffff7fc5640 (LWP 2931412)]<br>
<br>
Thread 1 "plink2-avx" received signal SIGSEGV, Segmentation fault.<br>
plink2::LoadPsam (psamname=psamname@entry=0x7fffffffbe70 "tmp_data.psam", pheno_range_list_ptr=<optimized out>, fam_cols=..., pheno_ct_max=<optimized out>, <br>
    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, <br>
    sex_male_ptr=0x7fffffff87b0, pheno_cols_ptr=0x7fffffff8780, pheno_names_ptr=0x7fffffff8790, raw_sample_ct_ptr=0x7fffffff8738, pheno_ct_ptr=0x7fffffff8730, <br>
    max_pheno_name_blen_ptr=0x7fffffff87c0) at ../plink2_psam.cc:611<br>
warning: Source file is more recent than executable.<br>
611             pheno_cols[pheno_idx].nonmiss = nullptr;<br>
<br>
<br>
I also added some more debug lines in a patch[1].<br>
<br>
It seems that there is actually the weak part of the code since the<br>
output turns to<br>
<br>
...<br>
Start time: Fri Feb 18 13:19:13 2022<br>
31998 MiB RAM detected; reserving 15999 MiB for main workspace.<br>
Using up to 4 compute threads.<br>
[New Thread 0x7ffff7fc5640 (LWP 3957711)]<br>
--debug: setting pheno_cols[0].nonmiss. = nullptr<br>
<br>
Thread 1 "plink2-sse2" received signal SIGSEGV, Segmentation fault.<br>
0x00005555556fb6ff in plink2::LoadPsam (psamname=psamname@entry=0x7fffffffbe70 "tmp_data.psam", pheno_range_list_ptr=<optimized out>, fam_cols=..., pheno_ct_max=<optimized out>, <br>
    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, <br>
    sex_male_ptr=0x7fffffff87b0, pheno_cols_ptr=0x7fffffff8780, pheno_names_ptr=0x7fffffff8790, raw_sample_ct_ptr=0x7fffffff8738, pheno_ct_ptr=0x7fffffff8730, <br>
    max_pheno_name_blen_ptr=0x7fffffff87c0) at ../plink2_psam.cc:614<br>
warning: Source file is more recent than executable.<br>
614             pheno_cols[pheno_idx].nonmiss = nullptr;<br>
<br>
<br>
I hope this might help a bit to track down the issue<br>
<br>
    Andreas.<br>
<br>
<br>
<br>
[1] <a href="https://salsa.debian.org/med-team/plink2/-/blob/master/debian/patches/debug2.patch" rel="noreferrer" target="_blank">https://salsa.debian.org/med-team/plink2/-/blob/master/debian/patches/debug2.patch</a><br>
<br>
-- <br>
<a href="http://fam-tille.de" rel="noreferrer" target="_blank">http://fam-tille.de</a><br>
</blockquote></div>