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] Value Analysis: signed_overflow in addition to division_by_zero warning
- Subject: [Frama-c-discuss] Value Analysis: signed_overflow in addition to division_by_zero warning
- From: pascal.cuoq at gmail.com (Pascal Cuoq)
- Date: Mon, 27 Jan 2014 15:36:15 +0100
- In-reply-to: <C3B1C998-3A55-430F-9391-5E38035CECC2@tu-harburg.de>
- References: <C3B1C998-3A55-430F-9391-5E38035CECC2@tu-harburg.de>
On Mon, Jan 27, 2014 at 2:41 PM, Marcel Gehrke <marcel.gehrke at tu-harburg.de>wrote: > /*@ assert Value: division_by_zero: x ? 0; */ > h = 1 / x; > if (x != 0) > /*@ assert Value: division_by_zero: x ? 0; */ > h = 1 / x; > else > /*@ assert Value: division_by_zero: x ? 0; */ > /*@ assert Value: signed_overflow: 1/x ? 2147483647; */ > /*@ assert Value: signed_overflow: -2147483648 ? 1/x; */ ... > Actually, on the program you provided and with the command below, I get the result visible after the fold. There are way to many alarms in there. We will need to investigate. Thanks for the report. The previous Oxygen version did not duplicate the ?division by zero? assertions but did generate the useless ?signed overflow? assertions. Pascal ___________ ~/frama-c-Fluorine-20130601 $ bin/toplevel.byte -val -main f1 ../t.c -print [kernel] warning: cannot load 5 plug-ins (incompatible with Fluorine-20130601). Aorai; Obfuscator; Report; Security_slicing; Wp [kernel] preprocessing with "gcc -C -E -I. ../t.c" [value] Analyzing a complete application starting at f1 [value] Computing initial state [value] Initial state computed [value] Values of globals at initialization ../t.c:5:[value] Assertion got status unknown. ../t.c:6:[kernel] warning: division by zero: assert x ? 0; ../t.c:6:[value] assigning non deterministic value for the first time ../t.c:8:[value] Assertion got status unknown. ../t.c:11:[value] Assertion got status invalid (stopping propagation). ../t.c:9:[kernel] warning: division by zero: assert x ? 0; [value] Recording results for f1 [value] done for function f1 [value] ====== VALUES COMPUTED ====== [value] Values at end of function f1: h ? {-1; 0; 1} /* Generated by Frama-C */ void f1(int x) { int h; /*@ assert Value: division_by_zero: x ? 0; */ ; /*@ assert Value: division_by_zero: x ? 0; */ h = 1 / x; if (x != 0) { /*@ assert Value: division_by_zero: x ? 0; */ ; /*@ assert Value: division_by_zero: x ? 0; */ h = 1 / x; } else { /*@ assert Value: division_by_zero: x ? 0; */ ; /*@ assert Value: signed_overflow: 1/x ? 2147483647; */ ; /*@ assert Value: signed_overflow: -2147483648 ? 1/x; */ ; h = 1 / x; } return; } -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20140127/c27e1fea/attachment-0001.html>
- Follow-Ups:
- [Frama-c-discuss] Array size in Frama-C
- From: phunghuuphu at gmail.com (Phu H. Phung)
- [Frama-c-discuss] Array size in Frama-C
- References:
- [Frama-c-discuss] Value Analysis: signed_overflow in addition to division_by_zero warning
- From: marcel.gehrke at tu-harburg.de (Marcel Gehrke)
- [Frama-c-discuss] Value Analysis: signed_overflow in addition to division_by_zero warning
- Prev by Date: [Frama-c-discuss] Frama-C: Detecting unreachable code? (Dharmalingam Ganesan)
- Next by Date: [Frama-c-discuss] Array size in Frama-C
- Previous by thread: [Frama-c-discuss] Value Analysis: signed_overflow in addition to division_by_zero warning
- Next by thread: [Frama-c-discuss] Array size in Frama-C
- Index(es):