The crash can easily be reproduced locally in a questing container:

# /usr/lib/plink2/plink2-avx2 --debug --dummy 33 65537 0.1 dosage-freq=0.1 
--out tmp_data
PLINK v2.0.0-a.6.9 AVX2 (29 Jan 2025)              cog-genomics.org/plink/2.0/
(C) 2005-2025 Shaun Purcell, Christopher Chang   GNU General Public License v3
Logging to tmp_data.log.
Options in effect:
  --debug
  --dummy 33 65537 0.1 dosage-freq=0.1
  --out tmp_data

Start time: Wed Aug 13 14:09:12 2025
Segmentation fault (core dumped)


GDB provides the following backtrace:

# gdb /usr/lib/plink2/plink2-avx2
gdb: warning: Couldn't determine a path for the index cache directory.
GNU gdb (Ubuntu 16.3-1ubuntu1) 16.3
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib/plink2/plink2-avx2...
Reading symbols from 
/usr/lib/debug/.build-id/46/440df5f6a591a84b22aef11d6342e60f0c7689.debug...
(gdb) run --debug --dummy 33 65537 0.1 dosage-freq=0.1 --out tmp_data
Starting program: /usr/lib/plink2/plink2-avx2 --debug --dummy 33 65537 0.1 
dosage-freq=0.1 --out tmp_data

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.ubuntu.com>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
PLINK v2.0.0-a.6.9 AVX2 (29 Jan 2025)              cog-genomics.org/plink/2.0/
(C) 2005-2025 Shaun Purcell, Christopher Chang   GNU General Public License v3
Logging to tmp_data.log.
Options in effect:
  --debug
  --dummy 33 65537 0.1 dosage-freq=0.1
  --out tmp_data

Start time: Wed Aug 13 14:20:17 2025

Program received signal SIGSEGV, Segmentation fault.
main (argc=<optimized out>, argv=<optimized out>) at ../plink2.cc:5301
5301                    gendummy_info.geno_mfreqs[mfreq_idx] = dxx;
(gdb) bt
#0  main (argc=<optimized out>, argv=<optimized out>) at ../plink2.cc:5301

(gdb) print dxx
$1 = 0.10000000000000001
(gdb) print mfreq_idx
$2 = 0
(gdb) print gendummy_info
$3 = {flags = {value_ = 0}, sample_ct = <optimized out>, variant_ct = 
<optimized out>, pheno_ct = <optimized out>, 
  geno_mfreq_ct = <optimized out>, geno_mfreqs = 0x0, pheno_mfreq = <optimized 
out>, phase_freq = <optimized out>, 
  dosage_freq = <optimized out>}


=> Interestingly, gendummy_info.geno_mfreqs = 0x0, therefore trying to access 
[mfreq_idx] segfaults. But why is the memory not allocated correctly?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2119580

Title:
  plink2: segmentation fault

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/plink2/+bug/2119580/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to