Giter Site home page Giter Site logo

johnsonjh / duma Goto Github PK

View Code? Open in Web Editor NEW
95.0 11.0 10.0 10.46 MB

duma: Detect Unintended Memory Access (D.U.M.A.) - A Red-Zone memory allocator

Home Page: https://github.com/johnsonjh/duma

License: GNU General Public License v2.0

Makefile 1.42% Batchfile 0.20% C 58.09% C++ 17.04% CSS 3.04% Roff 3.40% Shell 10.73% JavaScript 1.53% CMake 4.00% Coq 0.54%
duma c malloc leak-detection allocator

duma's Issues

Additional configuration enhancements (TODO import)

  • config for long int sysconf (int parameter) Function This function is used to inquire about runtime system parameters. The parameter argument should be one of the SC symbols listed below. The normal return value from sysconf is the value you requested. A value of -1 is returned both if the implementation does not impose a limit, and in case of an error. The following errno error conditions are defined for this function:
    EINVAL The value of the parameter is invalid. enums: _SC_PAGESIZE Inquire about the virtual memory page size of the get page size returns the same value (see Query Memory Parameters). _SC_PHYS_PAGES Inquire about the number of physical pages in the system. _SC_AVPHYS_PAGES Inquire about the number of available physical pages in the system.

  • config for The ulimit Function: The ulimit function can be used to get and set certain process limits. #include <ulimit.h> long ulimit (int cmd, /* long newlimit */...); Returns: the value of the requested limit if OK, -1 on error The ulimit function allows a process to get or set some of its limits. The operation performed is determined by the value of the cmd argument, which must be one of the following four values: UL_GMEMLIM This returns the maximum amount of memory the process may use. On successful completion, the requested limit is returned. Otherwise, -1 is returned and the limit is not changed.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

(JS-0060) `eval()` should not be used

Description

JavaScript's eval() function is potentially dangerous and is often misused. Using eval() on untrusted code can open a program up to several different injection attacks. The use of eval() in most contexts can be substituted for a better, alternative approach to a problem. Example - The not-preferred way : ```js …

Occurrences

There are 4 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/johnsonjh/duma/issue/JS-0060/occurrences/

[DSBOT via GitLab] (JS-0128) Should not have unused variables

Description

Variables that are declared and not used anywhere in the code are most likely an error due to incomplete refactoring. Such variables take up space in the code and can lead to confusion by readers. Example - The not-preferred way : ```js // It checks variables you have defined as …

Occurrences

There are 5 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/johnsonjh/duma/issue/JS-0128/occurrences/

Build system items from TODO

Build system items imported from TODO:

  • Enhancement: Better out of box support for cross-compilation. (Autotools still the gold standard here but also try to support with CMake).

  • enhance detection of DUMA_MIN_ALIGNMENT in createconf use defines specifying the target architecture use compiler attributes which specify the necessary alignment

  • (Possibly) add autoconf/automake build process (useful for cross-build)

  • (Possibly)libtool to build shared libraries in Makefile depends on autoconf/automake

  • (Possibly) use configure to detect if f.e. pthread.h is installed and in search path check if pthread available before using it in Makefile depends on autoconf/automake

[DSBOT via GitLab] (JS-0128) Should not have unused variables

Description

Variables that are declared and not used anywhere in the code are most likely an error due to incomplete refactoring. Such variables take up space in the code and can lead to confusion by readers. Example - The not-preferred way : ```js // It checks variables you have defined as …

Occurrences

There are 5 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/johnsonjh/duma/issue/JS-0128/occurrences/

(JS-0050) Prefer the use of `===` and `!==` over `==` and `!=`

Description

It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=. For instance, the following statements are all considered true: js [] == false [] == ![] 3 == &quot;03&quot; If one of those occurs in an innocent-looking …

Occurrences

There are 32 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/johnsonjh/duma/issue/JS-0050/occurrences/

Use CMake for building instead of simple make

[ @suamor - Issue https://github.com/hayguen/duma_sf/issues/1 replicated. ]

Use cmake instead of simple make for project management.

Advantages:

  • Can be opened in QtCreator
  • Easier handling of dependencies
  • Less overhead for installation
  • Eases support for multiple platforms
  • Handling 32bit and 64bit compilations independent of CMakeFile
  • Much easier to build outside src folder
  • Less maintenance
  • Compiler can be changed without needing to change makefile

Disadvantages (apart from porting work)

  • Syntax of cmake may need some time to get used to
  • Extra Tool dependency for building
  • Extra project preparation step (cmake call) before actual build (however there also is cmake --build)
  • Build files are hidden in CMakeFiles folder
  • Different variable used for defining compiler and options (CMAKE_...)

Configuration file

  • use configuration file, which is read directly with system calls as replacement for the environment switches which use calls to the C library. this is to avoid hangs in the C library's getenv() function.
    • --> outdated: now using char **environ variable instead getenv()

relevant?

General enhancements/performance/additions

  • implement a list structure over pages rather than an array for all slots. this would save copying all slot entries, when list grows

  • store __func__ additionally to __FILE__ and __LINE__ depends on storing full filename (not just pointer) in slot

[DSBOT via GitLab] (JS-0001) Found assignment operators in conditional expressions

Description

In conditional statements, it is very easy to mistype a comparison operator (such as == or ===) as an assignment operator (such as =). For example : ```js // example code snippet to check if the // value of number is even or not if(number % 2 = 0) { …

Occurrences

There are 0 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/johnsonjh/duma/issue/JS-0001/occurrences/

TODO: Compiler-related

(From TODO)

  • add feature to enable floating point exceptions by default C programs work with quiet NANs or similar values after an error this feature shall allow detecting of floating point division by zero, overflow, ..

  • test duma on several other freely available/downloadable compilers:

  • find solution for errors, when duma used in combination with STL (and MFC) under MS Visual C++ on Windows

  • make new variants behave fully C++ conform at least new_handler() gets called now

randomized DUMA_PROTECT_BELOW

Decide on protecting upper or lower end with a reproducible random number generator (RNG) at runtime.
That will require additional control variables like DUMA_RANDOM_SEED .. and probably also a DUMA_PROTECT_BELOW_PROBABILITY with a value in 0 to 100. A good idea for a shorter but meaningful name would be nice!

DUMA_NO_GLOBAL_NEW_DELETE option

  • Similar to DUMA_NO_GLOBAL_MALLOC_FREE, it would be really nice if there were a DUMA_NO_GLOBAL_NEW_DELETE option, which would disable the DUMA implementations of new, new[], delete, and delete[] from being included into the library.

update/missing documentation: brief overview, features and comparison

current README.md does IMHO not give a good brief description of duma itself and for what it's good for.
something like http://duma.sourceforge.net/ is something, i would have in mind.
i'd suggest to insert that page - especially with the bullet points - at the begin of README.md.

above page contains the pdf document http://duma.sourceforge.net/74_75_76_77_78_Debugging_DE.pdf
it's german .. but, i'd think it's a good idea to add this document somehow into this github repo - probably not into the sources .. but unsure how/where. github does also offer sort of homepage - but never tried this.

in addition, that more than outdated sourceforge page does not reference this github repo.
i could check/try, if i can change this.

IMHO there's a too much history - not just in the history section - in the current README.md. This most of that could be outsourced into some separate document, e.g. history.md.

detailed description of the many environment variables is in the README.txt , which mostly was identical to the man page. think, this could be also converted into a .md and referenced from the primary README.md

some linux distribution like debian/ubuntu (https://packages.ubuntu.com/search?suite=default&section=all&arch=any&lang=en&keywords=duma&searchon=names) come with their own packages of duma. might be worth mentioning - if not already. but not sure what code base the maintainers use. but i know, that they used to apply a bunch of patches!

this repo does also come with the subfolder https://github.com/johnsonjh/duma/tree/master/comparisons
the https://github.com/johnsonjh/duma/blob/master/comparisons/README.txt does refers to a dead page.
following link to the wayback machine could be used:
https://web.archive.org/web/20090204104251/http://www.cs.utexas.edu/users/jpmartin/memCheckers.html

anyway, the comparison is more than outdated.
the progress on linux and gcc in the last decade(s) IMHO makes it necessary to give a simple comparison of duma against at least

Fixing support for macOS (OS X)

[ @suamor - Issue hayguen/duma/issues/2 replicated. ]

Duma does not build for gcc-6 and newer.
clang version 6 works (did not test later clang, but they may fail as well).

Benchmarking and performance

would think, we don't change the examples that often.
but, in fact, i have one more example in mind (better: demonstration), to compare performance with sort of number crunching.
just curious about what time factors we would get compared to gcc address sanitizer, but also valgrind.

Originally posted by @hayguen in #80 (comment)

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.