Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The callgraph.dot file doesn't containt the target function. #27

Closed
lvtao-sec opened this issue Jul 19, 2018 · 3 comments
Closed

The callgraph.dot file doesn't containt the target function. #27

lvtao-sec opened this issue Jul 19, 2018 · 3 comments

Comments

@lvtao-sec
Copy link

Hi, I'm using aflgo, but there is always a confusing problem that the callgraph.dot generated by genDistance.sh doesn't contain all the functions. Which callgraph.*.dot file should be used when I run scripts genDistance.sh in this situation.

@thuanpv
Copy link
Collaborator

thuanpv commented Jul 19, 2018

Hi. Can you please elaborate the issue a bit more and share with me the following information 1) what subject program you are working on and its version, 2) OS version and LLVM version. I also need all the commands to reproduce the issue before providing any suggestion.

@lvtao-sec
Copy link
Author

lvtao-sec commented Jul 24, 2018

project: imagemagick 7.0.3-8
system version: Ubuntu 16.04
llvm version : LLVM 7.0

commands:

export CC=/home/lt/aflgo/afl-clang-fast
export CXX=/home/lt/aflgo/afl-clang-fast++
export SUBJECT=/home/lt/imagemagick/ImageMagick

export TMP_DIR=$SUBJECT/temp
mkdir TMP_DIR
echo "attribute.c:641" > TMP_DIR/BBtargets.txt
export AFLGO=/home/lt/aflgo
export COPY_CFLAGS=$CFLAGS
export COPY_CXXFLAGS=$CXXFLAGS
export ADDITIONAL="-targets=$TMP_DIR/BBtargets.txt -outdir=$TMP_DIR -flto -fuse-ld=gold -Wl,-plugin-opt=save-temps"
export CFLAGS="$CFLAGS $ADDITIONAL"
export CXXFLAGS="$CXXFLAGS $ADDITIONAL"
./configure --prefix=/home/lt/imagemagick/ImageMagick/install
make
make install

cat $TMP_DIR/BBnames.txt | rev | cut -d: -f2- | rev | sort | uniq > $TMP_DIR/BBnames2.txt && mv $TMP_DIR/BBnames2.txt $TMP_DIR/BBnames.txt
cat $TMP_DIR/BBcalls.txt | sort | uniq > $TMP_DIR/BBcalls2.txt && mv $TMP_DIR/BBcalls2.txt $TMP_DIR/BBcalls.txt
$AFLGO/scripts/genDistance.sh $SUBJECT $TMP_DIR identify

when I execute the command "$AFLGO/scripts/genDistance.sh $SUBJECT $TMP_DIR identify", there is no distance.callgraph.txt.
The content of the callgraph.dot file is as follows:

digraph "Call graph" {
label="Call graph";

Node0x2a0e850 [shape=record,label="{external node}"];
Node0x2a0e850 -> Node0x2a0e8f0;
Node0x2a0e8f0 [shape=record,label="{main}"];

}

So, how could I solve this problem?
Thank you for your helping!

@thuanpv
Copy link
Collaborator

thuanpv commented Jul 27, 2018

Please try with LLVM-4.0 or LLVM-3.8. There is some LLVM version specific issues and we will try to fix them asap. It could be some issue of LLVM itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants