Check-in [9cf62b20d5]
Overview
Comment:Updated leakcheck to require a filename as parameter
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9cf62b20d51974351ef99904f594e45d95a7b4ed
User & Date: rkeene on 2010-05-15 00:56:39
Other Links: manifest | tags
Context
2010-05-17
00:20
Fixed issues with signdecrypt buffer sizes

Centralized reading of identities

Added debugging to determine why wrong applet ID is being stored in identity check-in: eaa9f36a2b user: rkeene tags: trunk

2010-05-15
00:56
Updated leakcheck to require a filename as parameter check-in: 9cf62b20d5 user: rkeene tags: trunk
00:50
Further documentation for the leakcheck tool check-in: a87e5cb815 user: rkeene tags: trunk
Changes

Modified leakcheck/leakcheck from [ebd6df1f69] to [eea3ae5a09].

     1      1   #! /bin/bash
     2      2   
            3  +LEAKCHECKFILE="$1"
     3      4   TMPFILE="${TMPDIR:-/tmp}/malloc-free-check-$$${RANDOM}${RANDOM}${RANDOM}.tmp"
            5  +export LEAKCHECKFILE TMPFILE
            6  +
            7  +if [ -z "${LEAKCHECKFILE}" ]; then
            8  +	echo "Usage: leakcheck <filename>" >&2
            9  +	echo "         filename       Name of file containing debugging output" >&2
           10  +
           11  +	exit 1
           12  +fi
     4     13   
     5         -egrep '(MALLOC|FREE|REALLOC)' "$@" | sed 's@^.*FREE(\(0x[0-9a-f]*\)).*$@free \1@;s@^.*MALLOC() = @malloc @;s@^.*REALLOC(\(0x[0-9a-f]*\)) = @realloc \1 @' > "${TMPFILE}"
           14  +egrep '(MALLOC|FREE|REALLOC)' "${LEAKCHECKFILE}" | sed 's@^.*FREE(\(0x[0-9a-f]*\)).*$@free \1@;s@^.*MALLOC() = @malloc @;s@^.*REALLOC(\(0x[0-9a-f]*\)) = @realloc \1 @' > "${TMPFILE}"
     6     15   
     7     16   cat "${TMPFILE}" | while read op addr newaddr; do
     8     17   	case "${op}" in
     9     18   		malloc)
    10     19   			if [ -z "${alloclist}" ]; then
    11     20   				alloclist="${addr}"
    12     21   			else
................................................................................
    34     43   done | tail -1 | while read leftovers; do
    35     44   	for leftover in ${leftovers}; do
    36     45   		case "${leftover}" in
    37     46   			!*)
    38     47   				leftover="$(echo "${leftover}" | cut -c 2-)"
    39     48   
    40     49   				echo "Double freed or never allocated ${leftover}:"
    41         -				grep "${leftover}" "$@" | sed 's@^@    @'
           50  +				grep "${leftover}" "${LEAKCHECKFILE}" | sed 's@^@    @'
    42     51   				echo ''
    43     52   				;;
    44     53   			*)
    45     54   				echo "Unfreed memory ${leftover}:"
    46         -				grep "${leftover}" "$@" | sed 's@^@    @'
           55  +				grep "${leftover}" "${LEAKCHECKFILE}" | sed 's@^@    @'
    47     56   				echo ''
    48     57   				;;
    49     58   		esac
    50     59   	done
    51     60   done
    52     61   
    53     62   rm -f "${TMPFILE}"