Bug in Modules.pm

37 views
Skip to first unread message

Lakshay Sethi

unread,
Mar 29, 2021, 5:26:09 PM3/29/21
to Circos
Hello,
I work for Ryan Morin. During the development of one of our projects, we can across a bug.
A path like the following containing -modules fails to produce a plot and produces an  output. For eg:

circos -nosvg -conf /projects/scratch/tmp/TCRBOA7-T-WGS.input.conf -outputdir /home/$USER/test-module -outputfile TCRBOA7-T-WGS.input.png

Output to the aforementioned command: 
ok 1.38 Carp
ok 0.42 Clone
ok 2.63 Config::General
ok 3.75 Cwd
ok 2.167 Data::Dumper
ok 2.55 Digest::MD5
ok 2.85 File::Basename
ok 3.67 File::Spec::Functions
ok 0.2304 File::Temp
ok 1.51 FindBin
ok 0.39 Font::TTF::Font
ok 2.71 GD
ok 0.2 GD::Polyline
ok 2.49 Getopt::Long
ok 1.16 IO::File
ok 0.428 List::MoreUtils
ok 1.4602 List::Util
ok 0.01 Math::Bezier
ok 1.999806 Math::BigFloat
ok 0.07 Math::Round
ok 0.08 Math::VecStat
ok 1.03_01 Memoize
ok 1.76 POSIX
ok 1.29 Params::Validate
ok 1.69 Pod::Usage
ok 2.05 Readonly
ok 2017060201 Regexp::Common
ok 2.84 SVG
ok 1.19 Set::IntSpan
ok 1.6611 Statistics::Basic
ok 2.62 Storable
ok 1.20 Sys::Hostname
ok 2.03 Text::Balanced
ok 0.59 Text::Format
ok 1.9741 Time::HiRes

But this works,

circos -nosvg -conf /projects/scratch/ltmp/TCRBOA7-T-WGS.input.conf -outputdir /home/$USER/test-circos -outputfile TCRBOA7-T-WGS.input.png

In our search, Dr. Morin found this bug in a piece of code in file Modules.pm. This is globally checking every argument without an anchored regex.

if(grep($_ =~ /-modules?/i, @ARGV)) {
for my $m (sort @modules) {
my $is_missing = grep($_->[0] eq $m, @missing) || 0;
$m =~ s/ .*//;
my $version = "";
if(! $is_missing) {
eval { my $ver_str = $m . "::VERSION" ; $version = eval "\$$ver_str" };
$version ||= "?";
}
printf("%s %10s %s\n", $is_missing ? "missing" : "ok",$version,$m);
}
return 0;
}



Reply all
Reply to author
Forward
0 new messages