Development/malloc check

From KDE TechBase
Revision as of 22:02, 15 July 2009 by Afiestas (talk | contribs) (Page to explain what is MALLOC_CHECK_ his usage in KDE, and how affect to our applications.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


MALLOC_CHECK_

The MALLOC_CHECK_ environment variable is used in malloc(3), to decide which implementation use. It could have 4 different values:

  • MALLOC_CHECK_ is not set: When MALLOC_CHECK_ has not been set, then malloc(3) have the usual behavior, nothing special happens.
  • MALLOC_CHECK_ = 0: All errors are silently ignored.
  • MALLOC_CHECK_ = 1: On error, a diagnostic message is printed on stderr.
  • MALLOC_CHECK_ = 2: On error, abort(3) is called without a diagnostic message.
  • MALLOC_CHECK_ = 3: abort(3) is called, and a diagnostic message is printed.


startkde script set this variable to 2 in trunk, so maybe you'll have crashes because of that.

Notice that, the faster implementation is which is used when MALLOC_CHECK_ is not defined.

More information in malloc(3).

Example of crash because of this variable.