You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following piece of code contains an error but Symbiotic does not see it:
#include<assert.h>#include<stdlib.h>intmain(void)
{
void*a=malloc(sizeof(int));
void*b=malloc(sizeof(int));
if (a!=NULL&&b!=NULL)
assert(a!=b);
free(b);
void*c=malloc(sizeof(int));
if (a!=NULL&&c!=NULL)
assert(a!=c);
assert(b!=c); /* can fail */
}
Output:
$ symbiotic symbiotic-mallocs.c8.0.0-pre-llvm-12.0.1-symbiotic:13ca9347-dg:0b1ada38-sbt-slicer:b0864a5b-sbt-instrumentation:648fabcc-klee:6ecf91e2INFO: Looking for reachability of calls to __assert_fail,__VERIFIER_errorINFO: Optimizations time: 0.01961374282836914INFO: Starting slicingINFO: Total slicing time: 0.02277660369873047INFO: Optimizations time: 0.020235300064086914INFO: After-slicing optimizations and transformations time: 2.1457672119140625e-05INFO: Starting verificationKLEE: WARNING: undefined reference to function: klee_make_nondetKLEE: WARNING ONCE: Alignment of memory from call "malloc" is not modelled. Using alignment of 8.No error found.NOTE: In the future, the result is going to be reported in SV-COMP format only with --report=sv-comp switchRESULT: trueINFO: Total time elapsed: 0.3934328556060791
My machine:
$ cc symbiotic-mallocs.c && ./a.outa.out: symbiotic-mallocs.c:17: main: Assertion `b != c' failed.
The text was updated successfully, but these errors were encountered:
Note that this example is very similar to issue #89.
lzaoral
changed the title
Consecutive malloc allocations are not modeled correctly
Consecutive malloc allocations are not modelled correctly
Oct 26, 2021
The following piece of code contains an error but Symbiotic does not see it:
Output:
My machine:
The text was updated successfully, but these errors were encountered: