Bug#1004037: Segmentation fault in plink2 (Was: src:plink2: fails to migrate to testing for too long: autopkgtest regression)

2022-03-15 Thread Chris Chang
Just a heads-up, today's release contains a fix for an
infinite-loop-instead-of-error bug in the previous release.

On Sun, Feb 20, 2022 at 12:36 PM Andreas Tille  wrote:

> Cool!  This finally works.  Thanks a lot for your patience, Andreas.
>
> Am Sun, Feb 20, 2022 at 09:43:10AM -0800 schrieb Chris Chang:
> > Hmm.  Ordinarily, that download link would be fine.  I had not updated it
> > this time because the issue only affects gcc 11+, so it did not affect
> any
> > of the precompiled binaries and I wanted to keep the posted source
> > identical to that used to compile those binaries.
> >
> > On the other hand, the only difference (in the non-gcc-11+ case) between
> > the binaries and the updated source is the version date.  I guess this is
> > insignificant enough that a temporary discordance is less disruptive than
> > making you change your packing process, so I've updated the website
> source
> > link to point to the newer code; let me know if you still run into any
> > problems.
> >
> > On Sat, Feb 19, 2022 at 11:53 PM Andreas Tille  wrote:
> >
> > > Hi Chris,
> > >
> > > Am Sat, Feb 19, 2022 at 11:37:34PM -0800 schrieb Chris Chang:
> > > > To elaborate: when I look at
> > > > https://salsa.debian.org/med-team/plink2/-/tree/master , I can see
> that
> > > > plink2.cc, include/plink2_base.h, and include/plink2_base.cc don't
> have
> > > the
> > > > same contents as the v2.00a3-20220218 GitHub tag/release.  So I don't
> > > know
> > > > where you grabbed the code from this time, but it does not appear to
> be
> > > > from GitHub.
> > >
> > > That's true since on Github the source code of plink1.9 and plink2 is
> not
> > > separated.  Thus I download the tarball from
> > >
> > >https://www.cog-genomics.org/plink/2.0/
> > >
> > > which points to
> > >
> > >https://www.cog-genomics.org/static/bin/plink2_src_220217.zip
> > >
> > > I confirm that the tag on Github says v2.00a3-20220218 which seems to
> be
> > > later than 220217.  In principle I could point the packaging metadata
> to
> > > Github and exclude everything that I do not need for plink2 packaging
> (so
> > > remove 1.9 directory and code copies of libdeflate, simde and zstd in
> 2.0)
> > >
> > > In case you consider this the safer way to download plink2 code I'll
> do so.
> > >
> > > Kind regards and thanks a lot for comparing the code base
> > >
> > >  Andreas.
> > >
> > > > On Sat, Feb 19, 2022 at 7:54 AM Chris Chang 
> > > wrote:
> > > >
> > > > > If you build off the current head, the version string should say
> "18
> > > Feb
> > > > > 2022", not "17 Feb 2022".
> > > > >
> > > > > On Sat, Feb 19, 2022 at 7:02 AM Andreas Tille 
> > > wrote:
> > > > >
> > > > >> Hi again,
> > > > >>
> > > > >> Am Sat, Feb 19, 2022 at 12:28:21AM -0800 schrieb Chris Chang:
> > > > >> > Ok, new release/tag created.
> > > > >>
> > > > >> I've built the new version now.  The bad news is that it keeps on
> > > > >> SEGFAULTing for me:
> > > > >>
> > > > >> ...
> > > > >> (gdb) run
> > > > >> Starting program: /usr/lib/plink2/plink2-sse3 --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 0x74cc7640 (LWP 985019)]
> > > > >> [New Thread 0x744c6640 (LWP 985020)]
> > > > >> [New Thread 0x7fffebcc5640 (LWP 985021)]
> > > > >> PLINK v2.00a3 64-bit (17 Feb 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: Sat Feb 19 1

Bug#1004037: Segmentation fault in plink2 (Was: src:plink2: fails to migrate to testing for too long: autopkgtest regression)

2022-02-20 Thread Chris Chang
Hmm.  Ordinarily, that download link would be fine.  I had not updated it
this time because the issue only affects gcc 11+, so it did not affect any
of the precompiled binaries and I wanted to keep the posted source
identical to that used to compile those binaries.

On the other hand, the only difference (in the non-gcc-11+ case) between
the binaries and the updated source is the version date.  I guess this is
insignificant enough that a temporary discordance is less disruptive than
making you change your packing process, so I've updated the website source
link to point to the newer code; let me know if you still run into any
problems.

On Sat, Feb 19, 2022 at 11:53 PM Andreas Tille  wrote:

> Hi Chris,
>
> Am Sat, Feb 19, 2022 at 11:37:34PM -0800 schrieb Chris Chang:
> > To elaborate: when I look at
> > https://salsa.debian.org/med-team/plink2/-/tree/master , I can see that
> > plink2.cc, include/plink2_base.h, and include/plink2_base.cc don't have
> the
> > same contents as the v2.00a3-20220218 GitHub tag/release.  So I don't
> know
> > where you grabbed the code from this time, but it does not appear to be
> > from GitHub.
>
> That's true since on Github the source code of plink1.9 and plink2 is not
> separated.  Thus I download the tarball from
>
>https://www.cog-genomics.org/plink/2.0/
>
> which points to
>
>https://www.cog-genomics.org/static/bin/plink2_src_220217.zip
>
> I confirm that the tag on Github says v2.00a3-20220218 which seems to be
> later than 220217.  In principle I could point the packaging metadata to
> Github and exclude everything that I do not need for plink2 packaging (so
> remove 1.9 directory and code copies of libdeflate, simde and zstd in 2.0)
>
> In case you consider this the safer way to download plink2 code I'll do so.
>
> Kind regards and thanks a lot for comparing the code base
>
>  Andreas.
>
> > On Sat, Feb 19, 2022 at 7:54 AM Chris Chang 
> wrote:
> >
> > > If you build off the current head, the version string should say "18
> Feb
> > > 2022", not "17 Feb 2022".
> > >
> > > On Sat, Feb 19, 2022 at 7:02 AM Andreas Tille 
> wrote:
> > >
> > >> Hi again,
> > >>
> > >> Am Sat, Feb 19, 2022 at 12:28:21AM -0800 schrieb Chris Chang:
> > >> > Ok, new release/tag created.
> > >>
> > >> I've built the new version now.  The bad news is that it keeps on
> > >> SEGFAULTing for me:
> > >>
> > >> ...
> > >> (gdb) run
> > >> Starting program: /usr/lib/plink2/plink2-sse3 --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 0x74cc7640 (LWP 985019)]
> > >> [New Thread 0x744c6640 (LWP 985020)]
> > >> [New Thread 0x7fffebcc5640 (LWP 985021)]
> > >> PLINK v2.00a3 64-bit (17 Feb 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: Sat Feb 19 16:00:00 2022
> > >> 31998 MiB RAM detected; reserving 15999 MiB for main workspace.
> > >> Using up to 4 compute threads.
> > >> [New Thread 0x77fc5640 (LWP 985022)]
> > >>
> > >> Thread 1 "plink2-sse3" received signal SIGSEGV, Segmentation fault.
> > >> plink2::LoadPsam (psamname=psamname@entry=0x7fffbe60
> > >> "tmp_data.psam", pheno_range_list_ptr=, fam_cols=...,
> > >> pheno_ct_max=,
> > >> missing_pheno=, affection_01=0, max_thread_ct=4,
> > >> piip=0x7fff8870, sample_include_ptr=0x7fff8790,
> > >> founder_info_ptr=0x7fff87a8, sex_nm_ptr=0x7fff8798,
> > >> sex_male_ptr=0x7fff87a0, pheno_cols_ptr=0x7fff8770,
> > >> pheno_names_ptr=0x7fff8780, raw_sample_ct_ptr=0x7fff8728,
> > >> pheno_ct_ptr=0x7fff8720,
> > >> max_pheno_name_blen_ptr=0x7fff87b0) at ../plink2_psam.cc:611
> > >> 611 pheno_cols[pheno_idx].nonmiss = nullptr;
> > >>
> > >>
> > >> Please let me know if I can do further checks.
> > >>
> > >> Kind regards
> > >>
> > >>   Andreas.
> > >>
> > >> --
> > >> http://fam-tille.de
> > >>
> > >
>
> --
> http://fam-tille.de
>


Bug#1004037: Segmentation fault in plink2 (Was: src:plink2: fails to migrate to testing for too long: autopkgtest regression)

2022-02-19 Thread Chris Chang
To elaborate: when I look at
https://salsa.debian.org/med-team/plink2/-/tree/master , I can see that
plink2.cc, include/plink2_base.h, and include/plink2_base.cc don't have the
same contents as the v2.00a3-20220218 GitHub tag/release.  So I don't know
where you grabbed the code from this time, but it does not appear to be
from GitHub.

On Sat, Feb 19, 2022 at 7:54 AM Chris Chang  wrote:

> If you build off the current head, the version string should say "18 Feb
> 2022", not "17 Feb 2022".
>
> On Sat, Feb 19, 2022 at 7:02 AM Andreas Tille  wrote:
>
>> Hi again,
>>
>> Am Sat, Feb 19, 2022 at 12:28:21AM -0800 schrieb Chris Chang:
>> > Ok, new release/tag created.
>>
>> I've built the new version now.  The bad news is that it keeps on
>> SEGFAULTing for me:
>>
>> ...
>> (gdb) run
>> Starting program: /usr/lib/plink2/plink2-sse3 --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 0x74cc7640 (LWP 985019)]
>> [New Thread 0x744c6640 (LWP 985020)]
>> [New Thread 0x7fffebcc5640 (LWP 985021)]
>> PLINK v2.00a3 64-bit (17 Feb 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: Sat Feb 19 16:00:00 2022
>> 31998 MiB RAM detected; reserving 15999 MiB for main workspace.
>> Using up to 4 compute threads.
>> [New Thread 0x77fc5640 (LWP 985022)]
>>
>> Thread 1 "plink2-sse3" received signal SIGSEGV, Segmentation fault.
>> plink2::LoadPsam (psamname=psamname@entry=0x7fffbe60
>> "tmp_data.psam", pheno_range_list_ptr=, fam_cols=...,
>> pheno_ct_max=,
>> missing_pheno=, affection_01=0, max_thread_ct=4,
>> piip=0x7fff8870, sample_include_ptr=0x7fff8790,
>> founder_info_ptr=0x7fff87a8, sex_nm_ptr=0x7fff8798,
>> sex_male_ptr=0x7fff87a0, pheno_cols_ptr=0x7fff8770,
>> pheno_names_ptr=0x7fff8780, raw_sample_ct_ptr=0x7fff8728,
>> pheno_ct_ptr=0x7fff8720,
>> max_pheno_name_blen_ptr=0x7fff87b0) at ../plink2_psam.cc:611
>> 611 pheno_cols[pheno_idx].nonmiss = nullptr;
>>
>>
>> Please let me know if I can do further checks.
>>
>> Kind regards
>>
>>   Andreas.
>>
>> --
>> http://fam-tille.de
>>
>


Bug#1004037: Segmentation fault in plink2 (Was: src:plink2: fails to migrate to testing for too long: autopkgtest regression)

2022-02-19 Thread Chris Chang
If you build off the current head, the version string should say "18 Feb
2022", not "17 Feb 2022".

On Sat, Feb 19, 2022 at 7:02 AM Andreas Tille  wrote:

> Hi again,
>
> Am Sat, Feb 19, 2022 at 12:28:21AM -0800 schrieb Chris Chang:
> > Ok, new release/tag created.
>
> I've built the new version now.  The bad news is that it keeps on
> SEGFAULTing for me:
>
> ...
> (gdb) run
> Starting program: /usr/lib/plink2/plink2-sse3 --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 0x74cc7640 (LWP 985019)]
> [New Thread 0x744c6640 (LWP 985020)]
> [New Thread 0x7fffebcc5640 (LWP 985021)]
> PLINK v2.00a3 64-bit (17 Feb 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: Sat Feb 19 16:00:00 2022
> 31998 MiB RAM detected; reserving 15999 MiB for main workspace.
> Using up to 4 compute threads.
> [New Thread 0x77fc5640 (LWP 985022)]
>
> Thread 1 "plink2-sse3" received signal SIGSEGV, Segmentation fault.
> plink2::LoadPsam (psamname=psamname@entry=0x7fffbe60 "tmp_data.psam",
> pheno_range_list_ptr=, fam_cols=..., pheno_ct_max= out>,
> missing_pheno=, affection_01=0, max_thread_ct=4,
> piip=0x7fff8870, sample_include_ptr=0x7fff8790,
> founder_info_ptr=0x7fff87a8, sex_nm_ptr=0x7fff8798,
> sex_male_ptr=0x7fff87a0, pheno_cols_ptr=0x7fff8770,
> pheno_names_ptr=0x7fff8780, raw_sample_ct_ptr=0x7fff8728,
> pheno_ct_ptr=0x7fff8720,
> max_pheno_name_blen_ptr=0x7fff87b0) at ../plink2_psam.cc:611
> 611 pheno_cols[pheno_idx].nonmiss = nullptr;
>
>
> Please let me know if I can do further checks.
>
> Kind regards
>
>   Andreas.
>
> --
> http://fam-tille.de
>


Bug#1004037: Segmentation fault in plink2 (Was: src:plink2: fails to migrate to testing for too long: autopkgtest regression)

2022-02-19 Thread Chris Chang
Ok, new release/tag created.

On Fri, Feb 18, 2022 at 10:55 PM Andreas Tille  wrote:

> Hi Chris,
>
> Am Fri, Feb 18, 2022 at 07:27:20PM -0800 schrieb Chris Chang:
> > I have confirmed that the original code segfaults when compiled with gcc
> > 11.2 on my Debian instance, and that it runs to completion after the
> latest
> > patch.  I have also confirmed that, after the latest patch, all other
> tests
> > pass.
>
> Very nice.  It would be great if you could tag a new release which would
> ease the maintenance.
>
> Thanks a lot for your great cooperation
>
>  Andreas.
>
> --
> http://fam-tille.de
>


Bug#1004037: Segmentation fault in plink2 (Was: src:plink2: fails to migrate to testing for too long: autopkgtest regression)

2022-02-18 Thread Chris Chang
I have confirmed that the original code segfaults when compiled with gcc
11.2 on my Debian instance, and that it runs to completion after the latest
patch.  I have also confirmed that, after the latest patch, all other tests
pass.

On Fri, Feb 18, 2022 at 1:27 PM Chris Chang  wrote:

> I am installing gcc-11 on my Debian instance now, and will be running more
> extensive tests today searching for other things that may have stopped
> working for the same reason.
>
> On Fri, Feb 18, 2022 at 1:22 PM Andreas Tille  wrote:
>
>> I confirm its gcc-11.  I'll check tomorrow.  Thanks a lot for your quick
>> and helpful responses, Andreas.
>>
>> Am Fri, Feb 18, 2022 at 12:53:58PM -0800 schrieb Chris Chang:
>> > I have posted an update under the provisional assumption that it's gcc
>> 11's
>> > new ipa-modref pass that is causing this code to fail, since it does
>> seem
>> > to break some similar code.
>> >
>> > On Fri, Feb 18, 2022 at 11:49 AM Chris Chang 
>> wrote:
>> >
>> > > What compiler version are you using?  This implies that the pgl_malloc
>> > > inline function is not being compiled to the expected code; there is
>> an
>> > > existing non-inlined version that is used for very old gcc versions,
>> but it
>> > > looks like it may also be needed here.
>> > >
>> > > On Fri, Feb 18, 2022 at 11:40 AM Andreas Tille 
>> wrote:
>> > >
>> > >> Hi again,
>> > >>
>> > >> I applied this patch and now I get:
>> > >>
>> > >> (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 0x74cc7640 (LWP 4060797)]
>> > >> [New Thread 0x7fffec4c6640 (LWP 4060798)]
>> > >> [New Thread 0x7fffebcc5640 (LWP 4060799)]
>> > >> 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 19:06:45 2022
>> > >> 31998 MiB RAM detected; reserving 15999 MiB for main workspace.
>> > >> Using up to 4 compute threads.
>> > >> [New Thread 0x77fc5640 (LWP 4060800)]
>> > >> sizeof(PhenoCol): 40  pheno_cols: 0
>> > >> --debug: setting pheno_cols[0].nonmiss. = nullptr
>> > >>
>> > >> Thread 1 "plink2-sse2" received signal SIGSEGV, Segmentation fault.
>> > >> 0x556fb82e in plink2::LoadPsam (psamname=psamname@entry
>> =0x7fffbe70
>> > >> "tmp_data.psam", pheno_range_list_ptr=, fam_cols=...,
>> > >> pheno_ct_max=,
>> > >> missing_pheno=, affection_01=0, max_thread_ct=4,
>> > >> piip=0x7fff8880, sample_include_ptr=0x7fff8790,
>> > >> founder_info_ptr=0x7fff87a8, sex_nm_ptr=0x7fff8798,
>> > >> sex_male_ptr=0x7fff87a0, pheno_cols_ptr=0x7fff8770,
>> > >> pheno_names_ptr=0x7fff8780, raw_sample_ct_ptr=0x7fff8728,
>> > >> pheno_ct_ptr=0x7fff8720,
>> > >> max_pheno_name_blen_ptr=0x7fff87b0) at ../plink2_psam.cc:615
>> > >> warning: Source file is more recent than executable.
>> > >> 615 pheno_cols[pheno_idx].nonmiss = nullptr;
>> > >>
>> > >> Kind regards
>> > >>
>> > >>   Andreas.
>> > >>
>> > >> Am Fri, Feb 18, 2022 at 08:45:12AM -0800 schrieb Chris Chang:
>> > >> > Ok, I don't know why that particular line would fail, but I've
>> added
>> > >> > another debug-print before it on GitHub.
>> > >> >
>> > >> > On Fri, Feb 18, 2022 at 4:24 AM Andreas Tille <
>> andr...@fam-tille.de>
>> > >> wrote:
>> > >> >
>> > >> > > Hi Chris,
>> > >> > >
>> > >> > > Am Thu, Feb

Bug#1004037: Segmentation fault in plink2 (Was: src:plink2: fails to migrate to testing for too long: autopkgtest regression)

2022-02-18 Thread Chris Chang
I am installing gcc-11 on my Debian instance now, and will be running more
extensive tests today searching for other things that may have stopped
working for the same reason.

On Fri, Feb 18, 2022 at 1:22 PM Andreas Tille  wrote:

> I confirm its gcc-11.  I'll check tomorrow.  Thanks a lot for your quick
> and helpful responses, Andreas.
>
> Am Fri, Feb 18, 2022 at 12:53:58PM -0800 schrieb Chris Chang:
> > I have posted an update under the provisional assumption that it's gcc
> 11's
> > new ipa-modref pass that is causing this code to fail, since it does seem
> > to break some similar code.
> >
> > On Fri, Feb 18, 2022 at 11:49 AM Chris Chang 
> wrote:
> >
> > > What compiler version are you using?  This implies that the pgl_malloc
> > > inline function is not being compiled to the expected code; there is an
> > > existing non-inlined version that is used for very old gcc versions,
> but it
> > > looks like it may also be needed here.
> > >
> > > On Fri, Feb 18, 2022 at 11:40 AM Andreas Tille 
> wrote:
> > >
> > >> Hi again,
> > >>
> > >> I applied this patch and now I get:
> > >>
> > >> (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 0x74cc7640 (LWP 4060797)]
> > >> [New Thread 0x7fffec4c6640 (LWP 4060798)]
> > >> [New Thread 0x7fffebcc5640 (LWP 4060799)]
> > >> 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 19:06:45 2022
> > >> 31998 MiB RAM detected; reserving 15999 MiB for main workspace.
> > >> Using up to 4 compute threads.
> > >> [New Thread 0x77fc5640 (LWP 4060800)]
> > >> sizeof(PhenoCol): 40  pheno_cols: 0
> > >> --debug: setting pheno_cols[0].nonmiss. = nullptr
> > >>
> > >> Thread 1 "plink2-sse2" received signal SIGSEGV, Segmentation fault.
> > >> 0x556fb82e in plink2::LoadPsam (psamname=psamname@entry
> =0x7fffbe70
> > >> "tmp_data.psam", pheno_range_list_ptr=, fam_cols=...,
> > >> pheno_ct_max=,
> > >> missing_pheno=, affection_01=0, max_thread_ct=4,
> > >> piip=0x7fff8880, sample_include_ptr=0x7fff8790,
> > >> founder_info_ptr=0x7fff87a8, sex_nm_ptr=0x7fff8798,
> > >> sex_male_ptr=0x7fff87a0, pheno_cols_ptr=0x7fff8770,
> > >> pheno_names_ptr=0x7fff8780, raw_sample_ct_ptr=0x7fff8728,
> > >> pheno_ct_ptr=0x7fff8720,
> > >> max_pheno_name_blen_ptr=0x7fff87b0) at ../plink2_psam.cc:615
> > >> warning: Source file is more recent than executable.
> > >> 615 pheno_cols[pheno_idx].nonmiss = nullptr;
> > >>
> > >> Kind regards
> > >>
> > >>   Andreas.
> > >>
> > >> Am Fri, Feb 18, 2022 at 08:45:12AM -0800 schrieb Chris Chang:
> > >> > Ok, I don't know why that particular line would fail, but I've added
> > >> > another debug-print before it on GitHub.
> > >> >
> > >> > On Fri, Feb 18, 2022 at 4:24 AM Andreas Tille  >
> > >> wrote:
> > >> >
> > >> > > Hi Chris,
> > >> > >
> > >> > > Am Thu, Feb 17, 2022 at 07:13:49PM -0800 schrieb Chris Chang:
> > >> > > > I was unable to replicate this issue on a Debian EC2 instance.
> > >> However,
> > >> > > > there are very few things that happen between printing "End
> time:"
> > >> and
> > >> > > > program exit, so I have added a bunch of debug-prints (active
> when
> > >> the
> > >> > > > --debug flag is passed in) to the latest GitHub commit that
> should
> > >> reveal
> > >> > > > which of those few things is triggering the segfault; let me
> know
> > >> if y

Bug#1004037: Segmentation fault in plink2 (Was: src:plink2: fails to migrate to testing for too long: autopkgtest regression)

2022-02-18 Thread Chris Chang
I have posted an update under the provisional assumption that it's gcc 11's
new ipa-modref pass that is causing this code to fail, since it does seem
to break some similar code.

On Fri, Feb 18, 2022 at 11:49 AM Chris Chang  wrote:

> What compiler version are you using?  This implies that the pgl_malloc
> inline function is not being compiled to the expected code; there is an
> existing non-inlined version that is used for very old gcc versions, but it
> looks like it may also be needed here.
>
> On Fri, Feb 18, 2022 at 11:40 AM Andreas Tille  wrote:
>
>> Hi again,
>>
>> I applied this patch and now I get:
>>
>> (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 0x74cc7640 (LWP 4060797)]
>> [New Thread 0x7fffec4c6640 (LWP 4060798)]
>> [New Thread 0x7fffebcc5640 (LWP 4060799)]
>> 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 19:06:45 2022
>> 31998 MiB RAM detected; reserving 15999 MiB for main workspace.
>> Using up to 4 compute threads.
>> [New Thread 0x77fc5640 (LWP 4060800)]
>> sizeof(PhenoCol): 40  pheno_cols: 0
>> --debug: setting pheno_cols[0].nonmiss. = nullptr
>>
>> Thread 1 "plink2-sse2" received signal SIGSEGV, Segmentation fault.
>> 0x556fb82e in plink2::LoadPsam 
>> (psamname=psamname@entry=0x7fffbe70
>> "tmp_data.psam", pheno_range_list_ptr=, fam_cols=...,
>> pheno_ct_max=,
>> missing_pheno=, affection_01=0, max_thread_ct=4,
>> piip=0x7fff8880, sample_include_ptr=0x7fff8790,
>> founder_info_ptr=0x7fff87a8, sex_nm_ptr=0x7fff8798,
>> sex_male_ptr=0x7fff87a0, pheno_cols_ptr=0x7fff8770,
>> pheno_names_ptr=0x7fff8780, raw_sample_ct_ptr=0x7fff8728,
>> pheno_ct_ptr=0x7fff8720,
>> max_pheno_name_blen_ptr=0x7fff87b0) at ../plink2_psam.cc:615
>> warning: Source file is more recent than executable.
>> 615 pheno_cols[pheno_idx].nonmiss = nullptr;
>>
>> Kind regards
>>
>>   Andreas.
>>
>> Am Fri, Feb 18, 2022 at 08:45:12AM -0800 schrieb Chris Chang:
>> > Ok, I don't know why that particular line would fail, but I've added
>> > another debug-print before it on GitHub.
>> >
>> > On Fri, Feb 18, 2022 at 4:24 AM Andreas Tille 
>> wrote:
>> >
>> > > Hi Chris,
>> > >
>> > > Am Thu, Feb 17, 2022 at 07:13:49PM -0800 schrieb Chris Chang:
>> > > > I was unable to replicate this issue on a Debian EC2 instance.
>> However,
>> > > > there are very few things that happen between printing "End time:"
>> and
>> > > > program exit, so I have added a bunch of debug-prints (active when
>> the
>> > > > --debug flag is passed in) to the latest GitHub commit that should
>> reveal
>> > > > which of those few things is triggering the segfault; let me know
>> if you
>> > > > are able to run this build.
>> > >
>> > > I think the issue is a bit more complex.  Debian provides a wrapper
>> > > which calls the best / most performant plink2.  The issue seems to
>> > > occure for SFX=avx.  First I do:
>> > >
>> > >
>> > >/usr/lib/plink2/plink2-avx --debug --dummy 33 65537 0.1
>> dosage-freq=0.1
>> > > --out tmp_data
>> > >
>> > > This works.  In the next step I fire up gdb then which results in
>> > >
>> > >
>> > > (gdb) run
>> > > Starting program: /usr/lib/plink2/plink2-avx --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 0x74cc7640 (LWP 2931408)]
>> > > [New Thread 0x744c6640 (LWP 2931409)]
>> > > [New Thread 0x7fffebcc5640 (LWP 2931411)]
>> > > PLINK v2.00a3 SSE4.2 (29 Jan 2022)
>> > > www.cog-genomics.org/plink/2.0/
>> 

Bug#1004037: Segmentation fault in plink2 (Was: src:plink2: fails to migrate to testing for too long: autopkgtest regression)

2022-02-18 Thread Chris Chang
What compiler version are you using?  This implies that the pgl_malloc
inline function is not being compiled to the expected code; there is an
existing non-inlined version that is used for very old gcc versions, but it
looks like it may also be needed here.

On Fri, Feb 18, 2022 at 11:40 AM Andreas Tille  wrote:

> Hi again,
>
> I applied this patch and now I get:
>
> (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 0x74cc7640 (LWP 4060797)]
> [New Thread 0x7fffec4c6640 (LWP 4060798)]
> [New Thread 0x7fffebcc5640 (LWP 4060799)]
> 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 19:06:45 2022
> 31998 MiB RAM detected; reserving 15999 MiB for main workspace.
> Using up to 4 compute threads.
> [New Thread 0x77fc5640 (LWP 4060800)]
> sizeof(PhenoCol): 40  pheno_cols: 0
> --debug: setting pheno_cols[0].nonmiss. = nullptr
>
> Thread 1 "plink2-sse2" received signal SIGSEGV, Segmentation fault.
> 0x556fb82e in plink2::LoadPsam (psamname=psamname@entry=0x7fffbe70
> "tmp_data.psam", pheno_range_list_ptr=, fam_cols=...,
> pheno_ct_max=,
> missing_pheno=, affection_01=0, max_thread_ct=4,
> piip=0x7fff8880, sample_include_ptr=0x7fff8790,
> founder_info_ptr=0x7fff87a8, sex_nm_ptr=0x7fff8798,
> sex_male_ptr=0x7fff87a0, pheno_cols_ptr=0x7fff8770,
> pheno_names_ptr=0x7fff8780, raw_sample_ct_ptr=0x7fff8728,
> pheno_ct_ptr=0x7fff8720,
> max_pheno_name_blen_ptr=0x7fff87b0) at ../plink2_psam.cc:615
> warning: Source file is more recent than executable.
> 615 pheno_cols[pheno_idx].nonmiss = nullptr;
>
> Kind regards
>
>   Andreas.
>
> Am Fri, Feb 18, 2022 at 08:45:12AM -0800 schrieb Chris Chang:
> > Ok, I don't know why that particular line would fail, but I've added
> > another debug-print before it on GitHub.
> >
> > On Fri, Feb 18, 2022 at 4:24 AM Andreas Tille 
> wrote:
> >
> > > Hi Chris,
> > >
> > > Am Thu, Feb 17, 2022 at 07:13:49PM -0800 schrieb Chris Chang:
> > > > I was unable to replicate this issue on a Debian EC2 instance.
> However,
> > > > there are very few things that happen between printing "End time:"
> and
> > > > program exit, so I have added a bunch of debug-prints (active when
> the
> > > > --debug flag is passed in) to the latest GitHub commit that should
> reveal
> > > > which of those few things is triggering the segfault; let me know if
> you
> > > > are able to run this build.
> > >
> > > I think the issue is a bit more complex.  Debian provides a wrapper
> > > which calls the best / most performant plink2.  The issue seems to
> > > occure for SFX=avx.  First I do:
> > >
> > >
> > >/usr/lib/plink2/plink2-avx --debug --dummy 33 65537 0.1
> dosage-freq=0.1
> > > --out tmp_data
> > >
> > > This works.  In the next step I fire up gdb then which results in
> > >
> > >
> > > (gdb) run
> > > Starting program: /usr/lib/plink2/plink2-avx --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 0x74cc7640 (LWP 2931408)]
> > > [New Thread 0x744c6640 (LWP 2931409)]
> > > [New Thread 0x7fffebcc5640 (LWP 2931411)]
> > > PLINK v2.00a3 SSE4.2 (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 11:58:49 2022
> > > 31998 MiB RAM detected; reserving 15999 MiB for main workspace.
> > > Using up to 4 compute threads.
> > > [New Thread 0x77fc5640 (LWP 2931412)]
> > >
> > > Thread 1 "plink2-avx" received s

Bug#1004037: Segmentation fault in plink2 (Was: src:plink2: fails to migrate to testing for too long: autopkgtest regression)

2022-02-18 Thread Chris Chang
Ok, I don't know why that particular line would fail, but I've added
another debug-print before it on GitHub.

On Fri, Feb 18, 2022 at 4:24 AM Andreas Tille  wrote:

> Hi Chris,
>
> Am Thu, Feb 17, 2022 at 07:13:49PM -0800 schrieb Chris Chang:
> > I was unable to replicate this issue on a Debian EC2 instance.  However,
> > there are very few things that happen between printing "End time:" and
> > program exit, so I have added a bunch of debug-prints (active when the
> > --debug flag is passed in) to the latest GitHub commit that should reveal
> > which of those few things is triggering the segfault; let me know if you
> > are able to run this build.
>
> I think the issue is a bit more complex.  Debian provides a wrapper
> which calls the best / most performant plink2.  The issue seems to
> occure for SFX=avx.  First I do:
>
>
>/usr/lib/plink2/plink2-avx --debug --dummy 33 65537 0.1 dosage-freq=0.1
> --out tmp_data
>
> This works.  In the next step I fire up gdb then which results in
>
>
> (gdb) run
> Starting program: /usr/lib/plink2/plink2-avx --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 0x74cc7640 (LWP 2931408)]
> [New Thread 0x744c6640 (LWP 2931409)]
> [New Thread 0x7fffebcc5640 (LWP 2931411)]
> PLINK v2.00a3 SSE4.2 (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 11:58:49 2022
> 31998 MiB RAM detected; reserving 15999 MiB for main workspace.
> Using up to 4 compute threads.
> [New Thread 0x77fc5640 (LWP 2931412)]
>
> Thread 1 "plink2-avx" received signal SIGSEGV, Segmentation fault.
> plink2::LoadPsam (psamname=psamname@entry=0x7fffbe70 "tmp_data.psam",
> pheno_range_list_ptr=, fam_cols=..., pheno_ct_max= out>,
> missing_pheno=, affection_01=0, max_thread_ct=4,
> piip=0x7fff8880, sample_include_ptr=0x7fff87a0,
> founder_info_ptr=0x7fff87b8, sex_nm_ptr=0x7fff87a8,
> sex_male_ptr=0x7fff87b0, pheno_cols_ptr=0x7fff8780,
> pheno_names_ptr=0x7fff8790, raw_sample_ct_ptr=0x7fff8738,
> pheno_ct_ptr=0x7fff8730,
> max_pheno_name_blen_ptr=0x7fff87c0) at ../plink2_psam.cc:611
> warning: Source file is more recent than executable.
> 611 pheno_cols[pheno_idx].nonmiss = nullptr;
>
>
> I also added some more debug lines in a patch[1].
>
> It seems that there is actually the weak part of the code since the
> output turns to
>
> ...
> 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 0x77fc5640 (LWP 3957711)]
> --debug: setting pheno_cols[0].nonmiss. = nullptr
>
> Thread 1 "plink2-sse2" received signal SIGSEGV, Segmentation fault.
> 0x556fb6ff in plink2::LoadPsam (psamname=psamname@entry=0x7fffbe70
> "tmp_data.psam", pheno_range_list_ptr=, fam_cols=...,
> pheno_ct_max=,
> missing_pheno=, affection_01=0, max_thread_ct=4,
> piip=0x7fff8880, sample_include_ptr=0x7fff87a0,
> founder_info_ptr=0x7fff87b8, sex_nm_ptr=0x7fff87a8,
> sex_male_ptr=0x7fff87b0, pheno_cols_ptr=0x7fff8780,
> pheno_names_ptr=0x7fff8790, raw_sample_ct_ptr=0x7fff8738,
> pheno_ct_ptr=0x7fff8730,
> max_pheno_name_blen_ptr=0x7fff87c0) at ../plink2_psam.cc:614
> warning: Source file is more recent than executable.
> 614 pheno_cols[pheno_idx].nonmiss = nullptr;
>
>
> I hope this might help a bit to track down the issue
>
> Andreas.
>
>
>
> [1]
> https://salsa.debian.org/med-team/plink2/-/blob/master/debian/patches/debug2.patch
>
> --
> http://fam-tille.de
>


Bug#1004037: Segmentation fault in plink2 (Was: src:plink2: fails to migrate to testing for too long: autopkgtest regression)

2022-02-17 Thread Chris Chang
I was unable to replicate this issue on a Debian EC2 instance.  However,
there are very few things that happen between printing "End time:" and
program exit, so I have added a bunch of debug-prints (active when the
--debug flag is passed in) to the latest GitHub commit that should reveal
which of those few things is triggering the segfault; let me know if you
are able to run this build.

On Thu, Feb 17, 2022 at 11:47 AM Andreas Tille  wrote:

> Am Thu, Feb 17, 2022 at 11:39:30AM -0800 schrieb Chris Chang:
> > Haven't yet replicated this on any of my usual non-Debian test machines,
> > but I will spin up a Debian EC2 instance within the next two days and try
> > to replicate the crash there.
>
> Thanks a lot, Andreas.
>
> --
> http://fam-tille.de
>


Bug#1004037: Segmentation fault in plink2 (Was: src:plink2: fails to migrate to testing for too long: autopkgtest regression)

2022-02-17 Thread Chris Chang
Haven't yet replicated this on any of my usual non-Debian test machines,
but I will spin up a Debian EC2 instance within the next two days and try
to replicate the crash there.

On Wed, Feb 16, 2022 at 11:30 PM Andreas Tille  wrote:

> PS to last mail:  Here
>
>https://salsa.debian.org/med-team/plink2/-/jobs/2479769
>
> is a full test log in our Gitlab CI for the latest version which I just
> injected into the packaging Git repository but did not upload yet.
>
> Kind regards
>
>   Andreas.
>
> --
> http://fam-tille.de
>