chrislidbury / clsmith Goto Github PK
View Code? Open in Web Editor NEWOpenCL extension for csmith.
License: Other
OpenCL extension for csmith.
License: Other
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
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.
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 :)
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.
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.
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
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.