Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] Re: Valgrind
Home

[Freeciv-Dev] Re: Valgrind

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Freeciv-Dev" <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Valgrind
From: "John Bauman" <john@xxxxxxxxxxxxxxxx>
Date: Sat, 20 Nov 2004 15:25:53 -0500


----- Original Message ----- From: "Jason Dorje Short" <jdorje@xxxxxxxxxxxx> To: "Christian Knoke" <chrisk@xxxxxxxxx>; "Freeciv-Dev" <freeciv-dev@xxxxxxxxxxx>
Sent: Saturday, November 20, 2004 12:56 PM
Subject: [Freeciv-Dev] Re: Valgrind


Christian Knoke wrote:
I just discovered valgrind.

Is the output of valgrind of any interest, and when?

Leak reports from valgrind are interesting. You have to give --leak-check=yes on the command line. I've done this from time to time with the server, but because valgrind is so slow I don't take the game past -3000 or so. Running it with either server or client under a more vigorous game would probably give some good output. But it would take a long time.

Any valgrind warning is potentially useful. The problem is valgrind gives lots of warnings in libraries (particularly libgtk, gettext, and libreadline). These are probably actually errors in those libraries but I don't know what to do about them. But once I discovered a bug in zlib this way (which they fixed). Any warning it gives you that comes from Freeciv code is surely of interest and should be reported in its own separate ticket.

Another common problem Valgrind reports is "Uninitialized data in write() call". This happens in the network code. If we leave any packet fields unitialized when sending a packet this will happen, but the valgrind backtrace generally isn't useful to help us find it. Nonetheless it is a problem and should be reported.

Generally you should always run valgrind with --num-callers=50 to make sure you get a sufficiently long backtrace.

Valgrind has a method of suppressing certain types of warnings. If someone figured out how this worked we could probably make a Freeciv suppression file that would ignore the warnings we don't care about.
A valgrind HOWTO ( http://electra.lbl.gov/ATLAS/valgrind_HOWTO.html ) says that you can have valgrind create its own suppression file by using the "--gen-suppressions=yes" option. I don't have valgrind installed, but that seems to be worth a shot.


jason







[Prev in Thread] Current Thread [Next in Thread]