Subject: fvwm2 core dump

From: Olivier Chapuis <[email-masked]>
Date: Tue, 28 Mar 2000 10:50:07 +0200

Hello,
I've got a core dump if I do the following:

Start fvwm without config.
Open the FvwmConsole and in the console:

Style * HilightBack DarkBlue
Style * MWMBorder

Then move the console with the window border

==> core dump

[olivier@snoopy olivier]$ gdb fvwm2 core
GNU gdb 4.17
Core was generated by `fvwm2'.
Program terminated with signal 11, Erreur de segmentation..
find_solib: Can't read pathname for load map: Erreur d'entrée/sortie.

#0  0x401461ad in ?? () from /lib/libc.so.6
(gdb) where
#0  0x401461ad in ?? () from /lib/libc.so.6
#1  0x401460c5 in ?? () from /lib/libc.so.6
#2  0x80859f7 in safemalloc (length=6) at safemalloc.c:42
#3  0x8071559 in expand (input=0x80a2200 "Raise", arguments=0xbffff72c, 
    tmp_win=0x80a3b98, addto=0) at functions.c:469
#4  0x807247e in execute_complex_function (eventp=0x808f6a0, w=12582993, 
    tmp_win=0x80a3b98, context=32, 
    action=0x80a35b0 "FuncFvwmRaiseLowerX Move", Module=0xbffff7ec, 
    desperate=0xbffff7a0, expand_cmd=DONT_EXPAND_COMMAND) at functions.c:1333
#5  0x8071cb7 in ExecuteFunction (Action=0x80a1a98 "FuncFvwmRaiseLowerX Move", 
    tmp_win=0x80a3b98, eventp=0x808f6a0, context=32, Module=-1, 
    expand_cmd=EXPAND_COMMAND) at functions.c:864
#6  0x8063f60 in HandleButtonPress () at events.c:1579
#7  0x80623a2 in DispatchEvent (preserve_Tmp_win=0) at events.c:210
#8  0x8062409 in HandleEvents () at events.c:250
#9  0x8068947 in main (argc=1, argv=0xbffffc24) at fvwm.c:711

--
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: Tue, 28 Mar 2000 09:40:14 -0500

> Style * HilightBack DarkBlue

I  can't reproduce  the dump, but  the Purify  run  with the same file
shows:

   Finished  fvwm2                (   3 errors,    0 leaked bytes)
      Purify instrumented /opt/public/src/fvwm/2.3.16/fvwm2 (pid 17126 at Tue Mar 28 09:16:15 2000)
      FUM: Freeing unallocated memory
      This is occurring while in:
            free           [rtlib.o]
            free_style_mask [style.c:490]
                 if (mask->has_color_fore)
                   SAFEFREE(SGET_FORE_COLOR_NAME(*style));
                 if (mask->has_color_back_hi)
            =>     SAFEFREE(SGET_BACK_COLOR_NAME_HI(*style));
                 if (mask->has_color_fore_hi)
                   SAFEFREE(SGET_FORE_COLOR_NAME_HI(*style));
                 if (mask->has_decor)
            simplify_style_list [style.c:566]
            HandleEvents   [events.c:246]
            main           [fvwm.c:711]
            _start         [crt1.o]
      Attempting to free block at 0x178c18 already freed.
      This block was allocated from:
            malloc         [rtlib.o]
            strdup         [libc.so.1]
            DoGetNextToken [Parse.c:328]
            GetNextToken   [Parse.c:335]
            ProcessNewStyle [style.c:1340]
            ExecuteFunction [functions.c:859]
            SetRCDefaults  [fvwm.c:965]
            main           [fvwm.c:619]
            _start         [crt1.o]
      There have been 1 frees since this block was freed from:
            free           [rtlib.o]
            free_style_mask [style.c:490]
            simplify_style_list [style.c:566]
            HandleEvents   [events.c:246]
            main           [fvwm.c:711]
            _start         [crt1.o]
      UMR: Uninitialized memory read (2 times)
      Current file descriptors in use: 5
      Memory leaked: 0 bytes (0%); potentially leaked: 0 bytes (0%)
      Program exited with status code 0.

--
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: Wed, 29 Mar 2000 13:31:29 +0200

>             =>     SAFEFREE(SGET_BACK_COLOR_NAME_HI(*style));

I think I've got this one.  Can you both please try with again with
my next commit?

Dan, I suspect that a line like

  Style * HilightBack red, HilightBack green

will leak memory.  Can you check this with purify?

Bye

Dominik ^_^

-- 
Dominik Vogt, Agilent Technologies, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/464-4596, fax: 07031/464-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: Wed, 29 Mar 2000 09:16:10 -0500

> I think I've got this one.  Can you both please try with again with

You seem to have committed bugacide.

(The FUM bug is gone.)

> will leak memory.  Can you check this with purify?

Just issuing the command didn't cause Purify to report a leak, but
it did report a leak during shutdown that wasn't there before:

      Memory leaked: 8 bytes (0.0238%); potentially leaked: 0 bytes (0%)
         MLK: 8 bytes leaked in 2 blocks
         This memory was allocated from:
               malloc         [rtlib.o]
               strdup         [libc.so.1]
               DoGetNextToken [Parse.c:328]
                    if (tmptok == NULL)
                      *token = NULL;
                    else
               =>     *token = strdup(tmptok);
                  
                    return end;
                  }
               GetNextToken   [Parse.c:335]
               ProcessNewStyle [style.c:1348]
               ExecuteFunction [functions.c:859]
               HandleModuleInput [module_interface.c:618]
               My_XNextEvent  [events.c:2309]
               HandleEvents   [events.c:248]
               main           [fvwm.c:711]
               _start         [crt1.o]
         Block of 4 bytes (2 times); last block at 0x1879a8
         Purify Heap Analysis (combining suppressed and unsuppressed blocks)

I get more leaks at shutdown with my regular config file, but the total is
176 bytes.

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 29 Mar 2000 17:46:48 +0200

>                =>     *token = strdup(tmptok);

Just what I suspected.  I don't think it's really a problem, but
I'll see if this can be fixed with minimal effort.  All styles
that allocate memory probably have this problem.

Bye

Dominik ^_^

---

From: Olivier Chapuis <[email-masked]>
Date: Thu, 30 Mar 2000 22:31:04 +0200

> I think I've got this one.  Can you both please try with again with

Yes, it is fixed.
Olivier