|
From: Tim G. <tg...@sh...> - 2006-04-19 10:22:26
|
Hi, I am using valgrind 3.1.1 on Debian etch with gcc-4.0.3 The program was compiled with the flags CFLAGS = -O2 -g -fPIC -Wall I ran my program with valgrind myprog myargs and get many messages of the following kind in the output: ==4536== Conditional jump or move depends on uninitialised value(s) ==4536== at 0x411C1B9: sqrt (in /lib/tls/libm-2.3.6.so) ==4536== by 0x8125E0A: MapFragment::rigid_body_improve_fit(clipper::Xmap<double> const&) (map_fragment.cpp:507) ==4536== by 0x80B2C98: BaseCluster::improve_fit_of_selection() (base_cluster.cpp:357) ==4536== by 0x80B35E7: BaseCluster::createSelection(unsigned) (base_cluster.cpp:655) ==4536== by 0x80D0A32: Delegator::mol_scan_ebodies(clipper::Xmap<double> const&, Molekel const&, int, int) (delegator.cpp:785) ==4536== by 0x80D2769: Delegator::ebodies_to_fragments(clipper::Xmap<double> const&) (delegator.cpp:610) ==4536== by 0x80D2D46: Delegator::run_with_map(clipper::Xmap<double> const&) (delegator.cpp:961) ==4536== by 0x80D46E1: Delegator::run() (delegator.cpp:1179) ==4536== by 0x810FD62: main (main.cpp:96) ==4536== Line 507 in file map_fragment.cpp reads: double angle = scaleR * std::sqrt(rotation.lengthsq()); scaleR is declared as const double scaleR = 0.25; and rotation as oCoord rotation = molcur.get_rigid_body_rotn_axis(grads); So none of the variable used in line 507 ar uninitialiesd, nor is rotation.lengthsq() a negative number. Since valgrind claims that ==4536== More than 100000 total errors detected. I'm not reporting any more. ==4536== Final error counts will be inaccurate. Go fix your program! ==4536== Rerun with --error-limit=no to disable this cutoff. Note ==4536== that errors may occur in your program without prior warning from ==4536== Valgrind, because errors are no longer being displayed. I would love to know what that message means, whether it is a real problem and how I should fix it. Sincerely, Tim Gruene -- Tim Gruene Institut fuer anorganische Chemie Tammannstr. 4 D-37077 Goettingen GPG Key ID = A46BEE1A |
|
From: Julian S. <js...@ac...> - 2006-04-19 10:44:06
|
> CFLAGS = -O2 -g -fPIC -Wall I'd back off the optimisation to -O if you can; that generally helps. > Line 507 in file map_fragment.cpp reads: > double angle = scaleR * std::sqrt(rotation.lengthsq()); > > scaleR is declared as > const double scaleR = 0.25; > and rotation as > oCoord rotation = molcur.get_rigid_body_rotn_axis(grads); scaleR is clearly initialised, but the fact that rotation is computed by calling a function has no significance, since undefinedness is tracked across function calls and the like. See http://www.valgrind.org/docs/manual/mc-manual.html#mc-manual.machine for details. One possible explanation for what you're seeing is that molcur.get_rigid_body_rotn_axis(grads) is producing an undefined value; go look in there. J |
|
From: Tim G. <tg...@sh...> - 2006-04-19 14:27:07
|
ooops, you are right, molcur.get_rigid_body_rotn_axis(grads); does use an uninitialised variable that is only updated by an '+=' expression. Sorry for not looking more carefully. At least the post helped me interprete valgrind output better. Thanks for the answers, Tim -- Tim Gruene Institut fuer anorganische Chemie Tammannstr. 4 D-37077 Goettingen GPG Key ID = A46BEE1A On Wed, 19 Apr 2006, Julian Seward wrote: > > > CFLAGS = -O2 -g -fPIC -Wall > > I'd back off the optimisation to -O if you can; that generally > helps. > > > Line 507 in file map_fragment.cpp reads: > > double angle = scaleR * std::sqrt(rotation.lengthsq()); > > > > scaleR is declared as > > const double scaleR = 0.25; > > and rotation as > > oCoord rotation = molcur.get_rigid_body_rotn_axis(grads); > > scaleR is clearly initialised, but the fact that rotation is computed > by calling a function has no significance, since undefinedness is > tracked across function calls and the like. See > http://www.valgrind.org/docs/manual/mc-manual.html#mc-manual.machine > for details. > > One possible explanation for what you're seeing is that > molcur.get_rigid_body_rotn_axis(grads) > is producing an undefined value; go look in there. > > J > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |
|
From: Dennis L. <pla...@in...> - 2006-04-19 10:47:22
|
Am Mittwoch, den 19.04.2006, 12:22 +0200 schrieb Tim Gruene: > Hi, > > Line 507 in file map_fragment.cpp reads: > double angle = scaleR * std::sqrt(rotation.lengthsq()); > > scaleR is declared as > const double scaleR = 0.25; > and rotation as > oCoord rotation = molcur.get_rigid_body_rotn_axis(grads); > > So none of the variable used in line 507 ar uninitialiesd, nor is > rotation.lengthsq() a negative number. Some part of rotation.lengthsq() could be unitialized. Use valgrind client requests that check for definedness on all those values involved to figure out where it comes from. And to your later question, yes its some real error that looks like it should be fixed. greets Dennis |