Subject: purify on the core

From: Brad Giaccio <[email-masked]>
Date: Thu, 14 Oct 1999 09:24:00 -0400

I just ran purify on fvwm itself (current cvs) and it seems we just have a couple array bound problems,  but everytime I look at Parse.c I start to get a headache so here is the purify output if anyone wants it.

Brad
---------------

****  Purify instrumented /home/bgiaccio/fvwm23/bin/fvwm2.bgiaccio (pid 15932)  ****
Process 15932 about to exec /home/bgiaccio/fvwm23/bin/fvwm2 as "/home/bgiaccio/fvwm23/bin/fvwm2".
****  Purify instrumented /home/bgiaccio/fvwm23/bin/fvwm2.bgiaccio (pid 15932 at Thu Oct 14 08:57:00 1999)
  * Purify 4.1 Solaris 2, Copyright (C) 1992-1997 Rational Software Corp. All rights reserved. 
  * For contact information type: "purify -help"
  * Command-line: /home/bgiaccio/fvwm23/bin/fvwm2.bgiaccio -cmd \
    FvwmM4 -debug -m4-squote \{ -m4-equote \} -m4opt -DNOINIT -m4opt -DMYVERSION=fvwm23 -m4opt -DFCOMMAND=.FCM-jojo:0.0 .fvwm2rc 
  * Options settings: -best-effort -continue-without-license=yes \
    -cache-dir=/tmp/pcache -thread_safe_locks=no -purify -windows=no \
    -purify-home=/usr/local/bin/pure/purify-4.1-solaris2 -threads=yes \
    -use-internal-locks=yes -thread_stack_change=0x4000 -mt_safe_malloc=yes 
PureLA: 7 simple licenses, 20 users.  Please remedy.
  * Purify licensed to PACIFIC-SIERRA RESEARCH CORP or Pacific Sierra Research Corp.
  * Purify checking enabled.

****  Purify instrumented /home/bgiaccio/fvwm23/bin/fvwm2.bgiaccio (pid 15932)  ****
UMR: Uninitialized memory read:
  * This is occurring while in:
        _writev        [libc.so.1]
        writev         [libthread.so.1]
        _X11TransWritev [libX11.so.6.0]
        _XSend         [libX11.so.6.0]
        XQueryExtension [libX11.so.6.0]
        XInitExtension [libX11.so.6.0]
  * Reading 8 bytes from 0x115e48 in the heap (1 byte at 0x115e49 uninit).
  * Address 0x115e48 is at the beginning of a malloc'd block of 2048 bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        XOpenDisplay   [libX11.so.6.0]
        main           [fvwm.c:348]
        _start         [crt1.o]
updating styles

****  Purify instrumented /home/bgiaccio/fvwm23/bin/fvwm2.bgiaccio (pid 15932)  ****
ABR: Array bounds read:
  * This is occurring while in:
        SkipSpaces     [Parse.c:130]
        DoPeekToken    [Parse.c:211]
        DoGetNextToken [Parse.c:323]
        GetNextToken   [Parse.c:335]
        ReadDecorFace  [builtins.c:1644]
        ReadTitleButton [builtins.c:1841]
  * Reading 1 byte from 0x11b910 in the heap.
  * Address 0x11b910 is 6 bytes past end of a malloc'd block at 0x11b8f0 of 27 bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        safemalloc     [safemalloc.c:42]
        expand         [functions.c:447]
        ExecuteFunction [functions.c:785]
        AddToDecor     [builtins.c:1902]
        add_another_item [builtins.c:246]

****  Purify instrumented /home/bgiaccio/fvwm23/bin/fvwm2.bgiaccio (pid 15932)  ****
ABR: Array bounds read:
  * This is occurring while in:
        SkipSpaces     [Parse.c:130]
        DoPeekToken    [Parse.c:211]
        DoGetNextToken [Parse.c:323]
        GetNextToken   [Parse.c:335]
        ReadDecorFace  [builtins.c:1644]
        ReadTitleButton [builtins.c:1841]
  * Reading 1 byte from 0x11b910 in the heap.
  * Address 0x11b910 is 6 bytes past end of a malloc'd block at 0x11b8f0 of 27 bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        safemalloc     [safemalloc.c:42]
        expand         [functions.c:447]
        ExecuteFunction [functions.c:785]
        AddToDecor     [builtins.c:1902]
        add_another_item [builtins.c:246]

****  Purify instrumented /home/bgiaccio/fvwm23/bin/fvwm2.bgiaccio (pid 15932)  ****
ABR: Array bounds read:
  * This is occurring while in:
        CopyToken      [Parse.c:145]
        DoPeekToken    [Parse.c:212]
        DoGetNextToken [Parse.c:323]
        GetNextToken   [Parse.c:335]
        ReadDecorFace  [builtins.c:1644]
        ReadTitleButton [builtins.c:1841]
  * Reading 1 byte from 0x11b910 in the heap.
  * Address 0x11b910 is 6 bytes past end of a malloc'd block at 0x11b8f0 of 27 bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        safemalloc     [safemalloc.c:42]
        expand         [functions.c:447]
        ExecuteFunction [functions.c:785]
        AddToDecor     [builtins.c:1902]
        add_another_item [builtins.c:246]

****  Purify instrumented /home/bgiaccio/fvwm23/bin/fvwm2.bgiaccio (pid 15932)  ****
ABR: Array bounds read:
  * This is occurring while in:
        CopyToken      [Parse.c:145]
        DoPeekToken    [Parse.c:212]
        DoGetNextToken [Parse.c:323]
        GetNextToken   [Parse.c:335]
        ReadDecorFace  [builtins.c:1644]
        ReadTitleButton [builtins.c:1841]
  * Reading 1 byte from 0x11b910 in the heap.
  * Address 0x11b910 is 6 bytes past end of a malloc'd block at 0x11b8f0 of 27 bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        safemalloc     [safemalloc.c:42]
        expand         [functions.c:447]
        ExecuteFunction [functions.c:785]
        AddToDecor     [builtins.c:1902]
        add_another_item [builtins.c:246]

****  Purify instrumented /home/bgiaccio/fvwm23/bin/fvwm2.bgiaccio (pid 15932)  ****
ABR: Array bounds read:
  * This is occurring while in:
        CopyToken      [Parse.c:174]
        DoPeekToken    [Parse.c:212]
        DoGetNextToken [Parse.c:323]
        GetNextToken   [Parse.c:335]
        ReadDecorFace  [builtins.c:1644]
        ReadTitleButton [builtins.c:1841]
  * Reading 1 byte from 0x11b910 in the heap.
  * Address 0x11b910 is 6 bytes past end of a malloc'd block at 0x11b8f0 of 27 bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        safemalloc     [safemalloc.c:42]
        expand         [functions.c:447]
        ExecuteFunction [functions.c:785]
        AddToDecor     [builtins.c:1902]
        add_another_item [builtins.c:246]

****  Purify instrumented /home/bgiaccio/fvwm23/bin/fvwm2.bgiaccio (pid 15932)  ****
ABR: Array bounds read:
  * This is occurring while in:
        SkipSpaces     [Parse.c:130]
        DoPeekToken    [Parse.c:211]
        DoGetNextToken [Parse.c:323]
        GetNextToken   [Parse.c:335]
        ReadDecorFace  [builtins.c:1644]
        ReadTitleButton [builtins.c:1861]
  * Reading 1 byte from 0x11b910 in the heap.
  * Address 0x11b910 is 6 bytes past end of a malloc'd block at 0x11b8f0 of 27 bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        safemalloc     [safemalloc.c:42]
        expand         [functions.c:447]
        ExecuteFunction [functions.c:785]
        AddToDecor     [builtins.c:1902]
        add_another_item [builtins.c:246]

****  Purify instrumented /home/bgiaccio/fvwm23/bin/fvwm2.bgiaccio (pid 15932)  ****
ABR: Array bounds read:
  * This is occurring while in:
        SkipSpaces     [Parse.c:130]
        DoPeekToken    [Parse.c:211]
        DoGetNextToken [Parse.c:323]
        GetNextToken   [Parse.c:335]
        ReadDecorFace  [builtins.c:1644]
        ReadTitleButton [builtins.c:1861]
  * Reading 1 byte from 0x11b910 in the heap.
  * Address 0x11b910 is 6 bytes past end of a malloc'd block at 0x11b8f0 of 27 bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        safemalloc     [safemalloc.c:42]
        expand         [functions.c:447]
        ExecuteFunction [functions.c:785]
        AddToDecor     [builtins.c:1902]
        add_another_item [builtins.c:246]

****  Purify instrumented /home/bgiaccio/fvwm23/bin/fvwm2.bgiaccio (pid 15932)  ****
ABR: Array bounds read:
  * This is occurring while in:
        CopyToken      [Parse.c:145]
        DoPeekToken    [Parse.c:212]
        DoGetNextToken [Parse.c:323]
        GetNextToken   [Parse.c:335]
        ReadDecorFace  [builtins.c:1644]
        ReadTitleButton [builtins.c:1861]
  * Reading 1 byte from 0x11b910 in the heap.
  * Address 0x11b910 is 6 bytes past end of a malloc'd block at 0x11b8f0 of 27 bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        safemalloc     [safemalloc.c:42]
        expand         [functions.c:447]
        ExecuteFunction [functions.c:785]
        AddToDecor     [builtins.c:1902]
        add_another_item [builtins.c:246]

****  Purify instrumented /home/bgiaccio/fvwm23/bin/fvwm2.bgiaccio (pid 15932)  ****
ABR: Array bounds read:
  * This is occurring while in:
        CopyToken      [Parse.c:145]
        DoPeekToken    [Parse.c:212]
        DoGetNextToken [Parse.c:323]
        GetNextToken   [Parse.c:335]
        ReadDecorFace  [builtins.c:1644]
        ReadTitleButton [builtins.c:1861]
  * Reading 1 byte from 0x11b910 in the heap.
  * Address 0x11b910 is 6 bytes past end of a malloc'd block at 0x11b8f0 of 27 bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        safemalloc     [safemalloc.c:42]
        expand         [functions.c:447]
        ExecuteFunction [functions.c:785]
        AddToDecor     [builtins.c:1902]
        add_another_item [builtins.c:246]

****  Purify instrumented /home/bgiaccio/fvwm23/bin/fvwm2.bgiaccio (pid 15932)  ****
ABR: Array bounds read:
  * This is occurring while in:
        CopyToken      [Parse.c:174]
        DoPeekToken    [Parse.c:212]
        DoGetNextToken [Parse.c:323]
        GetNextToken   [Parse.c:335]
        ReadDecorFace  [builtins.c:1644]
        ReadTitleButton [builtins.c:1861]
  * Reading 1 byte from 0x11b910 in the heap.
  * Address 0x11b910 is 6 bytes past end of a malloc'd block at 0x11b8f0 of 27 bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        safemalloc     [safemalloc.c:42]
        expand         [functions.c:447]
        ExecuteFunction [functions.c:785]
        AddToDecor     [builtins.c:1902]
        add_another_item [builtins.c:246]

****  Purify instrumented /home/bgiaccio/fvwm23/bin/fvwm2.bgiaccio (pid 15932)  ****
UMR: Uninitialized memory read:
  * This is occurring while in:
        _writev        [libc.so.1]
        writev         [libthread.so.1]
        _X11TransWritev [libX11.so.6.0]
        _XSend         [libX11.so.6.0]
        XQueryColors   [libX11.so.6.0]
        CreateColors   [libXpm.so.4.11]
  * Reading 2048 bytes from 0x115e48 in the heap (1 byte at 0x116289 uninit).
  * Address 0x115e48 is at the beginning of a malloc'd block of 2048 bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        XOpenDisplay   [libX11.so.6.0]
        main           [fvwm.c:348]
        _start         [crt1.o]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
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: Fri, 15 Oct 1999 03:54:58 +0200

On Thu, Oct 14, 1999 at 09:24:00AM -0400, [email-masked] wrote:
> I just ran purify on fvwm itself (current cvs) and it seems we just
> have a couple array bound problems,  but everytime I look at Parse.c
> I start to get a headache so here is the purify output if anyone wants it.

Can you imagine my headaches when I *wrote* this stuff :-)  In general when
you see array bound problems in Parse.c it's almost guaranteed to come
from the memory that is parsed, not from Parse.c itself (because the stuff
in Parse.c has been tested a million times).

>         XOpenDisplay   [libX11.so.6.0]

This one looks strange.  From where in fvwm is it called?

>         GetNextToken   [Parse.c:335]

If you chase the function calls above you will see that SkipSpaces simply
spooled over the end of the allocated area (that comes from the call to
GetNextToken).  Since it read only one byte past the end this probably
means that no memory had been allocated for the final zero.  The error must
be in ReadDecorFace or ReadTitleButton (which sounds very likely since I
rewrote part of the code recently).

>         XOpenDisplay   [libX11.so.6.0]

Another one where you can't see from where it's called :(

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.fvwm.org/>.
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: Dan Espen <[email-masked]>
Date: Thu, 14 Oct 1999 22:01:26 -0400

> >         XOpenDisplay   [libX11.so.6.0]
                           ^^^^^^^^^^^
> Another one where you can't see from where it's called :(

Its a UMR in XOpenDisplay called from line 348 in fvwm.c.

There's all kinds of UMRs in X, Motif, just about anything I've
run into.  There not worth worrying about.

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
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: Fri, 15 Oct 1999 04:14:36 +0200

> >         ReadTitleButton [builtins.c:1841]

Brad, can you find single out an example (Add)TitleStyle or (Add)ButtonStyle
line in your config file that shows the problem?

Bye

Dominik ^_^