Comments (4)
KLEE's libc may also be a good starting point for 1 and/or 3: https://github.com/klee/klee/tree/master/runtime/klee-libc
from symcc.
@vanhauser-thc this is most likely because our symbolic understanding of libc is incomplete. So when you call strncmp
, SymCC can't trace the computations that happen in the function. There are several ways to address the issue:
- We can add
strncmp
andstrcmp
to the collection of wrapped libc functions and register the wrapper in the compiler. This is quick and easy, but it doesn't scale if your target uses many libc functions on symbolic data. - Alternatively, one can build a fully instrumented libc (like, for example, KLEE does with uclibc). I refrained from doing this so far because it seems like a big burden on the user to set up their own instrumented libc; maybe we could automate the process to make it less tedious.
- Something I've done in the past is to cherry-pick individual libc functions from a libc implementation (I used musl) and include them in the target program. For example, the implementation of
strncmp
is self-contained, so you can just add it to your build (e.g.,symcc -o test test.c /path/to/musl/src/string/strncmp.c
).
Suggestions how to make such situations easier to deal with are highly welcome :)
from symcc.
I think string compare functions make sense to add (so solution 1) as these are a limited number of common functions. 2 sounds like too much overhead and 3) should only be needed to be done for very specific cases (e.g. a third party library that is binary only),
from symcc.
Has anyone already tried 2)? If all it takes to get full support of libc functions is to compile uclibc with SymCC from scratch then I don't mind the extra work. Are there any additional steps required to set up the instrumented libc that I'm missing?
from symcc.
Related Issues (20)
- Failed to Compile with "-DTARGET_32BIT=ON" HOT 1
- Wrong handling of i1 in visitCastInst HOT 2
- visitSelectInst does not propagate the symbolic expression HOT 2
- Store i1 into memory HOT 2
- Change the license of the runtime to LGPL HOT 6
- Support for variadic functions HOT 1
- Failed to build the Vagrantfile
- LLVM compatibility policy HOT 6
- Can't create expressions for concrete non-undef structs HOT 2
- _sym_get_input_byte() in simple backend
- sprintf wrapper
- Crash when concrete non-undef structs contain floats
- afl-showmap generating incorrectly sized map HOT 1
- SymCC may crash if test-case handlers are instrumented
- cannot generate new testcase for a simple case
- program links to libstdc++, not instructmented libc++
- Could not compile libcxx: malloc/malloc.h not found HOT 7
- Fail to compile gpac with clang frontend error HOT 1
- Fuzzing with AFL and Symcc does not work HOT 2
- SymCC fails to compile with -DTARGET_32BIT=ON HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from symcc.