Frama-C Bug Tracking System - Frama-C
View Issue Details
0002301Frama-CPlug-in > wppublic2017-05-11 14:232017-07-21 11:23
Phosphorus-20170501-beta1xubuntu 16.04.1
0002301: statement contract apparently confuses parser
Running "frama-c -wp assigns.c" on the attached program produces a warning:

assigns.c:12:[wp] warning: Missing assigns clause (assigns 'everything' instead)

The warning is unjustified since the loop in line 12 does have a "loop assigns" clauses, and loops don't use (plain) "assigns" clauses.

If the trivial assertion in line 9 is activated, the warning disappears, and everything is proven.

If instead the braces in line 5 and 7 are removed, Frama-c reports a crash (text see "Additional Information").
Crash message:

[kernel] Parsing FRAMAC_SHARE/libc/__fc_builtin_for_normalization.i (no preprocessing)
[kernel] Parsing assigns.c (with preprocessing)
[wp] failure: Several assigns ?
[kernel] Current source was: assigns.c:2
         The full backtrace is:
         Raised at file "src/kernel_services/plugin_entry_points/", line 568, characters 30-31
         Called from file "src/kernel_services/plugin_entry_points/", line 562, characters 9-16
         Re-raised at file "src/kernel_services/plugin_entry_points/", line 565, characters 15-16
         Called from file "src/plugins/wp/", line 470, characters 13-63
         Called from file "src/plugins/wp/", line 505, characters 8-34
         Called from file "", line 73, characters 12-15
         Called from file "src/plugins/wp/", line 541, characters 2-34
         Called from file "", line 168, characters 20-25
         Called from file "", line 168, characters 10-18
         Called from file "src/plugins/wp/", line 1023, characters 2-39
         Called from file "src/plugins/wp/", line 1094, characters 15-41
         Called from file "src/plugins/wp/", line 1273, characters 14-39
         Called from file "src/plugins/wp/", line 1274, characters 9-22
         Called from file "src/plugins/wp/", line 1363, characters 2-47
         Called from file "", line 168, characters 20-25
         Called from file "src/plugins/wp/", line 136, characters 4-39
         Called from file "src/plugins/wp/", line 654, characters 15-40
         Called from file "src/libraries/stdlib/", line 299, characters 14-17
         Re-raised at file "src/libraries/stdlib/", line 299, characters 47-48
         Called from file "src/libraries/stdlib/", line 300, characters 2-12
         Called from file "src/libraries/stdlib/", line 300, characters 2-12
         Called from file "", line 134, characters 6-20
         Called from file "src/kernel_internals/runtime/", line 37, characters 4-20
         Called from file "src/kernel_services/cmdline_parameters/", line 789, characters 2-9
         Called from file "src/kernel_services/cmdline_parameters/", line 819, characters 18-64
         Called from file "src/kernel_services/cmdline_parameters/", line 228, characters 4-8
         Plug-in wp aborted: internal error.
         Please report as 'crash' at [^]
         Your Frama-C version is Phosphorus-20170501-beta1.
         Note that a version and a backtrace alone often do not contain enough
         information to understand the bug. Guidelines for reporting bugs are at: [^]
No tags attached.
c assigns.c (179) 2017-05-11 14:23
Issue History
2017-05-11 14:23JochenNew Issue
2017-05-11 14:23JochenFile Added: assigns.c
2017-05-11 15:46JochenNote Added: 0006395
2017-07-21 11:23yakobowskiNote Added: 0006428
2017-07-21 11:23yakobowskiAssigned To => correnson
2017-07-21 11:23yakobowskiStatusnew => assigned
2017-07-21 11:23yakobowskiCategoryKernel => Plug-in > wp

2017-05-11 15:46   
A similar unjustified warning can be triggered without statement contracts, when "for" labels referring to different behaviors are used, see file "beh2.c" at 0002298.
2017-07-21 11:23   
From what I can see, Frama-C's internal AST seems to be fine. I think the problem is on the WP side.