Skip to content

free() : invalid size, Aborted or segmentation faults #32

@Louis-MG

Description

@Louis-MG

Hello ! I used your tool on a dataset recently and everything went fine, but with the new alignments, I have either no error output, a Segmentation fault, or a memory problem (I guess).

The command:

for i in CarpeDeam/alignments/*.bam ; do name=$(basename "${i//\.sorted_by_name\.bam/}") ; ../../tools/metaDMG-cpp/metaDMG-cpp getdamage -n 30 -o CarpeDeam/metaDMG/"$name" "$i" ; done

Errors:

	-> metaDMG version: v0.4-123-g2cf6a01 (htslib: 1.17-28-ge13611a9) build(May  7 2025 09:54:35)
	-> ../../tools/metaDMG-cpp/metaDMG-cpp getdamage -n 30 -o 3413MW_S8_L001 CarpeDeam/alignments/3413MW_S8_L001.sorted_by_name.bam 
	-> ./metaDMG-cpp refName: (null) min_length: 35 print_length: 5 run_mode: 0 out_prefix: 3413MW_S8_L001 nthreads: 30 ignore_errors: 0
skipping: M03353:64:000000000-CRD57:1:1101:2033:16821 unmapped, this msg is printed: 2 times more
skipping: M03353:64:000000000-CRD57:1:1101:2152:13774 unmapped, this msg is printed: 1 times more
skipping: M03353:64:000000000-CRD57:1:1101:2155:15461 unmapped, this msg is printed: 0 times more
pos	A>C	A>G	A>T	C>A	C>G	C>T	G>A	G>C	G>T	T>A	T>C	T>G
0	0.00986	0.03237	0.00270	0.00332	0.02025	0.00249	0.00978	0.00712	0.00234	0.01246	0.05421	0.01792
1	0.00917	0.00982	0.01068	0.00277	0.01442	0.03055	0.01791	0.00975	0.01031	0.00373	0.00986	0.00228
2	0.00307	0.01399	0.00853	0.00775	0.00894	0.01740	0.03409	0.01240	0.00562	0.00367	0.01994	0.00262
3	0.01047	0.01404	0.00666	0.00299	0.00448	0.02937	0.02213	0.02484	0.01820	0.00068	0.01236	0.00491
4	0.00304	0.00912	0.00756	0.00414	0.01280	0.04282	0.03837	0.01456	0.01241	0.00452	0.00904	0.00286
pos	A>C	A>G	A>T	C>A	C>G	C>T	G>A	G>C	G>T	T>A	T>C	T>G
0	0.03883	0.05002	0.01360	0.00172	0.00840	0.00826	0.00491	0.01837	0.00878	0.00168	0.04843	0.00567
1	0.00391	0.01345	0.00064	0.01816	0.01224	0.02458	0.03114	0.01471	0.00436	0.00593	0.01886	0.01112
2	0.00191	0.01449	0.00537	0.01329	0.01909	0.02433	0.01491	0.00722	0.00222	0.00583	0.01480	0.00861
3	0.00187	0.01170	0.00301	0.01959	0.01330	0.02125	0.02460	0.00655	0.00393	0.00670	0.01175	0.00705
4	0.00211	0.00818	0.00165	0.01679	0.02321	0.03464	0.03578	0.01592	0.00842	0.00405	0.01163	0.00503
	-> Will dump: '3413MW_S8_L001.res.gz' this contains damage patterns for: 1 items
	-> Setting threads to: 30 
	-> Will dump: '3413MW_S8_L001.bdamage.gz' this contains damage patterns for: 1 items
	-> Setting threads to: 30 
	-> Will dump: '3413MW_S8_L001.rlens.gz' this contains read length distributions for: 1 items
	-> Setting threads to: 30 
	-> Outputting overall statistic in file: "3413MW_S8_L001.stat"
free(): invalid size
Aborted
	-> metaDMG version: v0.4-123-g2cf6a01 (htslib: 1.17-28-ge13611a9) build(May  7 2025 09:54:35)
	-> ../../tools/metaDMG-cpp/metaDMG-cpp getdamage -n 30 -o 34130-02_S15_L001 CarpeDeam/alignments/34130-02_S15_L001.sorted_by_name.bam 
	-> ./metaDMG-cpp refName: (null) min_length: 35 print_length: 5 run_mode: 0 out_prefix: 34130-02_S15_L001 nthreads: 30 ignore_errors: 0
skipping: M03353:64:000000000-CRD57:1:1101:2277:12257 unmapped, this msg is printed: 2 times more
skipping: M03353:64:000000000-CRD57:1:1101:2326:12694 unmapped, this msg is printed: 1 times more
skipping: M03353:64:000000000-CRD57:1:1101:2345:17730 unmapped, this msg is printed: 0 times more
pos	A>C	A>G	A>T	C>A	C>G	C>T	G>A	G>C	G>T	T>A	T>C	T>G
0	0.00506	0.01925	0.00237	0.00214	0.00589	0.00472	0.00429	0.00215	0.00198	0.00209	0.02149	0.00970
1	0.00507	0.00910	0.00485	0.00199	0.00221	0.01312	0.00811	0.00493	0.00502	0.00108	0.00789	0.00218
2	0.00431	0.00994	0.00328	0.00211	0.00286	0.00740	0.00972	0.00533	0.00478	0.00120	0.00938	0.00191
3	0.00576	0.00899	0.00468	0.00104	0.00191	0.00893	0.00902	0.00715	0.00840	0.00102	0.00840	0.00218
4	0.00255	0.00637	0.00238	0.00335	0.00352	0.02178	0.01540	0.00451	0.01015	0.00183	0.00559	0.00271
pos	A>C	A>G	A>T	C>A	C>G	C>T	G>A	G>C	G>T	T>A	T>C	T>G
0	0.00937	0.02002	0.00285	0.00235	0.00263	0.00383	0.00518	0.00522	0.00233	0.00167	0.02063	0.00432
1	0.00136	0.00750	0.00151	0.00589	0.00546	0.00843	0.01280	0.00328	0.00240	0.00452	0.00984	0.00457
2	0.00169	0.01020	0.00128	0.00378	0.00557	0.00998	0.00777	0.00318	0.00252	0.00230	0.00947	0.00439
3	0.00126	0.00983	0.00122	0.00801	0.00859	0.00903	0.00996	0.00176	0.00159	0.00359	0.00913	0.00470
4	0.00200	0.00445	0.00190	0.01047	0.00390	0.01594	0.02265	0.00400	0.00375	0.00240	0.00480	0.00153
	-> Will dump: '34130-02_S15_L001.res.gz' this contains damage patterns for: 1 items
	-> Setting threads to: 30 
	-> Will dump: '34130-02_S15_L001.bdamage.gz' this contains damage patterns for: 1 items
	-> Setting threads to: 30 
	-> Will dump: '34130-02_S15_L001.rlens.gz' this contains read length distributions for: 1 items
	-> Setting threads to: 30 
	-> Outputting overall statistic in file: "34130-02_S15_L001.stat"
	-> metaDMG version: v0.4-123-g2cf6a01 (htslib: 1.17-28-ge13611a9) build(May  7 2025 09:54:35)
	-> ../../tools/metaDMG-cpp/metaDMG-cpp getdamage -n 30 -o 34130-1_S14_L001 CarpeDeam/alignments/34130-1_S14_L001.sorted_by_name.bam 
	-> ./metaDMG-cpp refName: (null) min_length: 35 print_length: 5 run_mode: 0 out_prefix: 34130-1_S14_L001 nthreads: 30 ignore_errors: 0
skipping: M03353:64:000000000-CRD57:1:1101:1797:14979 unmapped, this msg is printed: 2 times more
skipping: M03353:64:000000000-CRD57:1:1101:1931:16493 unmapped, this msg is printed: 1 times more
skipping: M03353:64:000000000-CRD57:1:1101:2039:15978 unmapped, this msg is printed: 0 times more
pos	A>C	A>G	A>T	C>A	C>G	C>T	G>A	G>C	G>T	T>A	T>C	T>G
0	0.01128	0.02268	0.00025	0.00491	0.00974	0.00237	0.00585	0.00250	0.00160	0.01029	0.02407	0.00535
1	0.00819	0.01151	0.00627	0.00118	0.00377	0.01344	0.00714	0.01010	0.00448	0.00074	0.00717	0.00244
2	0.00509	0.01822	0.00522	0.00444	0.00384	0.00841	0.01058	0.00529	0.00682	0.00046	0.01475	0.00083
3	0.00093	0.01388	0.00756	0.00019	0.00155	0.01455	0.01580	0.00651	0.00733	0.00089	0.01584	0.00130
4	0.00396	0.00808	0.00275	0.00636	0.00707	0.02645	0.01162	0.00449	0.00948	0.00153	0.00670	0.00048
pos	A>C	A>G	A>T	C>A	C>G	C>T	G>A	G>C	G>T	T>A	T>C	T>G
0	0.01745	0.02869	0.00120	0.00152	0.00657	0.00387	0.00627	0.00802	0.00384	0.00055	0.02315	0.00582
1	0.00204	0.01154	0.00241	0.01128	0.00874	0.00915	0.01378	0.00183	0.00487	0.00797	0.01303	0.00911
2	0.00488	0.00976	0.00045	0.00156	0.00690	0.01526	0.00881	0.00133	0.00358	0.00136	0.01442	0.00407
3	0.00357	0.00967	0.00157	0.00841	0.00357	0.00933	0.00797	0.00319	0.00353	0.00616	0.00220	0.01188
4	0.00095	0.00467	0.00633	0.00603	0.00571	0.01586	0.01844	0.00771	0.00667	0.00226	0.00257	0.00140
	-> Will dump: '34130-1_S14_L001.res.gz' this contains damage patterns for: 1 items
	-> Setting threads to: 30 
	-> Will dump: '34130-1_S14_L001.bdamage.gz' this contains damage patterns for: 1 items
	-> Setting threads to: 30 
	-> Will dump: '34130-1_S14_L001.rlens.gz' this contains read length distributions for: 1 items
	-> Setting threads to: 30 
	-> Outputting overall statistic in file: "34130-1_S14_L001.stat"
Segmentation fault

The files are not readable:

-rwx------ 1 guelou01 nogroup  498 May 21 15:16 R142A_S10_L001.bdamage.gz
-rwx------ 1 guelou01 nogroup  383 May 21 15:16 R142A_S10_L001.res.gz
-rwx------ 1 guelou01 nogroup 1.8K May 21 15:16 R142A_S10_L001.rlens.gz
-rwx------ 1 guelou01 nogroup  123 May 21 15:16 R142A_S10_L001.stat

Link to the Bam files that I cannot upload to github.

I recompiled before trying again and the errors still show up. Linux version:

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Make version:

GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 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.

I hope I included the relevant informations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions