Frama-C-discuss mailing list archives
This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Frama-c-discuss] trouble debugging assertions
- Subject: [Frama-c-discuss] trouble debugging assertions
- From: dmentre at linux-france.org (David MENTRE)
- Date: Tue, 18 Aug 2015 11:22:13 +0200
- In-reply-to: <CAGSRWbibox8zFG9JD6ywzSDTCOxNjnbssDsqx0qADEOvYaGgxQ@mail.gmail.com>
- References: <CAGSRWbiNW1JwsppB0D3=Cz5G-V95TrpetE5cC4XkMDNLBDyWVA@mail.gmail.com> <55D2D767.4040603@free.fr> <CAGSRWbhVJxPyUYwyLJEKkGLixcK4cj9wk-4N=JqNWXXD4QydPA@mail.gmail.com> <CAGSRWbgQUQ-SUztAQgy1hc_VZjmRpadtq6tModvUx=+MEJ0xOg@mail.gmail.com> <CAGSRWbibox8zFG9JD6ywzSDTCOxNjnbssDsqx0qADEOvYaGgxQ@mail.gmail.com>
Hello Tim, Le 18/08/2015 09:48, Tim Newsham a écrit : > ok = auth(buf,sz,& pay,& paysz); > /*@ assert ok ⡠0 ⨠\initialized(pay+(0 .. paysz-1)); */ ; > if (ok) { > /*@ assert \initialized(pay+(0 .. paysz-1)); */ ; > i = (unsigned int)0; > while (i < paysz) { > /*@ assert Value: initialisation: \initialized(pay+i); */ > printf("%d\n",(int)*(pay + i)); > i ++; > } > } > > here all the assertions are evaluated as valid except > for the one before the printf. This is odd because the > assertion above it says that pay[0..paysz-1] is valid > and the value analysis knows that i is less than paysz > at the printf. So why can't it discover that > \initialized(pay+i) from \initialized(pay+(0..paysz-1)) ? Probably because slevel is too low. Try to increase it (-slevel option) to the value found in paysz. In loops, by default Value analysis is only considering one possible path (you have as many paths as turns in the loop) and thus applies the Widening operator of Abstract Analysis theory which, most of the time, results in (correct but) not precise enough values. I posted some explanation on slevel in June of last year: http://lists.gforge.inria.fr/pipermail/frama-c-discuss/2014-June/004493.html (apparently the mailing list archive mangled the UTF8 characters.) Best regards, david
- Follow-Ups:
- [Frama-c-discuss] trouble debugging assertions
- From: tim.newsham at gmail.com (Tim Newsham)
- [Frama-c-discuss] trouble debugging assertions
- References:
- [Frama-c-discuss] trouble debugging assertions
- From: tim.newsham at gmail.com (Tim Newsham)
- [Frama-c-discuss] trouble debugging assertions
- From: anne.pacalet at free.fr (Anne Pacalet)
- [Frama-c-discuss] trouble debugging assertions
- From: tim.newsham at gmail.com (Tim Newsham)
- [Frama-c-discuss] trouble debugging assertions
- From: tim.newsham at gmail.com (Tim Newsham)
- [Frama-c-discuss] trouble debugging assertions
- From: tim.newsham at gmail.com (Tim Newsham)
- [Frama-c-discuss] trouble debugging assertions
- Prev by Date: [Frama-c-discuss] trouble debugging assertions
- Next by Date: [Frama-c-discuss] trouble debugging assertions
- Previous by thread: [Frama-c-discuss] trouble debugging assertions
- Next by thread: [Frama-c-discuss] trouble debugging assertions
- Index(es):