Comments (3)
I tried running this example again, and it produces a different error. It no longer always returns the first element of the array. However, the symbolic function pointer cannot be called with an argument.
The updated saw-script:
bc <- llvm_load_module "issue10.bc";
crucible_llvm_verify bc "mytestfunction" [] false
do {
i <- crucible_fresh_var "i" (llvm_int 32);
j <- crucible_fresh_var "j" (llvm_int 32);
crucible_precond {{ i < 2 }};
crucible_execute_func [crucible_term i, crucible_term j];
crucible_return (crucible_term {{ j + 1 }});
}
z3;
It produces the following error:
Symbolic execution failed.
LoadHandle: not a valid function pointer
in mytestfunction at issue10.c:8:12
Stack frame
Allocations:
StackAlloc 9 0x10:[64] "issue10.c:7:19"
StackAlloc 8 0x4:[64] "issue10.c:6:31"
StackAlloc 7 0x4:[64] "issue10.c:6:24"
Writes:
memcopy (9, 0x0:[64]) (6, 0x0:[64]) 0x10:[64]
*(8, 0x0:[64]) := c@3:bv
*(7, 0x0:[64]) := c@2:bv
Base memory
Allocations:
GlobalAlloc 6 0x10:[64] mytestfunction.funs
GlobalAlloc 5 0x0:[64] succ
GlobalAlloc 4 0x0:[64] pred
GlobalAlloc 3 0x0:[64] mytestfunction
GlobalAlloc 2 0x0:[64] llvm.memcpy.p0i8.p0i8.i64
GlobalAlloc 1 0x0:[64] llvm.dbg.declare
Writes:
*(6, 0x0:[64]) := [(5, 0x0:[64])
,(4, 0x0:[64])]
from crucible.
I took a quick look into this. The issue is that function handles are associated to block allocation numbers in a side lookup table. Currently, function handle lookup only succeeds if the pointer value is a concrete pointer. The message is perhaps misleading, but the root cause here is that the pointer ins't concrete, so we aren't sure which function handle to return.
A proper fix for this issue will require being able to merge distinct function handles, and perform the necessary branching at call sites when they are called, etc. I the meantime, I'll alter the error message to be more specific about the cause of the problem (the pointer is symbolic).
from crucible.
Working on this in #615
from crucible.
Related Issues (20)
- `crucible-llvm`: Support string tables with Clang 14.0.0 + optimizations HOT 6
- `crux-mir` nightly Docker build failure (`no space left on device`)
- `crucible-llvm`: Implement `llvm.vector.reduce.*` intrinsics (added in LLVM 12)
- `crucible_mir`: Add overrides for `is_null` HOT 1
- `crucible-mir`: Re-implement overrides for `get_unchecked` slice indexing HOT 1
- `popFrameUnchecked` changes cause regression in SAW AWS-LC proof HOT 2
- You have encountered a bug in uc-crux-llvm's implementation. Mac M1 HOT 2
- crux-mir doesn't handle byte -> char casts HOT 3
- Support the `llvm.experimental.noalias.scope.decl` intrinsic HOT 3
- syntax: Accept more characters in function names
- `crucible-llvm`: Don't crash when simulating `llvm.dbg.assign` intrinsic
- `muxHandle` is wrong
- `Error: cabal: sdist of crucible-cli-0.1: invalid file glob`, Cannot install `crux-mir` HOT 1
- Improve concretization of sequences
- Concretizing LLVM memory HOT 9
- Translation failure on rustc-produced LLVM bitcode HOT 2
- `crucible-llvm` rejects memory load of a struct with padding HOT 1
- `crucible-mir` crashes due to improperly constructing vtable shim types HOT 5
- `crucible-mir`: Split out the `Misc` `CastKind` into more precise constructors
- `crucible-mir` fails to parse MIR JSON that casts array reference to pointer
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 crucible.