select_by_key segfault with 3.3
dputhier opened this issue · comments
It seems that we are getting back to some instability of select_by_key when using select_by_key under OSX.
67262 cd ../libgtftk/
67263 git pull
67264 cp -Rf ./* ../gtftk/gtftk/src/libgtftk/
67265 cd ..
67266 cd gtftk
67267 make install
67268 gtftk select_by_key -i gtftk/data/simple/simple.gtf -k feature -v transcript
$ gtftk select_by_key -i gtftk/data/simple/simple.gtf -k feature -v transcript
chr1 gtftk transcript 125 138 . + . gene_id "G0001"; transcript_id "G0001T002";
chr1 gtftk transcript 125 138 . + . gene_id "G0001"; transcript_id "G0001T001";
chr1 gtftk transcript 180 189 . + . gene_id "G0002"; transcript_id "G0002T001";
chr1 gtftk transcript 50 61 . - . gene_id "G0003"; transcript_id "G0003T001";
chr1 gtftk transcript 65 76 . + . gene_id "G0004"; transcript_id "G0004T002";
chr1 gtftk transcript 65 76 . + . gene_id "G0004"; transcript_id "G0004T001";
chr1 gtftk transcript 33 47 . - . gene_id "G0005"; transcript_id "G0005T001";
chr1 gtftk transcript 22 35 . - . gene_id "G0006"; transcript_id "G0006T001";
chr1 gtftk transcript 28 35 . - . gene_id "G0006"; transcript_id "G0006T002";
chr1 gtftk transcript 107 116 . + . gene_id "G0007"; transcript_id "G0007T001";
chr1 gtftk transcript 107 116 . + . gene_id "G0007"; transcript_id "G0007T002";
chr1 gtftk transcript 210 222 . - . gene_id "G0008"; transcript_id "G0008T001";
chr1 gtftk transcript 3 14 . - . gene_id "G0009"; transcript_id "G0009T002";
chr1 gtftk transcript 3 14 . - . gene_id "G0009"; transcript_id "G0009T001";
chr1 gtftk transcript 176 186 . + . gene_id "G0010"; transcript_id "G0010T001";
Segmentation fault: 11
Not observed under Linux... OSX specific thus...
The result is OK so the select_by_key function do the job and exit properly. What do you do after the call of select_by_key ?
I suspect that the problem is in the free_gtf_data function, when freeing the indexes related to the gtf_data. I have disabled this in the last push. Can you test it and tell me what happens ?
This is clearly better. You are digging in the right direction.
You should even probably pass all tests if you fix this issue in free_gtf_data call.
I have pushed a new version that free indexes but in a different way. Can you test it ?
OK. I have added some messages in the last push to help me to find the bug. Try it and send me the results please.
$ gtftk short_long -i gtftk/data/simple_03/simple_short_long.gtf -g
col = seqid 0
Updating index table ... OK
col = source 0
Updating index table ... OK
col = feature 0
Updating index table ... OK
col = start 0
Updating index table ... OK
col = end 0
Updating index table ... OK
col = score 0
Updating index table ... OK
col = strand 0
Updating index table ... OK
col = phase 0
Updating index table ... OK
col = attributes 2
freeing index gene_id ... OK
freeing index transcript_id ... OK
Updating index table ... OK
chr1 gtftk gene 125 138 . + . gene_id "G0001";
chr1 gtftk transcript 125 138 . + . gene_id "G0001"; transcript_id "G0001T002";
chr1 gtftk exon 125 138 . + . gene_id "G0001"; transcript_id "G0001T002"; exon_id "G0001T002E001";
chr1 gtftk CDS 125 130 . + . gene_id "G0001"; transcript_id "G0001T002"; ccds_id "CDS_G0001T002";
chr1 gtftk gene 180 189 . + . gene_id "G0002";
chr1 gtftk transcript 185 189 . + . gene_id "G0002"; transcript_id "G0002T002";
chr1 gtftk exon 185 189 . + . gene_id "G0002"; transcript_id "G0002T002"; exon_id "G0002T002E002";
chr1 gtftk CDS 185 186 . + . gene_id "G0002"; transcript_id "G0002T002"; ccds_id "CDS_G0002T002";
chr1 gtftk gene 50 61 . - . gene_id "G0003";
chr1 gtftk transcript 54 61 . - . gene_id "G0003"; transcript_id "G0003T002";
chr1 gtftk exon 54 61 . - . gene_id "G0003"; transcript_id "G0003T002"; exon_id "G0003T002E001";
chr1 gtftk CDS 54 55 . - . gene_id "G0003"; transcript_id "G0003T002"; ccds_id "CDS_G0003T002";
chr1 gtftk gene 65 76 . + . gene_id "G0004";
chr1 gtftk transcript 65 76 . + . gene_id "G0004"; transcript_id "G0004T002";
chr1 gtftk exon 65 68 . + . gene_id "G0004"; transcript_id "G0004T002"; exon_id "G0004T002E001";
chr1 gtftk exon 71 71 . + . gene_id "G0004"; transcript_id "G0004T002"; exon_id "G0004T002E002";
chr1 gtftk exon 74 76 . + . gene_id "G0004"; transcript_id "G0004T002"; exon_id "G0004T002E003";
chr1 gtftk CDS 66 68 . + . gene_id "G0004"; transcript_id "G0004T002"; ccds_id "CDS_G0004T002";
chr1 gtftk CDS 71 71 . + . gene_id "G0004"; transcript_id "G0004T002"; ccds_id "CDS_G0004T002";
chr1 gtftk CDS 74 75 . + . gene_id "G0004"; transcript_id "G0004T002"; ccds_id "CDS_G0004T002";
chr1 gtftk gene 33 47 . - . gene_id "G0005";
chr1 gtftk transcript 33 47 . - . gene_id "G0005"; transcript_id "G0005T001";
chr1 gtftk exon 33 35 . - . gene_id "G0005"; transcript_id "G0005T001"; exon_id "G0005T001E001";
chr1 gtftk exon 42 47 . - . gene_id "G0005"; transcript_id "G0005T001"; exon_id "G0005T001E002";
chr1 gtftk CDS 43 45 . - . gene_id "G0005"; transcript_id "G0005T001"; ccds_id "CDS_G0005T001";
chr1 gtftk gene 22 35 . - . gene_id "G0006";
chr1 gtftk transcript 28 35 . - . gene_id "G0006"; transcript_id "G0006T002";
chr1 gtftk exon 28 30 . - . gene_id "G0006"; transcript_id "G0006T002"; exon_id "G0006T002E001";
chr1 gtftk exon 33 35 . - . gene_id "G0006"; transcript_id "G0006T002"; exon_id "G0006T002E002";
chr1 gtftk CDS 29 30 . - . gene_id "G0006"; transcript_id "G0006T002"; ccds_id "CDS_G0006T002";
chr1 gtftk CDS 33 33 . - . gene_id "G0006"; transcript_id "G0006T002"; ccds_id "CDS_G0006T002";
chr1 gtftk gene 107 116 . + . gene_id "G0007";
chr1 gtftk transcript 107 116 . + . gene_id "G0007"; transcript_id "G0007T001";
chr1 gtftk exon 107 116 . + . gene_id "G0007"; transcript_id "G0007T001"; exon_id "G0007T001E001";
chr1 gtftk CDS 112 114 . + . gene_id "G0007"; transcript_id "G0007T001"; ccds_id "CDS_G0007T001";
chr1 gtftk gene 210 250 . - . gene_id "G0008";
chr1 gtftk transcript 220 250 . - . gene_id "G0008"; transcript_id "G0008T002";
chr1 gtftk exon 220 234 . - . gene_id "G0008"; transcript_id "G0008T002"; exon_id "G0008T002E001";
chr1 gtftk exon 240 250 . - . gene_id "G0008"; transcript_id "G0008T002"; exon_id "G0008T002E002";
chr1 gtftk CDS 220 221 . - . gene_id "G0008"; transcript_id "G0008T002"; ccds_id "CDS_G0008T002";
chr1 gtftk gene 3 14 . - . gene_id "G0009";
chr1 gtftk transcript 3 14 . - . gene_id "G0009"; transcript_id "G0009T002";
chr1 gtftk exon 3 14 . - . gene_id "G0009"; transcript_id "G0009T002"; exon_id "G0009T002E001";
chr1 gtftk CDS 5 10 . - . gene_id "G0009"; transcript_id "G0009T002"; ccds_id "CDS_G0009T002";
chr1 gtftk gene 176 186 . + . gene_id "G0010";
chr1 gtftk transcript 176 186 . + . gene_id "G0010"; transcript_id "G0010T001";
chr1 gtftk exon 176 186 . + . gene_id "G0010"; transcript_id "G0010T001"; exon_id "G0010T001E001";
chr1 gtftk CDS 184 186 . + . gene_id "G0010"; transcript_id "G0010T001"; ccds_id "CDS_G0010T001";
chr1 gtftk gene 250 280 . - . gene_id "G0011";
chr1 gtftk transcript 250 267 . - . gene_id "G0011"; transcript_id "G0011T001";
chr1 gtftk exon 250 259 . - . gene_id "G0011"; transcript_id "G0011T001"; exon_id "G0011T001E001";
chr1 gtftk exon 263 267 . - . gene_id "G0011"; transcript_id "G0011T001"; exon_id "G0011T001E002";
chr1 gtftk CDS 250 251 . - . gene_id "G0011"; transcript_id "G0011T001"; ccds_id "CDS_G0011T001";
col = seqid 0
Updating index table ... OK
col = source 0
Updating index table ... OK
col = feature 0
Updating index table ... OK
col = start 0
Updating index table ... OK
col = end 0
Updating index table ... OK
col = score 0
Updating index table ... OK
col = strand 0
Updating index table ... OK
col = phase 0
Updating index table ... OK
col = attributes 0
Segmentation fault: 11
One more push ... I wait for the results ...
Maybe it should be good for me to have a mac ...
I am on the mac and for me, there is no error. Can you confirm ?
This one is fixed in f52ee30