Giter VIP home page Giter VIP logo

clsmith's People

Contributors

0152la avatar afd avatar chriscummins avatar chrislidbury avatar mpflanzer avatar nafe avatar

Stargazers

 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  avatar

clsmith's Issues

options triggering CLSmith segfaults

Hi all,

CLSmith segfaults when it is given some particular options.

The attached file lists 5 examples of options leading to segfault for
CLSmith (git revision 4991357d78847ec) compiled with gcc version
5.3.1 20160406 (Red Hat 5.3.1-6) executed on amd64 Linux (Fedora 22)
options_triggering_segfault.txt

Misuse of address spaces

CLsmith sometimes generates programs that lead to these sorts of compilation errors:

input.cl:1254:37: error: comparison between ('uint *' (aka 'unsigned
int *') and '__constant uint *' (aka '__constant unsigned int *')) which
are pointers to non-overlapping address spaces

The attached example illustrates this.

example.txt

How long did extending CSmith take?

I'm writing up a project on OpenCL testing, and am wondering if you could provide for me an estimate of the amount of development time it took to extend CSmith for OpenCL. Looking through the version history it looks like the bulk of the work was completed in Jan-Oct 2014, but I figured it's worth asking the authors directly :)

CLsmith generates empty declarations

The tool sometimes generates declarations with no variables in them, such as:

int ;

Not clear whether this is legal OpenCL, but some compilers (e.g. Intel's) reject it, and it doesn't seem like an interesting thing to do, so we should remove this behaviour.

Free'ing of static memory

Depending on the input given to cl_launcher, it might lead to free'ing the pointers to global_dims and local_dims while pointing to the empty string "" allocated in the static data section of the application, which in turn causes the application to terminate.

The offending code is in lines 325 and 326 in the cl_launcher file.

Undefined symbols

Hi Christopher, Andrei, Nathan, and Alastair,

I'm very much interested in using clsmith, but am unable to build it. Compilation fails at the final link stage with undefined symbols:

Making all in src
/bin/sh ../libtool --tag=CXX   --mode=link g++  -g -O3 -Wall -Wextra -Wno-long-long   -o csmith csmith-AbsExtension.o csmith-AbsProgramGenerator.o csmith-AbsRndNumGenerator.o csmith-ArrayVariable.o csmith-Block.o csmith-Bookkeeper.o csmith-CFGEdge.o csmith-CGContext.o csmith-CGOptions.o csmith-CVQualifiers.o csmith-CompatibleChecker.o csmith-Constant.o csmith-CoverageTestExtension.o csmith-CrestExtension.o csmith-DFSOutputMgr.o csmith-DFSProgramGenerator.o csmith-DFSRndNumGenerator.o csmith-DefaultOutputMgr.o csmith-DefaultProgramGenerator.o csmith-DefaultRndNumGenerator.o csmith-DeltaMonitor.o csmith-DepthSpec.o csmith-Effect.o csmith-Error.o csmith-Expression.o csmith-ExpressionAssign.o csmith-ExpressionComma.o csmith-ExpressionFuncall.o csmith-ExpressionVariable.o csmith-ExtensionMgr.o csmith-ExtensionValue.o csmith-Fact.o csmith-FactMgr.o csmith-FactPointTo.o csmith-FactUnion.o csmith-Filter.o csmith-Finalization.o csmith-Function.o csmith-FunctionInvocation.o csmith-FunctionInvocationBinary.o csmith-FunctionInvocationUnary.o csmith-FunctionInvocationUser.o csmith-KleeExtension.o csmith-Lhs.o csmith-LinearSequence.o csmith-MspFilters.o csmith-OutputMgr.o csmith-PartialExpander.o csmith-Probabilities.o csmith-RandomNumber.o csmith-RandomProgramGenerator.o csmith-Reducer.o csmith-ReducerOutputMgr.o csmith-SafeOpFlags.o csmith-Sequence.o csmith-SequenceFactory.o csmith-SimpleDeltaRndNumGenerator.o csmith-SimpleDeltaSequence.o csmith-SplatExtension.o csmith-Statement.o csmith-StatementArrayOp.o csmith-StatementAssign.o csmith-StatementBreak.o csmith-StatementContinue.o csmith-StatementExpr.o csmith-StatementFor.o csmith-StatementGoto.o csmith-StatementIf.o csmith-StatementReturn.o csmith-StringUtils.o csmith-Type.o csmith-Variable.o csmith-VariableSelector.o csmith-VectorFilter.o csmith-platform.o csmith-random.o csmith-util.o
libtool: link: g++ -g -O3 -Wall -Wextra -Wno-long-long -o csmith csmith-AbsExtension.o csmith-AbsProgramGenerator.o csmith-AbsRndNumGenerator.o csmith-ArrayVariable.o csmith-Block.o csmith-Bookkeeper.o csmith-CFGEdge.o csmith-CGContext.o csmith-CGOptions.o csmith-CVQualifiers.o csmith-CompatibleChecker.o csmith-Constant.o csmith-CoverageTestExtension.o csmith-CrestExtension.o csmith-DFSOutputMgr.o csmith-DFSProgramGenerator.o csmith-DFSRndNumGenerator.o csmith-DefaultOutputMgr.o csmith-DefaultProgramGenerator.o csmith-DefaultRndNumGenerator.o csmith-DeltaMonitor.o csmith-DepthSpec.o csmith-Effect.o csmith-Error.o csmith-Expression.o csmith-ExpressionAssign.o csmith-ExpressionComma.o csmith-ExpressionFuncall.o csmith-ExpressionVariable.o csmith-ExtensionMgr.o csmith-ExtensionValue.o csmith-Fact.o csmith-FactMgr.o csmith-FactPointTo.o csmith-FactUnion.o csmith-Filter.o csmith-Finalization.o csmith-Function.o csmith-FunctionInvocation.o csmith-FunctionInvocationBinary.o csmith-FunctionInvocationUnary.o csmith-FunctionInvocationUser.o csmith-KleeExtension.o csmith-Lhs.o csmith-LinearSequence.o csmith-MspFilters.o csmith-OutputMgr.o csmith-PartialExpander.o csmith-Probabilities.o csmith-RandomNumber.o csmith-RandomProgramGenerator.o csmith-Reducer.o csmith-ReducerOutputMgr.o csmith-SafeOpFlags.o csmith-Sequence.o csmith-SequenceFactory.o csmith-SimpleDeltaRndNumGenerator.o csmith-SimpleDeltaSequence.o csmith-SplatExtension.o csmith-Statement.o csmith-StatementArrayOp.o csmith-StatementAssign.o csmith-StatementBreak.o csmith-StatementContinue.o csmith-StatementExpr.o csmith-StatementFor.o csmith-StatementGoto.o csmith-StatementIf.o csmith-StatementReturn.o csmith-StringUtils.o csmith-Type.o csmith-Variable.o csmith-VariableSelector.o csmith-VectorFilter.o csmith-platform.o csmith-random.o csmith-util.o -Wl,-bind_at_load
Undefined symbols for architecture x86_64:
  "CLSmith::make_random(CGContext&, Type const*, CVQualifiers const*)", referenced from:
      Expression::make_random(CGContext&, Type const*, CVQualifiers const*, bool, bool, eTermType) in csmith-Expression.o
  "CLSmith::make_random_st(CGContext&)", referenced from:
      Statement::make_random(CGContext&, eStatementType) in csmith-Statement.o
  "CLSmith::ExpressionAtomic::DelBlockVars()", referenced from:
      StatementIf::make_random(CGContext&) in csmith-StatementIf.o
  "CLSmith::ExpressionAtomic::GenBlockVars(Block*)", referenced from:
      Block::make_random(CGContext&, bool) in csmith-Block.o
  "CLSmith::ExpressionAtomic::GetBlockVars(Block*)", referenced from:
      Lhs::make_random(CGContext&, Type const*, CVQualifiers const*, bool, bool) in csmith-Lhs.o
  "CLSmith::ExpressionAtomic::make_condition(CGContext&, Type const*)", referenced from:
      StatementIf::make_random(CGContext&) in csmith-StatementIf.o
  "CLSmith::ExpressionVector::make_constant(Type const*, int)", referenced from:
      FunctionInvocation::make_random_binary(CGContext&, Type const*) in csmith-FunctionInvocation.o
  "CLSmith::itemize_simd_hook(ArrayVariable const*, int)", referenced from:
      VariableSelector::create_array_and_itemize(Block*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, CGContext const&, Type const*, Expression const*, CVQualifiers const*) in csmith-VariableSelector.o
  "CLSmith::StatementAtomicResult::RecordIfID(int, Expression*)", referenced from:
      StatementIf::make_random(CGContext&) in csmith-StatementIf.o
  "CLSmith::Vector::OutputVectorType(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, Type const*, int)", referenced from:
      Type::Output(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in csmith-Type.o
  "CLSmith::Vector::CreateVectorVariable(CGContext const&, Block*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Type const*, Expression const*, CVQualifiers const*, Variable const*)", referenced from:
      VariableSelector::create_array_and_itemize(Block*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, CGContext const&, Type const*, Expression const*, CVQualifiers const*) in csmith-VariableSelector.o
      VariableSelector::create_random_array(CGContext const&) in csmith-VariableSelector.o
  "CLSmith::Vector::DemoteVectorTypeToType(Type const*)", referenced from:
      VariableSelector::create_and_initialize(Effect::Access, CGContext const&, Type const*, CVQualifiers const*, Block*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in csmith-VariableSelector.o
      VariableSelector::create_array_and_itemize(Block*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, CGContext const&, Type const*, Expression const*, CVQualifiers const*) in csmith-VariableSelector.o
  "CLSmith::Vector::PromoteTypeToVectorType(Type const*, int)", referenced from:
      FunctionInvocationBinary::get_type() const in csmith-FunctionInvocationBinary.o
      FunctionInvocationUnary::get_type() const in csmith-FunctionInvocationUnary.o
  "CLSmith::CLOptions::atomics()", referenced from:
      StatementIf::make_random(CGContext&) in csmith-StatementIf.o
  "CLSmith::CLOptions::vectors()", referenced from:
      VariableSelector::create_array_and_itemize(Block*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, CGContext const&, Type const*, Expression const*, CVQualifiers const*) in csmith-VariableSelector.o
      VariableSelector::create_random_array(CGContext const&) in csmith-VariableSelector.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [csmith] Error 1

I am using OS X 10.11.3.

$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

How to use this program?

Hi all, I successfully built this project on Ubuntu following the instructions in README.

But I wonder how to use the CLSmith and cl_launcher binary?

Thank you very much!

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.