Giter Site home page Giter Site logo

spindle's People

Contributors

humuyan avatar whjthu avatar yeenyeong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spindle's Issues

分析程序时报错

用Spindle分析以下程序:

#include <stdio.h>

int main() {
    int n,a[20];
    scanf("%d",&n);
    a[0]=0;
    for(int i=1;i<=n;i++)a[i]=a[i-1]+2;
    for(int i=1;i<=n;i++)printf("%d ",a[i]);
}

用自带的build_example.sh运行得到如下结果:

Computable memory accesses in loops: 5/5
Static trace has been dumped into strace.log.
PHI nodes not grouped at top of basic block!
  %56 = phi i64 [ 1, %6 ], [ %15, %52 ]
label %54
LLVM ERROR: Broken module found, compilation aborted!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: opt -load-pass-plugin=cmake-build-ubuntu/SpindlePass/SpindlePass.so -passes=stracer -o cmake-build-ubuntu/examples/test_loop_out_of_bound_opt.bc cmake-build-ubuntu/examples/test_loop_out_of_bound.bc
 #0 0x000055d7f3754ea5 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x000055d7f37525f4 SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f6f53d79520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007f6f53dcda7c __pthread_kill_implementation ./nptl/./nptl/pthread_kill.c:44:76
 #4 0x00007f6f53dcda7c __pthread_kill_internal ./nptl/./nptl/pthread_kill.c:78:10
 #5 0x00007f6f53dcda7c pthread_kill ./nptl/./nptl/pthread_kill.c:89:10
 #6 0x00007f6f53d79476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #7 0x00007f6f53d5f7f3 abort ./stdlib/./stdlib/abort.c:81:7
 #8 0x000055d7f0ee15c1 llvm::DisplayGraph(llvm::StringRef, bool, llvm::GraphProgram::Name) (.cold) GraphWriter.cpp:0:0
 #9 0x000055d7f369707e (~/llvm-project/build/bin/opt+0x30b207e)
#10 0x000055d7f2f11d1e (~/llvm-project/build/bin/opt+0x292cd1e)
#11 0x000055d7f0fb1e16 llvm::detail::PassModel<llvm::Module, llvm::VerifierPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (~/llvm-project/build/bin/opt+0x9cce16)
#12 0x000055d7f2ed4615 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (~/llvm-project/build/bin/opt+0x28ef615)
#13 0x000055d7f0fbd54b llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::StringRef>, llvm::ArrayRef<llvm::PassPlugin>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool) (~/llvm-project/build/bin/opt+0x9d854b)
#14 0x000055d7f0ef697d main (~/llvm-project/build/bin/opt+0x91197d)
#15 0x00007f6f53d60d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#16 0x00007f6f53d60e40 call_init ./csu/../csu/libc-start.c:128:20
#17 0x00007f6f53d60e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#18 0x000055d7f0fb0255 _start (~/llvm-project/build/bin/opt+0x9cb255)
./build_example.sh: line 12:   509 Aborted                 opt -load-pass-plugin="${cmake_folder}/SpindlePass/SpindlePass.so" -passes="${2}" -o "${example_opt_bc}" "${example_bc}"

测试结果不对

运行项目里面给的简单例子或者自己修改一下简单代码,跑完程序后会输出如下相关信息:
Total objects:
Uninitialized use:
Use after free:
Memory leak:
full:
loop:
Alloc:
Free:
但是感觉跑出来的剖视信息不对?能否检查一下呢?

test wrong: undefined symbol

Hi, I ran the test code and got error as following:

clang -Xclang -load -Xclang ../Spindle/Spindle/libSpindlePass.so -O2 -c testloop.c -o testloop.o
error: unable to load plugin '../Spindle/Spindle/libSpindlePass.so': '../Spindle/Spindle/libSpindlePass.so: undefined symbol:
_ZN4llvm23EnableABIBreakingChecksE

what's your version of clang? clang-6.0?

Segmentation fault

I ran clang-6.0 in ubuntu 18.04. I am getting segmentation fault when I run this command. Could someone please help me?
Command:
clang-6.0 -Xclang -load -Xclang ../Spindle/Spindle/libSpindlePass.so -O2 -c test_loop_out_of_bound.c -o testloop.o
Output:
Begin: test_loop_out_of_bound.c
Function 0: main
Function 1: llvm.lifetime.start.p0i8
Function 2: sprintf
Function 3: llvm.lifetime.end.p0i8
Base: %1 = alloca [1000 x i32], align 16
inst: %9 = load i32, i32* %8, align 4, !tbaa !2
%1 = alloca [1000 x i32], align 16base
load inst ptr: %8 = getelementptr inbounds [1000 x i32], [1000 x i32]* %1, i64 0, i64 %7
Instrumenting for main
Writing static trace
End
clang-6.0: error: unable to execute command: Segmentation fault (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 6.0.0 (tags/RELEASE_600/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/tjtron/Downloads/Spindle-master/test/../../clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang-6.0: error: unable to execute command: Segmentation fault (core dumped)
clang-6.0: note: diagnostic msg: Error generating preprocessed source(s).

unable to compile using clang

Hi,

I'm trying to compile the source code based on the instructions given in the README. At the last step, you've mentioned to compile using: clang -Xclang -load -Xclang mypass.so main.c . This gives me the following error: clang: error: no such file or directory: 'main.c'

I'm not sure what main.c here refers to as there is no file with that name. Could you please help me in resolving this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.