Subject: FvwmCommandS dumps core

From: Dominik Vogt <[email-masked]>
Date: Thu, 25 Nov 1999 12:23:22 +0100

Did anybody notice that FvwmCommandS often produces a core dump
when the X server is shut down?  The core dump occurs in
function close_fifos() in the command

  free (F_name);

Since the memory is definitely valid at the time I can only
guess that the memory corruption happens earlier.  Could
someone 'purify' FvwmCommandS and see if it detects a problem,
please?

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: Brad Giaccio <[email-masked]>
Date: Mon, 29 Nov 1999 15:11:01 -0500

Well I tried real hard on my Sun box to reproduce this, with purify, to
no avail, and I don't think I've ever seen this bug myself.  Although
that does sound like a memory problem, if you are sure F_name should
be valid, one thing that you could check is to see if close_fifos is
getting called twice.

And I did just check and rational still hasn't ported purify to linux.
So it sounds like unless someone else with purify who can produce the
problem needs to step up. (ports to SGI, HP, and Solaris and you can get
a free trial granted not the most above board way to go about it).

Brad

-- 
--- There are two kinds of knowledge, you either know the answer or
			you know where to find it
		      -Kane, Johnson, and anonymous
--
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: [email-masked] (Paul D. Smith)
Date: 29 Nov 1999 18:24:27 -0500

%% Brad Giaccio <[email-masked]> writes:

  bg> And I did just check and rational still hasn't ported purify to
  bg> linux.  So it sounds like unless someone else with purify who can
  bg> produce the problem needs to step up. (ports to SGI, HP, and
  bg> Solaris and you can get a free trial granted not the most above
  bg> board way to go about it).

There are a number of heap checking libraries out there besides Purify,
and most are even free :).

Probably the best known one is dmalloc but there are others.  I
outfitted GNU make to configure with dmalloc if requested for the last
release; I can do the same for FVWM.

Purify is nice in that it doesn't require a rebuild of the source; it's
a link-time tool so you just relink.  Also, it instruments the object
code so you can often get the exact point where memory is written or
read beyond the boundarys.

But, dmalloc and co. can also find a very large class of heap problems
and with a little extra debugging it's usually quite sufficient.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.
--
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: Tue, 30 Nov 1999 08:51:58 +0100

> and with a little extra debugging it's usually quite sufficient.

How do I set up dmalloc?

Bye

Dominik ^_^

---

From: [email-masked] (Paul D. Smith)
Date: 30 Nov 1999 14:46:46 -0500

%% Dominik Vogt <[email-masked]> writes:

  >> But, dmalloc and co. can also find a very large class of heap
  >> problems and with a little extra debugging it's usually quite
  >> sufficient.

  dv> How do I set up dmalloc?

I've modified configure.in so you can add "--enable-dmalloc" to the
configure command line to enable it.  It just looks in the standard
places for dmalloc.h and libdmalloc.a for now--maybe we should enhance
that.

You can get more info including the manual online if you don't have or
don't like the texinfo version that comes with dmalloc at its homesite:

  http://www.dmalloc.com/

In general you build your program linking with the dmalloc library and
(to get the best results) #including the dmalloc.h header file.  Then
before you run the program you set various environment variables to
control how it works: levels of checking, where the logfile goes, etc.
There's a special command to help with that.

Then run the program, and examine the log file.  Also, you can do things
like set a breakpoint at dmalloc_error() which is called every time an
error is seen, etc.

I also had it enable DMALLOC_FUNC_CHECK (see the manual) which replaces
many "standard" functions that might read or write to the heap
incorrectly (strcpy, strcat, memcpy, etc.) with versions that implement
dmalloc checks; that can sometimes allow dmalloc to find the problem
much closer to where it occurred.

I built with dmalloc enabled as a test, but I didn't run FVWM that way,
so hopefully it works :).

HTH.