kbroman / qtl

R/qtl: A QTL mapping environment
https://rqtl.org
GNU General Public License v3.0
77 stars 45 forks source link

More valgrind errors #19

Closed kbroman closed 9 years ago

kbroman commented 10 years ago

See http://www.stats.ox.ac.uk/pub/bdr/memtests/valgrind/qtl-Ex.Rout.

Examples:

subset.scantwo

==9415== Conditional jump or move depends on uninitialised value(s)
==9415==    at 0xFF5848E: summary_scantwo (packages/tests-vg/qtl/src/summary_scantwo.c:224)
==9415==    by 0xFF588E3: R_summary_scantwo (packages/tests-vg/qtl/src/summary_scantwo.c:97)

mqmaugment

==9415== 1,600 bytes in 4 blocks are definitely lost in loss record 174 of 4,075
==9415==    by 0xFF3373E: calloc_init (packages/tests-vg/qtl/src/mqmdatatypes.cpp:111)
==9415==    by 0xFF337C4: newivector (packages/tests-vg/qtl/src/mqmdatatypes.cpp:123)
==9415==    by 0xFF30C9F: mqmaugment (packages/tests-vg/qtl/src/mqmaugment.cpp:288)
==9415==    by 0xFF32746: mqmaugmentfull (packages/tests-vg/qtl/src/mqmaugment.cpp:150)
==9415==    by 0xFF331A6: R_mqmaugment (packages/tests-vg/qtl/src/mqmaugment.cpp:687)
kbroman commented 9 years ago

Fixed the summary.scantwo problem in this commit.

kbroman commented 9 years ago

A bunch of "Conditional jump or move depends on uninitialised value(s)" errors are due to this line in inverseF in mqmregression.cpp.

kbroman commented 9 years ago

Fixed that problem (in inverseF) by replacing the call to info() with a plain call to Rprintf().

kbroman commented 9 years ago

Fixed the remaining valgrind errors (memory leaks in the MQM code) by switching memory allocation from user-controlled R_chk_calloc/Calloc to R_alloc/S_alloc. This way, we don't need to free memory; R garbage collection handles it.

kbroman commented 9 years ago

Clean of valgrind errors as of this commit.