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@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Valgrind
From: Christian Knoke <chrisk@xxxxxxxxx>
Date: Sat, 20 Nov 2004 18:30:15 +0100

On Sat, Nov 20, 2004 at 09:43:59AM -0600, Mike Kaufman wrote:
> On Sat, Nov 20, 2004 at 02:18:32PM +0100, Christian Knoke wrote:
> > 
> > Is the output of valgrind of any interest, and when?
> 
> it is of interest. when there are memory leaks that that we can fix, i.e.
> not in libraries like libc or readline.

Are there any options you can recommend for valgrind?

Ok then, here are some snippets out of the error log, just tell me whether
they are useful or not. I'll learn by try and error :)

I got some of these:

==3772==  Address 0x1C4BF918 is 128 bytes inside a block of size 2048
alloc'd
==3772==    at 0x1B905901: calloc (vg_replace_malloc.c:176)
==3772==    by 0x1BF6909C: XOpenDisplay (in /usr/X11R6/lib/libX11.so.6.2)
==3772==    by 0x1BC17FE1: gdk_display_open (gdkdisplay-x11.c:151)       
==3772==    by 0x1BBF7BA5: gdk_display_open_default_libgtk_only (gdk.c:403)

ot this:

==3772==  Address 0x1CA480CB is 115 bytes inside a block of size 40960
alloc'd
==3772==    at 0x1B904EDD: malloc (vg_replace_malloc.c:131)
==3772==    by 0x8098A06: fc_real_malloc (mem.c:79)        
==3772==    by 0x80A528B: new_socket_packet_buffer (connection.c:466)
==3772==    by 0x80A56A7: connection_common_init (connection.c:610)      

These look interesting to me:

==3772== Use of uninitialised value of size 4
==3772==    at 0x80C7FCF: send_packet_player_attribute_chunk_100
(packets_gen.c:11245)
==3772==    by 0x80AF267: send_attribute_block (packets.c:599)
==3772==    by 0x806AECF: attribute_flush (attribute.c:262)   
==3772==    by 0x806E441: send_turn_done (civclient.c:389)    
==3772== 

==3772== Conditional jump or move depends on uninitialised value(s)
==3772==    at 0x80C7FD1: send_packet_player_attribute_chunk_100   
(packets_gen.c:11245)
==3772==    by 0x80AF267: send_attribute_block (packets.c:599)
==3772==    by 0x806AECF: attribute_flush (attribute.c:262)   
==3772==    by 0x806E441: send_turn_done (civclient.c:389)    

and then a lot of those:

==3772==  Address 0x1C578E14 is 60 bytes inside a block of size 120 free'd
==3772==    at 0x1B905460: free (vg_replace_malloc.c:153)
==3772==    by 0x1BE27527: (within /lib/libc-2.3.2.so)
==3772==    by 0x1BEE5E52: (within /lib/libc-2.3.2.so)   
==3772==    by 0x1BEE5E6E: (within /lib/libc-2.3.2.so)   
==3772== 
==3772== ERROR SUMMARY: 1358 errors from 22 contexts (suppressed: 85 from 1)
==3772== malloc/free: in use at exit: 4647556 bytes in 51139 blocks.        
==3772== malloc/free: 6300877 allocs, 6249738 frees, 470566294 bytes

Christian

-- 
Christian Knoke            * * *            http://cknoke.de
* * * * * * * * *  Ceterum censeo Microsoft esse dividendum.



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