![](/img/trans.png)
[英]What is the meaning and purpose of “after” column in Frama-C EVA plugin
[英]Eva plugin of Frama-C reports “invalid user input” after finishing analysis
當我嘗試將Eva插件應用於C項目時,收到以下日志。
[eva:summary] ====== ANALYSIS SUMMARY ======
----------------------------------------------------------------------------
53 functions analyzed (out of 9107): 0% coverage.
In these functions, 5300 statements reached (out of 14354): 36% coverage.
----------------------------------------------------------------------------
Some errors and warnings have been raised during the analysis:
by the Eva analyzer: 0 errors 15 warnings
by the Frama-C kernel: 0 errors 2 warnings
----------------------------------------------------------------------------
45 alarms generated by the analysis:
29 invalid memory accesses
4 accesses out of bounds index
6 invalid shifts
1 access to uninitialized left-values
5 others
----------------------------------------------------------------------------
Evaluation of the logical properties reached by the analysis:
Assertions 1113 valid 18 unknown 1 invalid 1132 total
Preconditions 0 valid 0 unknown 0 invalid 0 total
98% of the logical properties reached have been proven.
----------------------------------------------------------------------------
[kernel] Warning: warning CERT:MSC:38 treated as deferred error. See above messages for more information.
[kernel] Frama-C aborted: invalid user input.
提供分析摘要后,Frama-C中止了分析。 但是,它沒有指出哪個文件和哪一行代碼有問題。 您能告訴我在這種情況下哪些可能的問題? 分析完成了嗎?
如該行的標題所示,該消息不是由Eva發出的,而是由Frama-C的kernel
發出的。 此錯誤表明您的代碼違反了CERT C編碼標准,更具體地說,它違反了MSC-38規則 ,該規則基本上指出,聲明屬於標准庫的標識符是一個壞主意,在該標識符中,它們被指定為可能實現為宏。 這尤其包括assert
和errno
。
由於此規則表明該代碼不嚴格符合ISO-C標准,因此已決定默認情況下將其視為錯誤,但是鑒於該問題本身不太可能導致分析儀崩潰,因此Frama-C不會這樣做觸發后立即中止。 這就是為什么您仍然可以啟動Eva的原因,它可以完美運行,然后被內核提醒您代碼中存在問題(可能在日志的開頭輸出了第一條消息,帶有警告狀態)。
您可以使用-kernel-warn-key CERT:MSC:38=<status>
修改CERT:MSC:38
的嚴重性狀態,其中<status>
范圍可以從inactive
(完全忽略)到abort
(發出錯誤並立即中止) )。 狀態的完整列表可以在用戶手冊的6.2節中找到。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.