Subject: Purify results

From: "Paul D. Smith" <[email-masked]>
Date: Wed, 2 Dec 1998 18:53:24 -0800 (PST)

Forgot to send this earlier, sorry.

OK, after a couple of days fighting with (and, for the most part,
winning... yay! :) bugs, UMRs, and heap rot in fvwm2 I committed a bunch
of fixes this afternoon; with those fixes fvwm2 will run the purify test
suite with no errors, and only leaking a bit over 400 bytes!  Pretty
good, since it started out leaking over 32K... those fonts take up a
_lot_ of memory, and if you leak a few of them...

Anyway, here's the latest log.  Most of it is in menus.c but there're a
few others.  The one in SetEnv() is tricky, since the putenv() function
drops the old memory on the floor if you invoke it again with the same
variable.  Not sure if there's any reasonable way to fix this; since the
memory involved is small it may be more trouble than it's worth to fix.

****  Purify instrumented fvwm2 (pid 19178 at Wed Dec  2 14:20:06 1998)
  * Purify 4.1 Solaris 2, Copyright (C) 1992-1997 Rational Software Corp. All rights reserved. 
  * For contact information type: "purify -help"
  * Command-line: fvwm2 -display :1 
  * Options settings: -logfile=./%v.log -output-limit=5000000 -chain-length=25 \
    -always-stop -purify -purify-home=/app/pure/purify-4.1-solaris2 
PureLA: 35 simple licenses, 51 users.  Please remedy.
  * Purify licensed to BAY NETWORKS
  * Purify checking enabled.

****  Purify instrumented fvwm2 (pid 19178)  ****
Process 19206 about to exec /bin/sh as "sh".

****  Purify instrumented fvwm2 (pid 19178)  ****
Process 19208 about to exec /bin/sh as "sh".

****  Purify instrumented fvwm2 (pid 19178)  ****
Current file descriptors in use: 5
FIU: file descriptor 0: <stdin>
FIU: file descriptor 1: <stdout>
FIU: file descriptor 2: <stderr>
FIU: file descriptor 26: <reserved for Purify internal use>
FIU: file descriptor 27: <reserved for Purify internal use>

****  Purify instrumented fvwm2 (pid 19178)  ****
Purify: Searching for all memory leaks...

Memory leaked: 403 bytes (0.229%); potentially leaked: 0 bytes (0%)

MLK: 120 bytes leaked in 2 blocks
  * This memory was allocated from:
	malloc         [rtlib.o]
	safemalloc     [safemalloc.c:18]
	AddToMenu      [menus.c:2454]
	add_item_to_menu [builtins.c:499]
	ExecuteFunction [functions.c:260]
	ReadSubFunc    [read.c:161]
	ReadFile       [read.c:182]
	ExecuteFunction [functions.c:260]
	main           [fvwm.c:389]
	_start         [crt1.o]
  * Block of 60 bytes (2 times); last block at 0x121788

MLK: 81 bytes leaked in 9 blocks
  * This memory was allocated from:
	malloc         [rtlib.o]
	XGetWindowProperty [libX11.so.6.1]
	XGetTextProperty [libX11.so.6.1]
	XGetWMName     [libX11.so.6.1]
	AddWindow      [add_window.c:135]
	HandleMapRequestKeepRaised [events.c:720]
	HandleMapRequest [events.c:699]
	DispatchEvent  [events.c:155]
	wait_func      [builtins.c:969]
	ExecuteFunction [functions.c:260]
	ComplexFunction [complex.c:159]
	ExecuteFunction [functions.c:260]
	ReadSubFunc    [read.c:161]
	ReadFile       [read.c:182]
	ExecuteFunction [functions.c:260]
	main           [fvwm.c:389]
	_start         [crt1.o]
  * Block of 11 bytes (3 times); last block at 0x1346e0
  * Block of 8 bytes (6 times); last block at 0x1633e8

MLK: 68 bytes leaked in 3 blocks
  * This memory was allocated from:
	malloc         [rtlib.o]
	XpmCreateImageFromXpmImage [libXpm.so.4.8]
	XpmCreatePixmapFromXpmImage [libXpm.so.4.8]
	LoadPicture    [Picture.c:99]
	CachePicture   [Picture.c:170]
	ReadButtonFace [builtins.c:2564]
	ReadTitleButton [builtins.c:2801]
	SetTitleStyle  [builtins.c:2204]
	ExecuteFunction [functions.c:260]
	ReadSubFunc    [read.c:161]
	ReadFile       [read.c:182]
	ExecuteFunction [functions.c:260]
	main           [fvwm.c:389]
	_start         [crt1.o]
  * Block of 28 bytes at 0x1235d8
  * Block of 20 bytes (2 times); last block at 0x141d80

MLK: 48 bytes leaked in 2 blocks
  * This memory was allocated from:
	malloc         [rtlib.o]
	XpmCreateImageFromXpmImage [libXpm.so.4.8]
	XpmCreatePixmapFromXpmImage [libXpm.so.4.8]
	LoadPicture    [Picture.c:99]
	CachePicture   [Picture.c:170]
	ReadButtonFace [builtins.c:2564]
	ReadTitleButton [builtins.c:2801]
	AddTitleStyle  [builtins.c:2116]
	ExecuteFunction [functions.c:260]
	ReadSubFunc    [read.c:161]
	ReadFile       [read.c:182]
	ExecuteFunction [functions.c:260]
	main           [fvwm.c:389]
	_start         [crt1.o]
  * Block of 28 bytes at 0x110158
  * Block of 20 bytes at 0x134db8

MLK: 32 bytes leaked in 2 blocks
  * This memory was allocated from:
	malloc         [rtlib.o]
	XpmCreateImageFromXpmImage [libXpm.so.4.8]
	XpmCreatePixmapFromXpmImage [libXpm.so.4.8]
	LoadPicture    [Picture.c:99]
	CachePicture   [Picture.c:170]
	ReadButtonFace [builtins.c:2564]
	SetBorderStyle [builtins.c:2045]
	ExecuteFunction [functions.c:260]
	ReadSubFunc    [read.c:161]
	ReadFile       [read.c:182]
	ExecuteFunction [functions.c:260]
	main           [fvwm.c:389]
	_start         [crt1.o]
  * Block of 20 bytes at 0x141180
  * Block of 12 bytes at 0x1253a0

MLK: 20 bytes leaked at 0x1257b8
  * This memory was allocated from:
	malloc         [rtlib.o]
	XpmCreateImageFromXpmImage [libXpm.so.4.8]
	XpmCreatePixmapFromXpmImage [libXpm.so.4.8]
	LoadPicture    [Picture.c:99]
	CachePicture   [Picture.c:170]
	scanForPixmap  [menus.c:2371]
	AddToMenu      [menus.c:2540]
	add_another_item [builtins.c:528]
	ExecuteFunction [functions.c:260]
	ReadSubFunc    [read.c:161]
	ReadFile       [read.c:182]
	ExecuteFunction [functions.c:260]
	main           [fvwm.c:389]
	_start         [crt1.o]

MLK: 16 bytes leaked at 0x1174f0
  * This memory was allocated from:
	malloc         [rtlib.o]
	safemalloc     [safemalloc.c:18]
	SetEnv         [builtins.c:3511]
	ExecuteFunction [functions.c:260]
	ReadSubFunc    [read.c:161]
	ReadFile       [read.c:182]
	ExecuteFunction [functions.c:260]
	main           [fvwm.c:389]
	_start         [crt1.o]

MLK: 12 bytes leaked in 2 blocks
  * This memory was allocated from:
	malloc         [rtlib.o]
	safemalloc     [safemalloc.c:18]
	stripcpy       [Strings.c:104]
	AddToMenu      [menus.c:2592]
	add_item_to_menu [builtins.c:499]
	ExecuteFunction [functions.c:260]
	ReadSubFunc    [read.c:161]
	ReadFile       [read.c:182]
	ExecuteFunction [functions.c:260]
	main           [fvwm.c:389]
	_start         [crt1.o]
  * Block of 6 bytes (2 times); last block at 0x1216a0

MLK: 6 bytes leaked in 2 blocks
  * This memory was allocated from:
	malloc         [rtlib.o]
	safemalloc     [safemalloc.c:18]
	AddToMenu      [menus.c:2505]
	add_item_to_menu [builtins.c:499]
	ExecuteFunction [functions.c:260]
	ReadSubFunc    [read.c:161]
	ReadFile       [read.c:182]
	ExecuteFunction [functions.c:260]
	main           [fvwm.c:389]
	_start         [crt1.o]
  * Block of 3 bytes (2 times); last block at 0x11bb50

Purify Heap Analysis (combining suppressed and unsuppressed blocks)
                         Blocks      Bytes
              Leaked         24        403
  Potentially Leaked          0          0
              In-Use       3185     175944
  ----------------------------------------
     Total Allocated       3209     176347

****  Purify instrumented fvwm2 (pid 19178)  ****
  * Program exited with status code 0.
  * 0 access errors, 0 total occurrences.
  * 403 bytes leaked.
  * 0 bytes potentially leaked.
  * Basic memory usage (including Purify overhead):
      869092 code
      100916 data/bss
     1138688 heap (peak use)
        3960 stack
  * Shared library memory usage (including Purify overhead):
      111762 libXpm.so.4.8_pure_p3_c0_410_551 (shared code)
        1940 libXpm.so.4.8_pure_p3_c0_410_551 (private data)
       53075 libSM.so.6.0_pure_p3_c0_410_551 (shared code)
        1976 libSM.so.6.0_pure_p3_c0_410_551 (private data)
      104026 libICE.so.6.3_pure_p3_c0_410_551 (shared code)
        9792 libICE.so.6.3_pure_p3_c0_410_551 (private data)
       86580 libXext.so.6.3_pure_p3_c0_410_551 (shared code)
        1756 libXext.so.6.3_pure_p3_c0_410_551 (private data)
     1302584 libX11.so.6.1_pure_p3_c0_410_551 (shared code)
       32208 libX11.so.6.1_pure_p3_c0_410_551 (private data)
       75074 libsocket.so.1_pure_p3_c0_410_551 (shared code)
        4092 libsocket.so.1_pure_p3_c0_410_551 (private data)
      611942 libnsl.so.1_pure_p3_c0_410_551 (shared code)
      115856 libnsl.so.1_pure_p3_c0_410_551 (private data)
      799709 libc.so.1_pure_p3_c0_410_551 (shared code)
       34736 libc.so.1_pure_p3_c0_410_551 (private data)
        1216 libdl.so.1_pure_p3_c0_410_551 (shared code)
           0 libdl.so.1_pure_p3_c0_410_551 (private data)
        9576 libinternal_stubs.so.1 (shared code)
         324 libinternal_stubs.so.1 (private data)
       15137 libintl.so.1_pure_p3_c0_410_551 (shared code)
        1300 libintl.so.1_pure_p3_c0_410_551 (private data)
       16092 libmp.so.1_pure_p3_c0_410_551 (shared code)
         828 libmp.so.1_pure_p3_c0_410_551 (private data)
       37909 libw.so.1_pure_p3_c0_410_551 (shared code)
        1628 libw.so.1_pure_p3_c0_410_551 (private data)

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 3 Dec 1998 13:56:30 +0100

On Wed, Dec 02, 1998 at 06:53:24PM -0800, Paul Smith wrote:
> few others.

I'm out of ideas regarding the AddToMenu leaks. I've tried at
least three times to find them but couldn't. Any help is
appreciated.

> The one in SetEnv() is tricky, since the putenv() function

I'd still fix the (SetEnv) leak, just to make it clean.

Bye

Dominik
-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 3 Dec 1998 14:10:11 +0100

On Wed, Dec 02, 1998 at 06:53:24PM -0800, Paul Smith wrote:
> Pretty

Well, the next step should be to clean up the larger modules and
extras:

FvwmButtons
FvwmIconMan
FvwmTaskBar
FvwmWinList
FvwmWharf

So, if anyone is willing to write a purify script for one of them...
Buttons and IconMan are the biggest problems. Although I've worked
on them a bit there are definitely lots of leaks left.

Bye

Dominik