Giter Site home page Giter Site logo

janislley / lsverifier Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 4.0 22.94 MB

LSVerifier - Large Systems Verifier

License: Apache License 2.0

Python 88.33% C 11.67%
bounded-model-checking c-language formal-verification model-checking open-source-software security-vulnerabilities software-verification

lsverifier's Introduction

LSVerifier

LSVerifier is a command-line tool for formal verification of large ANSI-C projects in a single run.

It leverages the ESBMC model checker as its core verification engine.

Demo video.

Version

Version Improviments
v0.3.0 Support specific class of property verification; Support for large software; Prioritized functions verification, Disable invalid pointer verification.
v0.2.0 Support for libraries dependencies; Recursive verification.

Requirements

Ctags is required to use LSVerifier.

Installation

Install LSVerifier

From repository
  1. Clone the repository:
$ git clone https://github.com/janislley/lsverifier.git
  1. Install using pip:
$ cd LSVerifier
$ pip3 install .
From Pypi
$ pip3 install lsverifier

Usage

1. Verify a project

$ cd <project-root>
$ lsverifier -r -f

For projects with third-party library dependencies, use -l option to specify header paths:

$ lsverifier -r -f -l dep.txt

See an example of dep.txt below:

  /usr/include/glib-2.0/
  /usr/lib/x86_64-linux-gnu/glib-2.0/include/extcap/
  extcap/
  plugins/epan/ethercat/
  plugins/epan/falco_bridge/
  plugins/epan/wimaxmacphy/
  epan/crypt/
  ...

2. Verify a single C file

$ lsverifier -f -fl file.c

3. Verify C files using a priorization algorithm

If you want to verify a project using a prioritization scheme, run:

$ cd <project-root>
$ lsverifier -r -fp

4. Verify an entire project by providing the folder path as an argument

To set the folder path parameter, you should use -d:

lsverifier -r -f -l dep.txt -d project-root/

5. Verify C files using a predefined class of properties

In the project that you want to verify, run:

$ lsverifier -r -f -p memory-leak-check,overflow-check,deadlock-check,data-races-check

See more properties on tool help.

6. LSVerifier help

For more details, check the help:

$ lsverifier -h

usage: lsverifier [-h] [-l LIBRARIES] [-p PROPERTIES] [-f] [-fp] [-fl FILE] [-v] [-r] [-d DIRECTORY] [-dp] [-e ESBMC_PARAMETER]

Input Options

optional arguments:
  -h, --help            show this help message and exit
  -l,--libraries LIBRARIES
                        Path to the file that describes the libraries' dependencies
  -p,--properties PROPERTIES
                        Properties to be verified (comma separated):
                        multi-property
                        nan-check
                        memory-leak-check
                        floatbv
                        overflow-check
                        unsigned-overflow-check
                        ub-shift-check
                        struct-fields-check
                        deadlock-check
                        data-races-check
                        lock-order-check
  -f, --functions       Enable Functions Verification
  -fp, --function-prioritized
                        Enable Prioritized Functions Verification
  -fl,--file FILE       File to be verified
  -v, --verbose         Enable Verbose Output
  -r, --recursive       Enable Recursive Verification
  -d,--directory DIRECTORY
                        Set the directory to be verified
  -dp, --disable-pointer-check
                        Disable invalid pointer property verification
  -e,--esbmc-parameter ESBMC_PARAMETER
                        Use ESBMC parameter

Verification report

The verification results will be saved in output folder, automatically created in the current verification path. Each verification run generates two files:

  • lsverifier-DATE.log: Contains the verification output log.
  • lsverifier-DATE.csv: Contains the verification results in CSV format.

lsverifier's People

Contributors

bormaa avatar brcfarias avatar ericksonalves avatar janislley avatar thalestas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

lsverifier's Issues

After enable stderr, PUTTY verification freezes

Problem

Running the script using below command to verify PUTTY application, the verification freezes.
The problem occurs on termina.c file and paste_from_clip_local.

Logs

esbmc-wr log

Not unwinding loop 33 iteration 1 file terminal.c line 708 function compressline
**** WARNING: no body for function BinarySource_get_byte
Not unwinding loop 34 iteration 1 file terminal.c line 721 function compressline
**** WARNING: no body for function BinarySource_get_byte
Not unwinding loop 5 iteration 1 file string.c line 308 function memcmp
**** WARNING: no body for function BinarySource_get_uint16
Not unwinding loop 5 iteration 1 file string.c line 308 function memcmp
**** WARNING: no body for function BinarySource_get_byte
Not unwinding loop 30 iteration 1 file terminal.c line 477 function makerle
**** WARNING: no body for function BinarySource_get_uint16
Not unwinding loop 31 iteration 1 file terminal.c line 426 function makerle
**** WARNING: no body for function BinarySource_get_uint32
Not unwinding loop 5 iteration 1 file string.c line 308 function memcmp
**** WARNING: no body for function BinarySource_get_byte
Not unwinding loop 5 iteration 1 file string.c line 308 function memcmp
**** WARNING: no body for function BinarySource_get_uint16
Not unwinding loop 30 iteration 1 file terminal.c line 477 function makerle
**** WARNING: no body for function BinarySource_get_uint16 
Not unwinding loop 31 iteration 1 file terminal.c line 426 function makerle
**** WARNING: no body for function BinarySource_get_uint16 1

esbmc log

Not unwinding loop 97 iteration 1 file terminal.c line 3118 function term_print_flush                          
**** WARNING: no body for function ldisc_send                                                                  
**** WARNING: no body for function safefree                                                                    
**** WARNING: no body for function queue_toplevel_callbackNot unwinding loop 59 iteration 1 file terminal.c line 1491 function term_seen_key_event
                                                                                                               
**** WARNING: no body for function strbuf_free                                                                 
**** WARNING: no body for function safefree                                                                    
**** WARNING: no body for function ldisc_send                                                                  
**** WARNING: no body for function queue_toplevel_callback                                                     
Symex completed in: 605.319s (164811 assignments)                                                              
No solver specified; defaulting to Boolector                                                                   
Slicing time: 3.255s (removed 64842 assignments)                                                               
Generated 70278 VCC(s), 54059 remaining after simplification (99969 assignments)                               
terminate called after throwing an instance of 'std::bad_cast'                                                 
  what():  std::bad_cast  

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.