Melton Tutorial

Melton is a effective automatic memory leak detector for C programs,
which is developed by Zhenbo Xu, etc. at Institute of Software, Chinese Academy of Sciences,
and is finding bugs in real world applications.

This package contains the front-end Clang (at ./bin/clang), the main executable file melton (at ./bin/melton),
a python script for automatically analyzing Makefile,
and a python script for generating bug summary html page from bug reports.
The front-end Clang is used to generate AST files as melton's inputs.
Melton reads in the AST files, and performs the whole program analysis to detect potential memory leak.

1 Examples

1.1 Single file anlaysis

Suppose that foo.c is the file to be analyzed. The detail usage of melton will be described in section 2.

1.2 Whole project analysis

Enter the project dir that contains Makefile, and the most simple way to start is:


The script will automatically analyze Makefile,
and use Clang to generate AST files from ".c" files.
And then invoke melton to read in AST files to perform while program analysis.
Finially, the bug reports are produced at "./BugReports" dir.
For detail usage of, see section 3.

2 Usage of melton

USAGE: melton [options] <input AST files>

OPTIONS: Other options are the debugging info during our development. Use -h/--help to show other options.

3 Usage of

Usage: [-option <dir/command/filename>]
Note: If the source project has been make(built) before,
please remove the generated object files(For example, execute 'make clean'.)
to assure the normal analysis of