Coder Social home page Coder Social logo

jochenbaier / buginsight Goto Github PK

View Code? Open in Web Editor NEW
53.0 3.0 1.0 351 KB

A memory leak and deadlock finder for C, C++

License: GNU General Public License v3.0

CMake 2.85% C++ 97.00% C 0.15%
deadlock deadlock-avoidance deadlock-detection deadlock-free developer-tools leak memory memory-leak bug leak-detection

buginsight's Introduction

A memory leak and deadlock finder for C, C++

Introduction

BugInsight is a tool for finding memory leaks and potential deadlocks in C/C++ software for Microsoft Windows OS.

Main reason for use is to test Windows applications that cannot be tested under Linux (e.g. with AddressSanitizer, ThreadSanitizer, Valgrind) and to test the Windows only parts of an application.

An other reason is the low overhead with I/O bound (e.g. TCP/IP) applications or Qt GUI applications. A real world test with a TCP/IP application shows a slowdown of 10 %, with option "--callstacks=false" only 5 %.

BugInsight can be used manually and automated in a CI system. BugInsight does not need to be linked and no rebuilding of the application is needed.

Install

  1. Download latest release Zip BugInsight-x.x.x.x.zip from releases
  2. Unzip to any location

Usage

BugInsight.exe [Options] [Configuration] -- ["]application_to_test.exe["] [application_to_test options]

Examples:

BugInsight.exe example_memory_leak.exe 
BugInsight.exe --on_error=fail -- example_deadlock.exe
BugInsight.exe --ignore_modules=libssl-3-x64.dll,libcrypto-3-x64.dll -- app.exe --app_option

Example output memory leak detection: Example_Output
Example output deadlock detection: Example_Output

Usage in VS debugger (the VS output window will display clickable call stacks):

  1. Install VS Extension Child Process Debugging Power Tool
  2. VS project properties:
    Debugging->Command: 'path to BugInsight.exe'
    Debugging->Command Arguments: '-- $(TargetPath)'

Application under test requirements

  • C/C++ 64 bit application created with Visual Studio 2015 - 2022 (32 bit support is planned)
  • Dynamic runtime: Multi-threaded [Debug] DLL (/MD[d]), expect false positive leak reports and missing deadlocks if static runtime is used
  • For getting Calls Stacks: Debug or RelWithDebInfo configuration
  • Regression testing (CI): Release build recommended, performance could be further improved with command line option '--callstacks=false'

Features:

  • BugInsight uses (improved) parts from Visual Leak Detector for memory leak finding. The deadlock detection algorithm is from the C++ library Abseil.

  • Finding memory leaks and wrong memory API usage e.g. delete, delete[] mismatch

  • Deadlock detection and detect wrong lock usage with CriticalSection and std::mutex, std::recursive_mutex

  • Test applications (or parts of it) that cannot be tested on Linux with ThreadSanitizer and AddressSanitizer

  • Test with the Windows operating system on which the program will later run

  • Test applications that run too slowly with other test tools

  • Lock watchdog: The time a lock is waiting for a lock or holding a lock is monitored and a log or error is created if a maximum time is exceeded

  • Periodic heap validation (_heapchk(), HeapValidate())

  • Test C/C++ DLLs loaded in a Java program ( Java Native Interfaces)

  • Test C/C++ DLLs loaded in a .Net program (P/Invoke)

Monitored APIs

BugInsight can detect leaks or deadlocks from the following APIs: Monitored APIs. Please report missing APIs.
BugInsight monitors all modules (Exe ,DLL) used by application under test excluding modules provided by Windows OS (DLLs with Copyright info: 'Microsoft Corporation', e.g. Kernel32.dll).
BugInsight does not yet monitor handle leaks.

Command Line Options, Runtime API

Command Line Options
Runtime_API

Build BugInsight from source

Build_from_source

Alternatives (Windows OS)

Used Third-party software

Third-party software

License

BugInsight is licensed under the terms of the GNU General Public License v3.0 license. See LICENSE for more information.

buginsight's People

Contributors

jochenbaier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

smmstars

buginsight's Issues

Application was unable to start correctly

I tried to use BugInsight on two Qt applications and they both failed to work.

An error dialog showed the message:
"The application was unable to start correctly (0x0000142). Click OK to close the application."

The command line showed this:
[BugInsight] [info] BugInsight Application under test: 'MyApp.exe'
[BugInsight] [info] Loading 'BugInsight' into application under test.
[BugInsight] [warning] Call PeekNamedPipe() failed: 'The pipe has been ended.'.

[BugInsight] [info] Application under test finished with exit code '-1073741502'

I'm using Qt 6.2.12 and MSVC 2022.

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.