pax_global_header 0000666 0000000 0000000 00000000064 14012250560 0014505 g ustar 00root root 0000000 0000000 52 comment=e214a6ecf6e68ce3441c95fcd5c2ea5e1d4ba52b
duma-VERSION_2_5_21/ 0000775 0000000 0000000 00000000000 14012250560 0014071 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/.deepsource.toml 0000664 0000000 0000000 00000001142 14012250560 0017200 0 ustar 00root root 0000000 0000000 version = 1
[[analyzers]]
name = "javascript"
enabled = true
[analyzers.meta]
environment = ["browser"]
style_guide = "standard"
dialect = "typescript"
[[transformers]]
name = "yapf"
enabled = true
[[transformers]]
name = "autopep8"
enabled = true
[[transformers]]
name = "isort"
enabled = true
[[transformers]]
name = "standardrb"
enabled = true
[[transformers]]
name = "prettier"
enabled = true
[[transformers]]
name = "standardjs"
enabled = true
[[transformers]]
name = "rubocop"
enabled = true
[[transformers]]
name = "black"
enabled = true
[[transformers]]
name = "gofmt"
enabled = true duma-VERSION_2_5_21/.devbots/ 0000775 0000000 0000000 00000000000 14012250560 0015615 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/.devbots/lock-pull-request.yaml 0000664 0000000 0000000 00000000241 14012250560 0022066 0 ustar 00root root 0000000 0000000 enabled: true
comment: >
This pull request's conversation is
now locked. If you want to continue
this discussion or file a bug, please
open a new issue.
duma-VERSION_2_5_21/.github/ 0000775 0000000 0000000 00000000000 14012250560 0015431 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/.github/workflows/ 0000775 0000000 0000000 00000000000 14012250560 0017466 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/.github/workflows/codacy-analysis.yml 0000664 0000000 0000000 00000001337 14012250560 0023300 0 ustar 00root root 0000000 0000000 name: Codacy Security Scan
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
codacy-security-scan:
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@1.1.0
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
verbose: true
output: results.sarif
format: sarif
gh-code-scanning-compat: true
max-allowed-issues: 2147483647
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: results.sarif
duma-VERSION_2_5_21/.github/workflows/codeql-analysis.yml 0000664 0000000 0000000 00000001171 14012250560 0023301 0 ustar 00root root 0000000 0000000 name: "CodeQL"
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '40 8 * * 1'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'javascript' ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
duma-VERSION_2_5_21/.github/workflows/codescan-analysis.yml 0000664 0000000 0000000 00000001747 14012250560 0023622 0 ustar 00root root 0000000 0000000 name: CodeScan
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
CodeScan:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Cache files
uses: actions/cache@v2
with:
path: |
~/.sonar
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Run Analysis
uses: codescan-io/codescan-scanner-action@master
with:
login: ${{ secrets.CODESCAN_AUTH_TOKEN }}
organization: ${{ secrets.CODESCAN_ORGANIZATION_KEY }}
projectKey: ${{ secrets.CODESCAN_PROJECT_KEY }}
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: codescan.sarif
duma-VERSION_2_5_21/.github/workflows/crunch42-analysis.yml 0000664 0000000 0000000 00000001053 14012250560 0023461 0 ustar 00root root 0000000 0000000 name: "42Crunch REST API Static Security Testing"
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '17 2 * * 2'
jobs:
rest-api-static-security-testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 42Crunch REST API Static Security Testing
uses: 42Crunch/api-security-audit-action@v1
with:
api-token: ${{ secrets.API_TOKEN }}
min-score: 75
upload-to-code-scanning: true
github-token: ${{ github.token }}
duma-VERSION_2_5_21/.github/workflows/ossar-analysis.yml 0000664 0000000 0000000 00000000772 14012250560 0023167 0 ustar 00root root 0000000 0000000 name: OSSAR
on:
push:
pull_request:
jobs:
OSSAR-Scan:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 2
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
- name: Run OSSAR
uses: github/ossar-action@v1
id: ossar
- name: Upload OSSAR results
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: ${{ steps.ossar.outputs.sarifFile }}
duma-VERSION_2_5_21/.github/workflows/shiftleft-analysis.yml 0000664 0000000 0000000 00000000703 14012250560 0024022 0 ustar 00root root 0000000 0000000 name: SL Scan
on: push
jobs:
Scan-Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Perform Scan
uses: ShiftLeftSecurity/scan-action@master
env:
WORKSPACE: ""
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SCAN_AUTO_BUILD: true
with:
output: reports
- name: Upload report
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: reports
duma-VERSION_2_5_21/.github/workflows/veracode-analysis.yml 0000664 0000000 0000000 00000002651 14012250560 0023626 0 ustar 00root root 0000000 0000000 name: Veracode Static Analysis Pipeline Scan
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-and-pipeline-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
repository: ''
- uses: papeloto/action-zip@v1
with:
files: /
recursive: true
dest: veracode-pipeline-scan-results-to-sarif.zip
- uses: actions/upload-artifact@v2
with:
name: my-artifact
path: veracode-pipeline-scan-results-to-sarif.zip
- uses: wei/curl@master
with:
args: -O https://downloads.veracode.com/securityscan/pipeline-scan-LATEST.zip
- run: unzip -o pipeline-scan-LATEST.zip
- uses: actions/setup-java@v1
with:
java-version: 1.8
- run: java -jar pipeline-scan.jar --veracode_api_id "${{secrets.VERACODE_API_ID}}" --veracode_api_key "${{secrets.VERACODE_API_KEY}}" --fail_on_severity="Very High, High" --file veracode-pipeline-scan-results-to-sarif.zip
continue-on-error: true
- uses: actions/upload-artifact@v2
with:
name: ScanResults
path: results.json
- name: Convert pipeline scan output to SARIF format
id: convert
uses: veracode/veracode-pipeline-scan-results-to-sarif@master
with:
pipeline-results-json: results.json
- uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: veracode-results.sarif
duma-VERSION_2_5_21/.github/workflows/xanitizer-analysis.yml 0000664 0000000 0000000 00000001552 14012250560 0024052 0 ustar 00root root 0000000 0000000 name: "Xanitizer Security Analysis"
on:
push:
workflow_dispatch:
jobs:
xanitizer-security-analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Compile Java code
run: mvn -B compile
- name: Install JavaScript libraries
run: npm install
- name: Xanitizer Security Analysis
uses: RIGS-IT/xanitizer-action@v1
with:
license: ${{ secrets.XANITIZER_LICENSE }}
- uses: actions/upload-artifact@v2
with:
name: Xanitizer-Reports
path: |
*-Findings-List.pdf
*-Findings-List.sarif
- uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: Xanitizer-Findings-List.sarif
duma-VERSION_2_5_21/.gitignore 0000664 0000000 0000000 00000005237 14012250560 0016070 0 ustar 00root root 0000000 0000000 # Created by https://www.toptal.com/developers/gitignore/api/vim,visualstudiocode,linux,macos,cvs,git,c,c++
# Edit at https://www.toptal.com/developers/gitignore?templates=vim,visualstudiocode,linux,macos,cvs,git,c,c++
### C ###
# Prerequisites
*.d
# Object files
*.o
*.ko
*.obj
*.elf
# Linker output
*.ilk
*.map
*.exp
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
*.su
*.idb
*.pdb
# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
### C++ ###
# Prerequisites
# Compiled Object files
*.slo
# Precompiled Headers
# Compiled Dynamic libraries
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
# Executables
### CVS ###
/CVS/*
**/CVS/*
.cvsignore
*/.cvsignore
*,v
### Git ###
# Created by git for backups. To disable backups in Git:
# $ git config --global mergetool.keepBackup false
*.orig
# Created by git when using merge tools for conflicts
*.BACKUP.*
*.BASE.*
*.LOCAL.*
*.REMOTE.*
*_BACKUP_*.txt
*_BASE_*.txt
*_LOCAL_*.txt
*_REMOTE_*.txt
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Vim ###
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Session
Session.vim
Sessionx.vim
# Temporary
.netrwhist
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~
### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
### VisualStudioCode Patch ###
# Ignore all local history of files
.history
# End of https://www.toptal.com/developers/gitignore/api/vim,visualstudiocode,linux,macos,cvs,git,c,c++
# The following have been imported from .cvsignore
*.ncb
*.opt
*.plg
# Ignore .rej from patch
*.rej
# No longer ignoring the following (2020-08-25)
#createconf
#eftest
#tstheap
duma-VERSION_2_5_21/.gitlab-ci.yml 0000664 0000000 0000000 00000010066 14012250560 0016530 0 ustar 00root root 0000000 0000000 ###################### Begin Defaults
stages:
- all
variables:
GIT_DEPTH: 0
GIT_STRATEGY: clone
default:
before_script:
- |
# before_script
echo "Starting before_script actions."
echo "Finished before_script actions."
after_script:
- |
# after_script
echo "Starting after_script actions."
echo "Finished after_script actions."
###################### End Defaults
###################### Begin Common Blocks
.scriptCommon: &scriptCommon |
# scriptCommon
echo "Project Name : $CI_PROJECT_TITLE"
echo "Project Git Commit : $CI_COMMIT_SHA"
echo "Project Git Branch : $CI_COMMIT_BRANCH"
echo "GitLab CI User Details : $GITLAB_USER_LOGIN - $GITLAB_USER_NAME ($GITLAB_USER_ID) $GITLAB_USER_EMAIL"
echo "GitLab CI Job Name : $CI_JOB_NAME"
echo "GitLab CI Job ID : $CI_JOB_ID"
echo "GitLab CI Job Stage : $CI_JOB_STAGE"
echo "GitLab CI Runner Details : $CI_RUNNER_VERSION ($CI_RUNNER_REVISION)"
.scriptGitPre: &scriptGitPre |
# scriptGitPre
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git --no-pager fetch --tags
git --no-pager fetch --all --recurse-submodules=yes
git --no-pager update-index -q --refresh --really-refresh
git --no-pager for-each-ref --count=1
git --no-pager reset --hard
git --no-pager diff --full-index --exit-code
###################### End Common Blocks
###################### Begin Windows Build + Test
#windows job:
# tags:
# - Windows-x86_64
# stage: all
# script:
# - *scriptCommon
# - $env:Path += ";C:\Program Files\Git\cmd;C:\Go\bin;C:\Progra~1\Git"
# - *scriptGitPre
# - |
# # TODO(jhj): PLACEHOLDER - Windows build and test will eventually go here
# - |
# # status
# echo "Windows skipped"
###################### End Windows Build + Test
###################### Begin Linux
linux job:
tags:
- Linux-x86_64
stage: all
script:
- *scriptCommon
- |
# upgrade system, install development tools
- yum install dnf -y || true :;
- yum clean all -y || true :;
- dnf upgrade --refresh -y || true :;
- dnf groupinstall "Development Tools" -y || true :;
- dnf install epel-release centos-release-scl centos-release-scl-rh -y || true :;
- dnf install pv valgrind ccache graphviz clang zsh autoconf-archive bash mksh rpmconf scl-utils devtoolset-9 -y || true :;
- dnf groupupdate base -y || true :;
- yes | /usr/sbin/rpmconf -a || true :;
- . /opt/rh/devtoolset-9/enable
- dnf clean all -y || true :;
- *scriptGitPre
- gcc --version
- gmake clean
- gmake distclean
- gmake -k
- gmake test -k
# - gmake install
# - gmake installcheck
# - gmake uninstall
- gmake clean
- gmake distclean
- |
# status
echo "gmake: clean -> distclean -> test -> clean -> distclean: OK"
###################### End Linux Build + Test
####################### Begin macOS Build + Test
#macos job:
# tags:
# - macOS_X-x86_64
# stage: all
# script:
# - |
# # update & upgrade homebrew
# bash --norc --noprofile --posix -c "brew update >/dev/null 2>&1 || true :;" >/dev/null 2>&1 || true :;
# bash --norc --noprofile --posix -c "brew upgrade >/dev/null 2>&1 || true :;" >/dev/null 2>&1 || true :;
# - *scriptCommon
# - if type brew >/dev/null 2>&1; then export HOMEBREW_PREFIX=$(brew --prefix 2>/dev/null); for dir in ${HOMEBREW_PREFIX}/opt/*/libexec/gnubin; do export PATH="${dir}:${PATH}"; done; fi
# - export PATH="/usr/local/opt/gcc/bin:${PATH}"
# - *scriptGitPre
# - gcc --version
# - gmake clean OS=darwin
# - gmake distclean OS=darwin
# - gmake OS=darwin -k
# - gmake test OS=darwin -k
## - gmake install OS=darwin
## - gmake installcheck OS=darwin
## - gmake uninstall OS=darwin
# - gmake clean OS=darwin
# - gmake distclean OS=darwin
# - |
# # status
# echo "gmake: clean -> distclean -> test -> clean -> distclean: OK"
####################### End macOS Build + Test
duma-VERSION_2_5_21/.mergify.yml 0000664 0000000 0000000 00000000234 14012250560 0016333 0 ustar 00root root 0000000 0000000 pull_request_rules:
- name: Automatic merge on approval
conditions:
- "#approved-reviews-by>=1"
actions:
merge:
method: merge
duma-VERSION_2_5_21/.whitesource 0000664 0000000 0000000 00000000327 14012250560 0016435 0 ustar 00root root 0000000 0000000 {
"scanSettings": {
"baseBranches": []
},
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "failure",
"displayMode": "diff"
},
"issueSettings": {
"minSeverityLevel": "NONE"
}
}
duma-VERSION_2_5_21/CHANGELOG 0000664 0000000 0000000 00000077201 14012250560 0015312 0 ustar 00root root 0000000 0000000 CHANGELOG:
==========
2.5.20
* Typo fix and build system updates - nothing functional.
2.5.19
* Updated scripts, Debian release info, minor changes.
2.5.18
* Non-beta tagged release.
2.5.17
* Updated README with extra history and information.
(2020-12-15, JJ)
* Added SECURITY.md: New Security Policy for bug reporting.
(2020-12-15, JJ)
* Added LICENSE: Merged COPYING-GPL and COPYING-LGPL.
(2020-08-25, JJ)
* Updated TODO with items from 2009-12-30 by Daniel Trebbien.
(2020-08-25, JJ)
* Updated TODO with items from 2008-05-23 by Michael Eddington.
(2020-08-25, JJ)
* No longer build test programs (for now) to unbreak static builds.
(2020-08-24, JJ)
* Applied various update patches from the Buildroot Project.
(2020-10-28, JJ)
* Applied a patch from Swati Kumari for additional NULL checks.
(2015-07-30, JJ)
* Applied a patch for bug ID #3035145 from Reinhard Katzmann.
(2010-07-26, JJ)
* Applied a patch for bug ID #2923784 from Daniel Trebbien.
(2009-12-30, JJ)
* Applied a patch for bug ID #2923779 from Daniel Trebbien.
(2009-12-30, JJ)
* Applied a patch for bug ID #2831348 from an Anonymous SourceForge user.
(2009-07-23, JJ)
2.5.16
* added memmove() implementation based on memove() from klibc.
code from Andris Zeila, see
http://sourceforge.net/tracker/?func=detail&aid=2792252&group_id=149725&atid=775376
(2009-05-21, HA)
* fixed "Broken build in Msys and C++ tests fail":
fixed USE_WIN32_CRIT_SECT implementation in sem_inc.c, mingw now uses this one
added make section for OSTYPE=msys-sh, which uses mingw32-gcc/g++ and rm
* use USE_WIN32_CRIT_SECT implementation also for cygwin, fixes testoperator
(2009-05-23, HA)
* remove CVS subdirectories from packaging
* removed debian subdirectory from CVS
(2009-06-07, HA)
* fixed "Wrong LD_PRELOAD path in duma.sh". see
https://sourceforge.net/tracker/?func=detail&aid=2800139&group_id=149725&atid=775376
(2009-06-12, HA)
* fixed "GNUmakefile is missing DESTDIR" using submitted patch:
https://sourceforge.net/tracker/?func=detail&aid=2800137&group_id=149725&atid=775376
* moved definition of MAN_INSTALL_DIR and DOC_INSTALL_DIR in GNUmakefile
after definition of prefix
(2009-06-15, HA)
* removed GNUmakefile option "DUMA_SEMAPHORES"
(2009-06-14, HA)
2.5.15
* added alternative locking implementation in sem_inc.c
using critical sections.
code from Peter Harris, see
http://code.google.com/p/electric-fence-win32/
* added Windows Threading to testmt.c
added win32-msvc.net project file
* use of WIN32_SEMAPHORES on Win32-Cygwin in sem_inc.c
- the locking mechanism for multi-threading,
with this configuration testmt.c works either
with pthreads and with the Win32 API
* CreateSemaphore() now used with maximum count = initial count = 1
(2008-08-03, HA)
* removed usage of strlen() in strncpy()
(2009-03-19, HA)
* PATCH from Andre Landwehr
fixes race condition when using preprocessor macro 'delete'
(2009-04-07, HA)
* bugfix in strncpy()
Roman Jokl reported the bug: error check was too rigorous
(2009-04-11, HA)
2.5.14
* added suggested ~/.gdbinit as gdbinit.rc
* added hint in mprotectFailed()
* removed (gcc) compiler warnings
* rename of sem_inc.h to duma_sem.h, cause needed by dumapp.h
(2008-03-12, HA)
* update of README for Microsoft's pageheap.exe,
a built in heap debugging tool
(2008-04-20, HA)
* PATCH from Philip Mucci on behalf of SiCortex
* Fix for malloc(0) which previously always returned NULL.
added environment switch DUMA_MALLOC_0_STRATEGY, which may
return a special protected piece of memory for malloc(0)
* Moved malloc/SHOW_ALLOC printouts before all abort checks
(2008-04-20, Philip Mucci, HA)
* remove some warnings for "-Wall -Wextra" especially for cygwin
* detailed some messages when source filename and lineno were available
(2008-04-21, HA)
* removed environment variable "DUMA_ALLOW_MALLOC_0"
DUMA_MALLOC_0_STRATEGY = 0 is equivalent to previous
DUMA_ALLOW_MALLOC_0=0. default is 3.
(2008-04-22, HA)
* return unique pointer for C++ operator new
for DUMA_MALLOC_0_STRATEGY == 3. now it should be really standard conform
(2008-04-26, HA)
* Fix for C++ operator new with size zero
added environment switch DUMA_NEW_0_STRATEGY
(2008-04-27, HA)
2.5.13
* applied PATCH(es) from Philip Mucci
from the company SiCortex www.sicortex.com :
- Fix for pthread_self() and hang of testoperators test case on 64 bit
linux platforms (x86_64 and MIPS64)
- Added -Wall to Makefile
- Properly versioned symbolic library to have the version triple 0.0.0
- Removed control-M's from the sources. Please do not ship unix sources
with control-M's (stop editing on Windows)
- Make sure ranlib is run on the static library,
various platforms require this
- Add -DPIC for shared library builds
- Added install targets for headers (INC_INSTALL_DIR)
- Added install targets for documentation (DOC_INSTALL_DIR)
- Added separate 'make test' target
- Added proper install target that also refers to
GNU standard DESTDIR usage.
- Added 'distclean clobber' targets to remove configuration
- Added 'reconfig' target to regenerate duma_config.h
- Changed makefile flow to recursively run if duma_config.h doesn't exist
- Fixed return value error in testmt.c
- Fixed args in thread-test.c
* updated Makefile: updated PACKAGE_SOURCE and added target dos2unix
(2008-03-09, HA)
2.5.12
* enhancement: added environment variable 'DUMA_CHECK_FREQ' to autmatically
check all memories no man's land at each n'th allocation/deallocation.
n=0 to deactivate automatic checks.
(2008-01-24, HA)
* updated README.txt for environment variables DUMA_CHECK_FREQ and
DUMA_SKIPCOUNT_INIT.
(2008-01-25, HA)
2.5.11
* bugfix on thread safety in sem_inc.c
thanks to Andrew Kornev writing the right hint as bugreport:
"[ 1875926 ] non-thread safe lock() implementation"
(2008-01-20, HA)
2.5.10
* added small test program to demonstrate crashing on multithreaded
programs from
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=67838
(2008-01-15, HA)
* added html comparison charts/text and C source code examples from
http://www.cs.utexas.edu/~jpmartin/memCheckers.html
into subdir comparisons
with kind permission of Jean-Philippe Martin
* added Makefile for each C source file
(2008-01-14, HA)
* bugfix for Makefile target install, when DUMASO is empty
bug was reported from Louis Strous
(2008-01-09, HA)
* added hint where no man's land was overwritten:
below or above userSpace
(2008-01-03, HA)
2.5.9
* added link to mpatrol in README
* added shell environment variable 'DUMA_SKIPCOUNT_INIT'
(2007-08-22, HA)
* added section for NetBSD in Makefile
there is always 1 memory leak on NetBSD-3.1
.. but the functionality works
(2007-08-28, HA)
* tested on powerpc-apple-darwin8.0.0 inside of PearPC 0.4 (Windows):
compiles and passes all confidence tests. trying to debug example1
from within gdb crashes whole PearPC; running without gdb creates
a core dump one can analyse afterwards with gdb.
(2007-09-02, HA)
* bugfix for _duma_strncpy(): no more call to strlen()
bug was reported from kamallneet
* applied patch from Eddy Pronk
submitted to sourceforge with title "libduma.so on Solaris"
(2007-11-13, HA)
* added minor error check in print.c about DUMA_OUTPUT_FILE
* some comments in duma.h and dumapp.h
(2007-12-23, HA)
2.5.8
* fix: set DUMA_PREFER_GETENV for osx; it doesn't link with environ
* fix: MinGW wanted exact declaration as in definition for
function DUMA_strerror in print.h
* fix: workaround testmt.c to compile on Windows
* fix: call duma_init() ifdef DUMA_EXPLICIT_INIT in testoperators.cpp
* added notes on prepackaged .rpm files provided by
Dries Verachtert at
http://dries.ulyssis.org/apt/packages/duma/info.html
in README
(2007-08-17, HA)
* added environment variable 'DUMA_REPORT_ALL_LEAKS' defaulting to 0.
* added empty definitions for macro functions DUMA_SET_ALIGNMENT(),
DUMA_SET_PROTECT_BELOW() and DUMA_SET_FILL()
* updated README on shell environment variable options, added some
entries to section 'OTHER ALTERNATIVE/ADDITIONAL DEBUGGING SOFTWARE/TOOLS'
and added section 'COMPILATION NOTES FOR RELEASE/PRODUCTION'
(2007-08-18, HA)
* added single line function 'duma_alloc_return()'. all memory allocated
from DUMA is returned through this function. This allows you to set a
conditional breakpoint on this function to catch a specific allocation
(2007-08-19, HA)
2.5.7
* reformatting: converted tabs to spaces
* added test program testenv.c using global environ variable as
alternative to getenv()
(2007-08-15, HA)
* added output of some configuration settings with banner
* switched off leak detection in shared library for any platform.
use the static library for finding leaks - with information where
the piece of memory got allocated. Meanwhile I think leak-checking
without further information is quite useless! Too many correct
programs don't free all memory, cause the system frees memory up at
program end. Thus, too many platforms/environments are reported
"broken" from DUMA.
* output allocator type (malloc, strdup, ..) with leak report for each
non freed memory block
* removed option DUMA_USE_FRAMENO and the frameno variable
i suppose nobody is using it. but additionally it is not thread safe.
* added option DUMA_PREFER_GETENV
if you prefer standard C library getenv() over global char **environ
* added function duma_check(void*) and its macro DUMA_CHECK():
it checks the No Mans Land - especially the unprotected end - of
the memory block
* added function duma_checkAll() and its macro DUMA_CHECKALL():
it checks the No Mans Land - especially the unprotected end - of
all allocated memory blocks
(2007-08-17, HA)
2.5.6
* modified example Makefiles for not linking to pthreads on Windows
(2007-08-12, HA)
* added win32-msvc.net project file for testoperators.cpp
* bugfix: obey for option DUMA_NO_LEAKDETECTION:
check for this option before calling any non-existing operators
with leak parameters
* enhanced comments in Makefile for DUMA_SO_* and DUMA_LIB_* options
* changes in Makefile to build dynamic library on osx
* preloading duma library now works on osx
* added Debian Bug report logs - #241156 as testmt.c
(2007-08-14, HA)
2.5.5
* support for Solaris (Solaris 10 with the GNU toolchain from Companion CD)
* fix for solaris: strerror() calls calloc() leading to recursion
added preprocessor option DUMA_NO_STRERROR
* internal redesign:
collected several global static variables to one structure
and several global non static variables to other structure
each with prepended and appended protection space
(2007-08-11, HA)
2.5.4
* support for win32 mingw when calling make with OSTYPE=msys
call "mingw32-make OSTYPE=msys" from Windows command prompt
having added the PATH for MINGW/bin
(2007-07-28, HA)
* echo single dot '.' for windows command shell
(2007-07-31, HA)
2.5.3
* added simple Makefiles for examples in subdir example_makes/ex*/
* modified Makefile to avoid build of shared libs/executables specific to OS
* dumapp.h now keeps C macro definitions
* support for max osx when calling make with OS=osx
* support for win32 cygwin when calling make with OSTYPE=cygwin
(2007-07-14, HA)
* bugfix in createconf.c for Win32 but non Visual C++
* got cygwin to work:
switched off stacktrace (before trying to integrate in Makefile)
caddr_t and u_int were already defined
use signals as on Linux/Unix in dumatest.c
updated Makefile
(2007-07-13, HA)
2.5.2
* minor corrections
* added preprocessor option "DUMA_SEMAPHORES" to select pthreads
locking mechanism: semaphores or mutexes
* removed automatically generated visual c++ file detoursexample1.ncb
from CVS and archives
(2007-07-12, HA)
2.5.1
* turned global variables DUMA_PROTECT_BELOW, DUMA_ALIGNMENT and DUMA_FILL
to thread local variables. Acces now with new function macros
DUMA_SET_ALIGNMENT(), DUMA_SET_PROTECT_BELOW() and DUMA_SET_FILL()
* support for posix_memalign()
* pthread_mutex implementation alternative to semaphores
(2007-07-03, HA)
2.5
* Documentation updates. Now using Natural Docs
* win32: Detours support for using DUMA with just binaries
* win32: Can compile a duma dll
* win32: DUMA can perform stacktraces of each allocation
* win32: Support for Visual Studio 2005
* win32: Support for output to debug console
* Support for output to a file
* Can control output via environmental variables
2.4.28 fix/enhancement: reworked initialization for RequestID 1458083 on SF
checks for recursive calls in _duma_init() and duma_init()
(2006-06-17, HA)
bugfix in new[] operators occured on alpha-linux1 on sf compile farm
(2006-06-18, HA)
bugfix in Makefile: DUMA_OPTIONS was not used
when compiling createconf.o
bugfix: compile error when DUMA_NO_LEAKDETECTION was set
in testoperators.cpp
fix: obey EXPLICIT_INIT in testoperators.cpp
(2006-06-18, HA)
fix: as in RequestID 1482267 on SF:
updated install directory for manual. $prefix/share/man/man3 should fit
the Filesystem Hierarchy Standard 2.3 for /usr and /usr/local
(2006-06-18, HA)
2.4.27 this version is now reachable via cvs on sourceforge.net
2.4.27 published a german article on DUMA on http://duma.sourceforge.net/
bugfix: removed buffer overflow in DUMA_sprintf() for long filenames:
added parameter maxsize for output buffers in some functions.
incremented STRING_BUFFER_SIZE to reduce this risk.
this bug was reported by
(2006-01-09, HA)
2.4.26 new project file for Dev-C++ 4.9.9.2 for createconf from
Benjamin Berkels
bugfix/enhancement: avoid recursion from sem_init() in Linux/U*ix
where sem_init() may call malloc() which again calls semaphore locking
(2005-10-25, HA)
bugfix in delete macro: Magic must be a single variable!
reported from Benjamin Berkels
some more TLS preparation
(2005-10-28, HA)
2.4.25 bugfix: semaphores were not initialized correctly; this lead to a hang.
thanks for reporting and providing a test environment
to Tim Braun
updated project files for Dev-C++ 4.9.9.2 / GCC 3.3.1
and bugfixed compiler error for Dev-C++/gcc both reported from
Benjamin Berkels
modified delete macros
DUMA_Magic now array (call_depth)
(2005-10-21, HA)
2.4.24 new program testoperators: writes its own member new/delete operator
with filename and line number forwarding to DUMA
reworked Makefile: added tstheap_so which runs with shared library
output in banner now shows which library (static/shared) is used
(2005-10-09, HA)
2.4.23 write DUMA's preprocessor flags at compile time of the library
to duma_config.h. Thus one no more would have to provide the same
flags when compiling his own objects files.
changed Makefile, to take care for this
(2005-10-07, HA)
2.4.22 C++ 'new' operators now (more) standard conform:
allocation of size==0 now returns non 0 pointer
new option 'DUMA_SUPPRESS_ATEXIT' as environment variable
from Tim Braun :
suppress call to C library's atexit() function for DUMA's leak
checking function in buggy environments, where atexit() hangs.
implemented alternative for C library's atexit() using GNU C compiler's
'destructor' function attribute.
new preprocessor flag 'DUMA_PREFER_ATEXIT' in Makefile
got updated project files for Dev-C++ 4.9.9.2 / GCC 3.3.1 from
Benjamin Berkels
updated TODO
bugfix: "EF_" was not replaced by "DUMA_" in tstheap.c
bugfix: rules how to build test objects; DUMA_OPTIONS were not passed
(2005-10-06, HA)
2.4.21 modified Makefile: name for shared library and symbolic links now
configurable at start
update of README
updated TODO; sorted by priority
(2005-10-04, HA)
bugfix: follow enum _DUMA_FailReturn in _duma_allocate() function
bugfix: initialize userAddr in _duma_allocate() function
may lead to bug when allocation failed
new operators now (nearly) C++ conform
(2005-09-29, HA)
2.4.20 integrated patches from Zbynek Vyskovsky :
use tighter alignment when size is smaller than default alignment
replaced calls to EF_Exit() by EF_Abort()
modified README
(2005-09-19 - 2005-09-23, ZV)
reworked Zbynek's patch to use long in internal adress calculations:
autodetect compatible integer types DUMA_ADDR and DUMA_SIZE in
createconf. write them to duma_config.h
autodetect DUMA_MIN_ALIGNMENT in createconf, write value to
duma_config.h
use autodetected values in code
reworked DUMA_sprintf() and its format specifier
bugfixed Makefile: DUMA_SO_OPTIONS also used DUMA_OPTIONS
removed '-DDUMA_NO_CPP_SUPPORT', as LD_PRELOAD works for C++
new, new[], delete and delete[] operators
(2005-09-24, HA)
bugfixed reduceProtectedMemory(): Windows VirtualFree(,,MEM_RELEASE)
can only free whole allocations. not parts.
bugfix in memory allocation: try allocation in loop until
reduceProtectedMemory() fails deallocating more memory.
long running programs with much memory handling should benefit.
(2005-09-26, HA)
added project files for Visual C++ .NET 2003
applied one more patch from Zbynek Vyskovsky concerning alignment
his calculation of next lower power of 2 is much smaller
bugfix: return '(void*)0' in _duma_allocate(), when userSize==0
(2005-09-27, HA)
2.4.19 fixed compile error in duma.c introduced in 2.4.18
fixed/enhanced Makefile
(2005-09-19, HA)
added runtime check for DUMA_PAGE_SIZE from duma_config.h
(2005-09-17, HA)
added check for initialization function "__attribute ((constructor))"
(2005-09-18, HA)
2.4.18 checked Source code: DUMA_get_sem() is nor more called,
when DUMA_NO_THREAD_SAFETY is set
splitted this document into two files: TODO and CHANGELOG
created INSTALL document
modified Makefile: added special rules for building shared library
(2005-09-10, HA)
modified README
(2005-09-16, HA)
removed option DUMA_FREE_WIPES
documented the options DUMA_SLACKFILL, DUMA_MALLOC_FAILEXIT,
DUMA_MAX_ALLOC, DUMA_FREE_ACCESS, DUMA_SHOW_ALLOC and
DUMA_DISABLE_BANNER in README.
new preprocessor flag 'DUMA_NO_HANG_MSG' in Makefile
(2005-09-16, HA)
2.4.17 forked Electric Fence cause Bruce Perens wrote:
> Hayati Ayguen must choose another name for his program.
> "Electric Fence" is a trademark he is not permitted to use.
opened a "new" project DUMA - Detect Unintended Memory Access
rename efence to duma
rename Electric Fence to DUMA
rename EF_ to DUMA_
rename ef_ to duma_
rename eff_ to duma_
and so on ...
(2005-09-10, HA)
2.4.16 added examples for article
portability: use standardized strerror() instead sys_nerr
and sys_errlist[].
bugfix: error when defined EF_NO_LEAKDETECTION in _eff_allocate()
bugfix: error when defined EF_NO_LEAKDETECTION in _eff_deallocate()
enhancement: mark allocations from standard libraries
before ef_init() is called with lineno = -1
to allow special treatment in leak_checking
changed default in eftest to use two signals: SIGSEGV and SIGBUS
instead of single PAGE_PROTECTION_VIOLATED_SIGNAL
define functions (memcpy, strcpy, strcat) as non-intrinsic
for Visual C++ compiler in Release mode
(2005-08-28, HA)
enhancement: allow alignments bigger than page size
(2005-08-23, HA)
documented EF_NO_THREAD_SAFETY preprocessor flag in Makefile
added EF_EXPLICIT_INIT preprocessor flag to workaround buggy
environments: initialisation is done in 2 steps:
1- must do things when allocation is called
2- non must-do like retrieving environment variables, registering atexit()
calls to functions getenv(), atexit() and write() are avoided in
first step.
3- avoid semaphore locking before 2.step is done
(2005-08-21, HA)
2.4.15 bugfixed page management under Windows: virtual address space never got
released. unfortunately this "quick" fix avoids memory pooling (under
Windows).
remove double "Electric Fence:" messages when calling EF_Abort()
or EF_Exit()
(2005-07-24, HA)
added parameter ExitOnFail to Page_Create().
added warning when allocation failed and ExitOnFail is off.
extended _eff_allocate() for this. prepared new for standard conformity.
(2005-07-20, HA)
2.4.14 integrated code from Tim Braun
new EF_SHOW_ALLOC environment variable, which prints allocations
and deallocation when variable set
check if malloc() and free() are bound to efence
(2005-07-15, HA)
integrated a patch from Zbynek Vyskovsky
in his words: "I modified Electric Efence a little, to be able
to catch free-ing memory via watch point in debugger. The patch
(attached) solves the problem when you are watching expression for
change and suddenly realize the memory containing expression
disappeared. It has no other effect, just makes debugging easier."
(2005-07-11, HA)
bugfix for internal slot mode EFST_DEALLOCATED reported by
Mikolas Patocka: error occured when userSpace memory region of freed
memory is reused from system and freed again: efence claimed freeing
already freed memory.
(2005-03-02, HA)
now defining macros/functions also for str[n]cpy() and str[n]cat()
checking for overlapping memory regions.
(2005-02-17, HA)
now defining macros/functions also for strdup(), memcpy().
memcpy() checks if memory regions overlap.
(2005-02-16, HA)
added EF_OLD_DEL_MACRO preprocessor flag to keep compatibility to old
DEL_ELEM() / DEL_ARRAY() macros. when not defined a macro for "delete"
is defined which has standard conform syntax.
(2005-02-14, HA)
2.4.13 added internal flag saving the source (allocation/deallocation)
for filename and lineno.
added EF_OLD_NEW_MACRO preprocessor flag to keep compatibility to old
NEW_ELEM() / NEW_ARRAY() macros. when not defined a macro for "new"
is defined which has standard conform syntax. unfortunately you have
to use DEL_ELEM/DEL_ARRAY further to utilize filename and linenumber
of deallocation calls.
(2005-02-10, HA)
reworked/revised ALL internal functions !!!
freeing already freed memory is now detected (much better)
this disallows coalescing memory regions and also stores __FILE__
and __LINE__ of free() to be able to print position of first free.
added EF_USE_FRAMENO preprocessor flag. changed not to support
EF_newFrame() and EF_delFrame() by default.
(2005-02-07, HA)
applied bugfix posted by Luis Gonzalez. bug was occuring under
SuSE Linux 9.1 when calling eftest with a higher number f.e. 10000.
(2005-02-02, HA)
bugfixed memalign() which was not exported as extern "C". this bug lead
to crashes when freeing memory allocated by memalign(). bug was
reported by Grant Goodyear and Steven G. Johnson.
now defining macros/functions also for valloc()
(2005-02-03, HA)
2.4.12 added EF_NO_GLOBAL_MALLOC_FREE preprocessor flag to workaround buggy
environments:
no malloc(),free(),realloc(),calloc() are put into the global namespace
of the efence library, thus only files which include efence.h call the
efence malloc(),.. replacement functions.
this flag is also helpful where linking order cannot get controlled
f.e. when memory is allocated from a library not using efence but free
is called from efence using efence. this is a problem when using .dll
libraries which are linked against msvcrt.dll and its malloc/free under
MS Windows. the same problem applies when libstdc++ / libgcc is not
linked in correct order.
(2005-01-04, HA)
2.4.11 bugfixed signal handling in confidence test (eftest),
which lead to false errors with my newly installed MandrakeLinux 10.1
(2005-01-03, HA)
bugfixed checking at free(), when EF_PROTECT_BELOW flag changed:
which lead to false positives.
bugfixed error message output to stderr: length of messages were
calculated too short. fixed functions EF_Abort() and EF_Exit().
(2004-08-15, HA)
2.4.10 added preprocessor macros for CA_DECLARE, CA_DEFINE, CA_REF in efence.h
for declaration, definition and reference to Checked Arrays.
these macros allow checks of arrays which are allocated on stack,
but they are very slow on references cause every reference has to
be checked.
added EF_ASSERT() which definitely halts (for debugging)
precompiled headers have to be switched off in MS Visual C++ to get all
the C++ operators to work. but don't ask me why!
implemented all the various new/delete/new[]/delete[] C++ operators.
the implementations are not C++ conform concerning their behaviour
added type mismatch detection between malloc()/free(), new/delete,
new[]/delete[]. This is deactivated when EF_NO_LEAKDETECTION is set.
added EF_MALLOC_FAILEXIT parameter. (for now not implemented)
extended semantics of EF_PROTECT_FREE.
added EF_MAX_ALLOC parameter.
bugfix: why should we ever use Page_Delete() when setting up
the "dead" page?
bugfix: EF_PROTECT_FREE did exactly the opposite of that, what it
should do up from Bruce's version 2.2.2 maybe earlier.
(2004-07-16, HA)
confidence test now PASSes again
removed problems when used EF_NO_LEAKDETECTION preprocessor flag
got Makefile to work again, also included automatic generation of
efence_config.h
added automatic generation and inclusion of efence_config.h instead
function Page_Size()
(2004-07-15, HA)
added code for thread safety: only one thread at once is allowed to enter
some internal functions. this can be deactivated using the EF_NO_THREAD_SAFETY
preprocessor flag. there may be flaws concering threads, when using the c++ operators
for leak detection: use the EF_NO_LEAKDETECTION preprocessor flag if you encounter problems!
some files (page.c and print.c) have turned to header files,
the needed functions are now declared static
and are no more visible outside efence.c this way
the NDEBUG preprocessor flag has been replaced by EF_NO_EFENCE, EF_NO_CPP_SUPPORT.
so be careful not to include efence in your release builds!
(2004-03-21, HA)
2.4.9 added checks for no mans land (= space which cannot get protected from
the MMU): this area gets filled with EF_FILL on allocation, and gets
checked on deallocation.
(2002-12-04, HA)
2.4.8 one big fix and many improvements for C++ code. old macros NEW_ELEM,
NEW_ARRAY were not usable when allocating classes, which have
constructor/destructor. the usage of these macros has not changed
(see 2.4.3).
(2002-12-04, HA)
2.4.7 get to work with Borland Free Commandline Tools: Borland C++ Builder 5.5
thrown away unnecessary declarations of malloc(), free(), ..
Borland didn't like them,
and neither MS-Visual C++ 6.0 nor gcc (Dev-C++) needs them.
added project files in subdir "win32-vide" for VIDE 1.24
using Borland C++
Builder 5.5 (see http://www.objectcentral.com)
(2002-11-22, HA)
2.4.6 remove memory leak in eftest
allowed re-inclusion of efence.h after inclusion of efenceint.h
added some project files in subdir "win32-devcpp" for Dev-C++ 4.9.6
using gcc (see http://www.bloodshed.net)
and saved its generated makefiles
left tstheap's memory leaks
(2002-11-17, HA)
2.4.5 modifications in print routines (EF_Print, EF_Abort, ..)
added direct output to visual c++ debug output window.
some additions to Makefile
(2002-11-17, HA)
2.4.4 several modifications
seperation of c++ files: efencepp.h, efencepp.cpp
renamed EF_push()/EF_pop() to EF_newFrame()/EF_delFrame()
new compile option "EF_NO_LEAKDETECTION"
new compile option "EF_NO_CPP"
splitted efence.h to efence.h and efenceint.h
added Copyright and License information to many files
renamed COPYING to COPYING-GPL
(2002-11-03, HA)
2.4.3 added following PreProcessor Macros for Release and Debug Mode
#define NEW_ELEM(TYPE) new TYPE
#define NEW_ARRAY(TYPE,COUNT) new (TYPE)[COUNT]
#define DEL_ELEM(PTR) delete PTR
#define DEL_ARRAY(PTR) delete []PTR
which are mapped to malloc() and free() in Debug Mode.
Use these macros to get filename and linenumber of a C++ style
memory leak.
(2002-10-07, HA)
2.4.2 added support for implicit and explicit leak checking:
void EF_push(void) creates a new memory frame.
void EF_pop(void) checks for memory leaks allocated after EF_push().
this function is called automatically onexit(),
even without EF_push().
(2002-10-07, HA)
2.4.1 Port to Windows (NT/2000/XP) by adding sections to following functions:
Page_AllowAccess(), Page_Create(), Page_Delete(),
Page_DenyAccess(), Page_Size()
(2002-10-06, HA)
2.4.0 added support for C++ operators new, new[], delete and delete[].
added some project files in subdir "win32-msvc" for MS-Visual C++ 6.0
(2002-10-03, HA)
2.2.2 Oops. Shared library must be position-independent code.
2.2.0
Merge in bug-fixes, multi-thread patch, shared library patch,
debian/ subdirectory used for building the Debian package
2.0.1
Add work-arounds for kernel and library bugs under HP-UX.
HP has been notified and will repair these soon.
2.0.2
Add support for DEC Alpha. Add %a pattern for printing addresses, which
assumes they are passed in a void *.
2.0.3 30-Sep-1993
When realloc is passed a zero address, it should work the same
way as malloc(). Fix forward declaration of mprotect() in page.c to
use void *, not caddr_t, for addresses. IRIX 5.0.1 complained about that.
2.0.4 29-May-1994
Don't attempt to allow access to a zero-sized page when
EF_ALLOW_MALLOC_0 is set. Attempt to un-map memory from
Page_Delete(). If that doesn't work, fall back by protecting the
page from all references. Un-mapping small segments of a mapping
used to crash my SGI IRIX 5.0 system. I assume that nobody is running
5.0 any longer.
2.0.5 20-January-1995
Port to Linux.
duma-VERSION_2_5_21/COPYING-GPL 0000664 0000000 0000000 00000043076 14012250560 0015556 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C) 19yy
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
duma-VERSION_2_5_21/COPYING-LGPL 0000664 0000000 0000000 00000063474 14012250560 0015676 0 ustar 00root root 0000000 0000000 GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
Copyright (C)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
duma-VERSION_2_5_21/GNUmakefile 0000664 0000000 0000000 00000050215 14012250560 0016146 0 ustar 00root root 0000000 0000000 # DUMA configuration:
#
# add "-DDUMA_NO_GLOBAL_MALLOC_FREE" (without quotes)
# for not defining malloc/free in global namespace
#
# add "-DDUMA_EXPLICIT_INIT" (without quotes)
# to do all the "risky" stuff getenv(), sem_init(), write() .. explicitly
# from main().
# you have to call duma_init() explicitly from main() this option also
# avoids leak error messages for allocations before duma_init() got called.
# this helps for leaky standard environments.
#
# add "-DDUMA_NO_THREAD_SAFETY" (without quotes)
# for not supporting multi-threading
#
# add "-DDUMA_SO_NO_CPP_SUPPORT" or "-DDUMA_LIB_NO_CPP_SUPPORT" (without quotes)
# for not directing new/delete to malloc/free
#
# add "-DDUMA_SO_NO_LEAKDETECTION" or "-DDUMA_LIB_NO_LEAKDETECTION" (without quotes)
# if you don't want support for leak detection
#
# add "-DDUMA_SO_PREFER_ATEXIT" or "-DDUMA_LIB_PREFER_ATEXIT" (without quotes)
# if you prefer atexit() over GNU Compiler's function attribute "destructor"
#
# add "-DDUMA_SO_PREFER_GETENV" or "-DDUMA_LIB_PREFER_GETENV" (without quotes)
# if you prefer standard C library getenv() over global char **environ
#
# add "-DDUMA_OLD_NEW_MACRO" (without quotes)
# if you want to use DUMA's old style NEW_ELEM() / NEW_ARRAY() macros.
# when not defining this option, a standard conform new syntax can get used.
# unfortunately you have to use DEL_ELEM/DEL_ARRAY further to utilize
# filename and linenumber of deallocation calls
#
# add "-DDUMA_SO_NO_HANG_MSG" or "-DDUMA_LIB_NO_HANG_MSG" (without quotes)
# set this if you want to suppress the extra messages around atexit().
#
# add "-DDUMA_NO_STRERROR" (without quotes)
# set this if you want to suppress calls to strerror() to avoid recursion
# on specific platforms.
#
########################################
#
# preprocessor flags for building the shared library (DUMA_SO_LIBRARY):
# - DUMA_SO_NO_CPP_SUPPORT
# - DUMA_SO_NO_LEAKDETECTION
# - DUMA_SO_PREFER_ATEXIT
# - DUMA_SO_PREFER_GETENV
# - DUMA_SO_NO_HANG_MSG
#
# preprocessor flags for building the static library:
# - DUMA_LIB_NO_CPP_SUPPORT
# - DUMA_LIB_NO_LEAKDETECTION
# - DUMA_LIB_PREFER_ATEXIT
# - DUMA_LIB_PREFER_GETENV
# - DUMA_LIB_NO_HANG_MSG
# - DUMA_NO_GLOBAL_MALLOC_FREE
# - DUMA_EXPLICIT_INIT
# - DUMA_NO_THREAD_SAFETY
# - DUMA_OLD_NEW_MACRO
# - DUMA_OLD_DEL_MACRO
# - DUMA_NO_STRERROR
#
########################################
# edit following line
DUMA_OPTIONS=
# no leak detection on any platform:
# use static library for finding leaks - with information memory was allocated
# i think leak-checking without further information is quite useless!
# additionaly too many platforms/environments are broken.
DUMA_OPTIONS += -DDUMA_SO_NO_LEAKDETECTION
# some test cases:
#DUMA_OPTIONS += -DDUMA_LIB_NO_LEAKDETECTION
#DUMA_OPTIONS += -DDUMA_NO_THREAD_SAFETY
#DUMA_OPTIONS += -DDUMA_NO_CPP_SUPPORT
PIC=-fPIC -DPIC
DUMA_SO_OPTIONS=$(PIC) -DDUMA_SO_LIBRARY
# for FreeBSD 5.4
# DUMA_OPTIONS += -DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS
#
# for FreeBSD 5.4 if DUMA_EXPLICIT_INIT is not set
# DUMA_OPTIONS += -DDUMA_NO_LEAKDETECTION
#
# for cygwin environment on Windows
# DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
# also define 'WIN32'
# some defaults:
INSTALL=install
RM=rm
RMFORCE=rm -f
ECHO=echo
ECHOLF=echo .
CC=cc
CXX=c++
LD=ld
AR=ar
RANLIB=ranlib
INSTALL=install
ifndef $(OS)
OS=$(shell uname -s 2>/dev/null | tr '[:upper:]' '[:lower:]' 2>/dev/null || true)
endif
# dynamic dependencies
DUMA_DYN_DEPS=$(DUMASO) tstheap_so$(EXEPOSTFIX) dumatestpp_so$(EXEPOSTFIX)
# some OS specifics:
ifeq ($(OS), windows_nt)
ifeq ($(OSTYPE), msys)
$(info using settings for OS=Windows_NT, OSTYPE=msys)
# call mingw32-make OSTYPE=msys
# from Windows command prompt
# having added the PATH for MINGW/bin
# using explicit initialization to avoid leak report
# from __w32_sharedptr_initialize() function
BSWITCH=101
DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
RM=del
RMFORCE=del /F 2>nul
ECHO=echo
ECHOLF=echo .
CURPATH=
DUMA_DYN_DEPS=
DUMASO=
CFLAGS=-g -O0
CPPFLAGS=-g -O0
LIBS=
EXEPOSTFIX=.exe
endif
ifeq ($(OSTYPE), msys-sh)
$(info using settings for OS=Windows_NT, OSTYPE=msys-sh)
# call mingw32-make OSTYPE=msyssh
# from MSYS shell
# having added the PATH for MINGW/bin
# using explicit initialization to avoid leak report
# from __w32_sharedptr_initialize() function
BSWITCH=102
DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
CC=mingw32-gcc
CXX=mingw32-g++
RM=rm
RMFORCE=rm -f
ECHO=echo
ECHOLF=echo
CURPATH=./
DUMA_DYN_DEPS=
DUMASO=
CFLAGS=-g -O0
CPPFLAGS=-g -O0
LIBS=
EXEPOSTFIX=.exe
endif
ifeq ($(OSTYPE), cygwin)
$(info using settings for OS=Windows_NT, OSTYPE=cygwin)
# call make OSTYPE=cygwin
BSWITCH=103
DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
CURPATH=./
DUMA_DYN_DEPS=
DUMASO=
CFLAGS=-g -O0 -DWIN32 -Wall -Wextra
CPPFLAGS=-g -O0 -DWIN32 -Wall -Wextra
LIBS=
EXEPOSTFIX=.exe
endif
ifndef BSWITCH
$(info using settings for OS=Windows_NT)
BSWITCH=100
DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
CURPATH=./
DUMA_DYN_DEPS=
DUMASO=
CFLAGS=-g -O0 -DWIN32
CPPFLAGS=-g -O0 -DWIN32
LIBS=
EXEPOSTFIX=.exe
endif
endif
ifeq ($(OS), darwin)
$(info using settings for OS=darwin)
# call: make OS=darwin
BSWITCH=210
DUMA_OPTIONS += -DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS
DUMA_OPTIONS += -DDUMA_SO_PREFER_GETENV
# DUMA_OPTIONS += -DDUMA_LIB_NO_LEAKDETECTION
CURPATH=./
# DUMA_DYN_DEPS=
DUMASO=libduma.dylib
DUMASO_LINK1=libduma.dylib
CFLAGS=-g -O0
CPPFLAGS=-g -O0
LIBS=-lpthread
EXEPOSTFIX=
endif
ifeq ($(OS), freebsd)
$(info using settings for OS=freebsd)
BSWITCH=310
DUMA_OPTIONS += -DDUMA_NO_THREAD_SAFETY
DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
CURPATH=./
DUMA_DYN_DEPS=
DUMASO=
DUMASO_LINK1=
CFLAGS=-g -O0
CPPFLAGS=-g -O0
LIBS=-lpthread
EXEPOSTFIX=
endif
ifeq ($(OS), netbsd)
$(info using settings for OS=netbsd)
BSWITCH=320
CURPATH=./
DUMASO=libduma.so.0.0.0
DUMASO_LINK1=libduma.so.0
DUMASO_LINK2=libduma.so
CFLAGS=-g -O0
CPPFLAGS=-g -O0
LIBS=-lpthread
EXEPOSTFIX=
endif
ifeq ($(OS), solaris)
$(info using settings for OS=solaris)
BSWITCH=410
DUMA_OPTIONS += -DDUMA_NO_STRERROR
CURPATH=./
DUMA_DYN_DEPS=
DUMASO=libduma.so.0.0.0
DUMASO_LINK1=libduma.so.0
DUMASO_LINK2=libduma.so
CFLAGS=-g -O0
CPPFLAGS=-g -O0
LDFLAGS += -lgcc_s
LDOPTIONS += -lgcc_s
LIBS=-Wl,-R/opt/sfw/lib -lpthread
EXEPOSTFIX=
endif
ifeq ($(OS), linux)
ifeq ($(shell $(CXX) -v 2>&1 | grep -c "clang version"), 1)
COMPILERX := clang++
else
COMPILERX := g++
endif
export COMPILERX
ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
COMPILER := clang
else
COMPILER := gcc
endif
export COMPILER
CC=${COMPILER}
CXX=${COMPILERX}
$(info using CC=${COMPILER})
$(info using CXX=${COMPILERX})
ifeq ($(OSTYPE), pie)
$(info using settings for OS=linux, OSTYPE=pie)
# Linux PIE-mode with GNU compiler and GNU tools.
CC=${COMPILER} -fpie -fPIE
CXX=${COMPILERX} -fpie -fPIE
BSWITCH=510
else
$(info using settings for OS=linux)
CC=${COMPILER}
CXX=${COMPILERX}
BSWITCH=610
endif
CURPATH=./
DUMASO=libduma.so.0.0.0
DUMASO_LINK1=libduma.so.0
DUMASO_LINK2=libduma.so
CFLAGS=-g -O0 -Wall -Wextra
CPPFLAGS=-g -O0 -Wall -Wextra
LIBS=-lpthread
EXEPOSTFIX=
RM=rm
RMFORCE=rm -f
ECHO=echo
ECHOLF=printf '\n'
endif
ifndef BSWITCH
# default is generic full "UNIX"
BSWITCH=810
$(warning using default options. OS/OSTYPE not set or contain unknown values!)
CURPATH=./
DUMASO=libduma.so.0.0.0
DUMASO_LINK1=libduma.so.0
DUMASO_LINK2=libduma.so
CFLAGS=-g -O0 -Wall -Wextra
CPPFLAGS=-g -O0 -Wall -Wextra
LIBS=-lpthread
EXEPOSTFIX=
endif
ifndef HOST_CFLAGS
HOST_CFLAGS=$(CFLAGS)
endif
ifndef CC_FOR_BUILD
CC_FOR_BUILD=$(CC)
endif
############################################################
ifndef prefix
prefix=/usr
$(info using default prefix [$(prefix)])
endif
MAN_INSTALL_DIR=$(prefix)/share/man/man3
DOC_INSTALL_DIR=$(prefix)/share/doc/duma
ifndef srcdir
srcdir=.
$(info using default srcdir [$(srcdir)])
endif
ifndef exec_prefix
exec_prefix=$(prefix)
$(info using default exec_prefix [$(exec_prefix)])
endif
# The directory for installing executable programs that users can run.
ifndef bindir
bindir=$(exec_prefix)/bin
endif
# The directory for installing read-only architecture independent data files.
ifndef datadir
datadir=$(prefix)/share
endif
# The directory for installing read-only data files that pertain to a single machine--that is to say, files for configuring a host.
ifndef sysconfdir
sysconfdir=$(prefix)/etc
endif
# The directory for object files and libraries of object code.
ifndef libdir
libdir=$(exec_prefix)/lib
endif
# The directory for installing header files to be included by user programs with the C `#include' preprocessor directive.
ifndef includedir
includedir=$(prefix)/include
endif
PACKAGE_SOURCE=README.txt CHANGELOG LICENSE COPYING-GPL COPYING-LGPL duma.3 GNUmakefile gdbinit.rc \
duma.h dumapp.h duma_sem.h paging.h print.h duma_hlp.h noduma.h \
duma.c dumapp.cpp sem_inc.c print.c \
tests/dumatest.c tests/tstheap.c tests/thread-test.c tests/testmt.c tests/dumatestpp.cpp tests/testoperators.cpp \
createconf.c make_git_source_version.sh
OBJECTS=dumapp.o duma.o sem_inc.o print.o
SO_OBJECTS=dumapp_so.o duma_so.o sem_inc_so.o print_so.o
# Make all the top-level targets the makefile knows about.
all: verinfo.h libduma.a $(DUMA_DYN_DEPS)
@ $(ECHO) "Build complete - you can now run make test."
# Perform self tests on the program this makefile builds.
check test: tstheap$(EXEPOSTFIX) dumatest$(EXEPOSTFIX) thread-test$(EXEPOSTFIX) testmt$(EXEPOSTFIX) dumatestpp$(EXEPOSTFIX) testoperators$(EXEPOSTFIX) $(DUMA_DYN_DEPS)
@ $(ECHOLF)
@ $(ECHO) "Testing DUMA (static library):"
$(CURPATH)dumatest$(EXEPOSTFIX)
@ $(ECHOLF)
$(CURPATH)tstheap$(EXEPOSTFIX) 3072
@ $(ECHOLF)
$(CURPATH)testoperators$(EXEPOSTFIX)
@ $(ECHOLF)
@ $(ECHO) "DUMA static confidence test PASSED."
ifdef DUMASO
@ $(ECHOLF)
@ $(ECHO) "Testing DUMA (dynamic library)."
ifeq ($(OS), solaris)
LD_PRELOAD=./$(DUMASO) DYLD_INSERT_LIBRARIES=./$(DUMASO) DYLD_FORCE_FLAT_NAMESPACE=1 exec $(CURPATH)tstheap_so 3072
else
(export LD_PRELOAD=./$(DUMASO); export DYLD_INSERT_LIBRARIES=./$(DUMASO); export DYLD_FORCE_FLAT_NAMESPACE=1 ; exec $(CURPATH)tstheap_so 3072)
endif
@ $(ECHOLF)
@ $(ECHO) "DUMA dynamic confidence test PASSED."
@ $(ECHOLF)
@ $(ECHO) "You may now run make install and then installcheck"
@ $(ECHOLF)
endif
# Perform installation tests (if any).
# The user must build and install the program before running the tests.
installcheck:
ifdef DUMASO
@ $(ECHOLF)
@ $(ECHO) "Testing installed DUMA (dynamic library)."
@ $(bindir)/duma $(CURPATH)tstheap_so 3072
@ $(ECHOLF)
@ $(ECHO) "DUMA installcheck test PASSED."
@ $(ECHOLF)
endif
# Print variables of GNUmakefile
printvars:
@echo OS [$(OS)]
@echo OSTYPE [$(OSTYPE)]
@echo bswitch [$(BSWITCH)]
@echo srcdir [$(srcdir)]
@echo prefix [$(prefix)]
@echo exec_prefix [$(exec_prefix)]
@echo bindir [$(bindir)]
@echo datadir [$(datadir)]
@echo sysconfdir [$(sysconfdir)]
@echo libdir [$(libdir)]
@echo includedir [$(includedir)]
ifneq ($(oldincludedir),)
@echo oldincludedir [$(oldincludedir)]
else
@echo oldincludedir empty
endif
@echo MAN_INSTALL_DIR [$(MAN_INSTALL_DIR)]
@echo DOC_INSTALL_DIR [$(DOC_INSTALL_DIR)]
@echo MAKE [$(MAKE)]
@echo CC [$(CC)]
@echo CFLAGS [$(CFLAGS)]
@echo CXX [$(CXX)]
@echo CPPFLAGS [$(CPPFLAGS)]
@echo LD [$(LD)]
@echo AR [$(AR)]
@echo LIBS [$(LIBS)]
@echo RANLIB [$(RANLIB)]
@echo INSTALL [$(INSTALL)]
@echo RM [$(RM)]
@echo RMFORCE [$(RMFORCE)]
@echo ECHO [$(ECHO)]
@echo ECHOLF [$(ECHOLF)]
@echo PIC [$(PIC)]
@echo EXEPOSTFIX [$(EXEPOSTFIX)]
@echo CURPATH [$(CURPATH)]
@echo DUMA_OPTIONS [$(DUMA_OPTIONS)]
@echo DUMA_SO_OPTIONS [$(DUMA_SO_OPTIONS)]
@echo OBJECTS [$(OBJECTS)]
@echo SO_OBJECTS [$(SO_OBJECTS)]
@echo DUMASO [$(DUMASO)]
@echo DUMASO_LINK1 [$(DUMASO_LINK1)]
@echo DUMASO_LINK2 [$(DUMASO_LINK2)]
@echo DUMA_DYN_DEPS [$(DUMA_DYN_DEPS)]
@echo PACKAGE_SOURCE [$(PACKAGE_SOURCE)]
# Print filenames unknown to git
printuk:
- git status -s --untracked-files=all 2>/dev/null | grep '^? '
# Print filenames known to git but not "up-to-date" (modified)
printmod:
- git status -s 2>/dev/null |grep '^\ \?M '
# Copy the executable file into a directory that users typically search for
# commands; copy any auxiliary files that the executable uses into the
# directories where it will look for them.
install: libduma.a duma.3 $(DUMASO)
- mkdir -p $(DESTDIR)$(DOC_INSTALL_DIR)
$(INSTALL) -m 644 README.txt $(DESTDIR)$(DOC_INSTALL_DIR)
- mkdir -p $(DESTDIR)$(includedir)
$(INSTALL) -m 644 noduma.h duma.h dumapp.h duma_sem.h duma_config.h $(DESTDIR)$(includedir)
- mkdir -p $(DESTDIR)$(bindir)
$(INSTALL) -m 755 duma.sh $(DESTDIR)$(bindir)/duma
- mkdir -p $(DESTDIR)$(libdir)
$(INSTALL) -m 644 libduma.a $(DESTDIR)$(libdir)
ifdef DUMASO
$(INSTALL) -m 755 $(DUMASO) $(DESTDIR)$(libdir)
endif
ifdef DUMASO_LINK1
- $(RMFORCE) $(DESTDIR)$(libdir)/$(DUMASO_LINK1)
ln -s $(DUMASO) $(DESTDIR)$(libdir)/$(DUMASO_LINK1)
endif
ifdef DUMASO_LINK2
- $(RMFORCE) $(DESTDIR)$(libdir)/$(DUMASO_LINK2)
ln -s $(DUMASO) $(DESTDIR)$(libdir)/$(DUMASO_LINK2)
endif
- mkdir -p $(DESTDIR)$(MAN_INSTALL_DIR)
$(INSTALL) -m 644 duma.3 $(DESTDIR)/$(MAN_INSTALL_DIR)/duma.3
# Delete all the installed files that the `install' target would create
uninstall:
- $(RMFORCE) $(DESTDIR)$(DOC_INSTALL_DIR)/README.txt
- $(RMFORCE) $(DESTDIR)$(includedir)/noduma.h
- $(RMFORCE) $(DESTDIR)$(includedir)/duma.h
- $(RMFORCE) $(DESTDIR)$(includedir)/dumapp.h
- $(RMFORCE) $(DESTDIR)$(includedir)/duma_sem.h
- $(RMFORCE) $(DESTDIR)$(includedir)/duma_config.h
- $(RMFORCE) $(DESTDIR)$(bindir)/duma
- $(RMFORCE) $(DESTDIR)$(libdir)/libduma.a
ifdef DUMASO
- $(RMFORCE) $(DESTDIR)$(libdir)/$(DUMASO)
endif
ifdef DUMASO_LINK1
- $(RMFORCE) $(DESTDIR)$(libdir)/$(DUMASO_LINK1)
endif
ifdef DUMASO_LINK2
- $(RMFORCE) $(DESTDIR)$(libdir)/$(DUMASO_LINK2)
endif
- $(RMFORCE) $(DESTDIR)$(MAN_INSTALL_DIR)/duma.3
# Delete all files that are normally created by running make.
clean:
- $(RMFORCE) $(OBJECTS) $(SO_OBJECTS) tstheap.o dumatest.o thread-test.o testmt.o dumatestpp.o \
tstheap_so.o dumatestpp_so.o testoperators.o \
tstheap$(EXEPOSTFIX) tstheap_so$(EXEPOSTFIX) dumatest$(EXEPOSTFIX) dumatestpp$(EXEPOSTFIX) dumatestpp_so$(EXEPOSTFIX) testoperators$(EXEPOSTFIX) \
thread-test$(EXEPOSTFIX) testmt$(EXEPOSTFIX) \
libduma.a $(DUMASO) libduma.cat DUMA.shar
# Any of these targets might be defined to delete more files than `clean' does.
# For example, this would delete configuration files or links that you would
# normally create as preparation for compilation, even if the makefile itself
# cannot create these files.
distclean realclean clobber: clean
- $(RMFORCE) duma_config.h verinfo.h createconf.o createconf$(EXEPOSTFIX)
roff:
nroff -man < duma.3 > duma.cat
DUMA.shar: $(PACKAGE_SOURCE)
shar $(PACKAGE_SOURCE) > DUMA.shar
shar: DUMA.shar
libduma.a: duma_config.h verinfo.h $(OBJECTS)
- $(RMFORCE) libduma.a
$(AR) crv libduma.a $(OBJECTS)
$(RANLIB) libduma.a
verinfo.h: FORCE
- $(CURPATH)make_git_source_version.sh > $(CURPATH)verinfo.h
$(shell touch verinfo.h || true)
duma_config.h:
$(MAKE) reconfig
reconfig: createconf$(EXEPOSTFIX) createconf.o createconf.c
- $(CURPATH)createconf$(EXEPOSTFIX)
dos2unix:
@ dos2unix --d2u $(PACKAGE_SOURCE)
createconf$(EXEPOSTFIX): createconf.o
- $(RMFORCE) createconf$(EXEPOSTFIX)
$(CC_FOR_BUILD) $(HOST_CFLAGS) $(DUMA_OPTIONS) createconf.o -o createconf$(EXEPOSTFIX)
tstheap$(EXEPOSTFIX): libduma.a tstheap.o
- $(RMFORCE) tstheap$(EXEPOSTFIX)
$(CC) $(CFLAGS) tstheap.o libduma.a -o tstheap$(EXEPOSTFIX) $(LIBS)
dumatest$(EXEPOSTFIX): libduma.a dumatest.o
- $(RMFORCE) dumatest$(EXEPOSTFIX)
$(CC) $(CFLAGS) dumatest.o libduma.a -o dumatest$(EXEPOSTFIX) $(LIBS)
dumatestpp$(EXEPOSTFIX): libduma.a dumatestpp.o duma_sem.h dumapp.h
- $(RMFORCE) dumatestpp$(EXEPOSTFIX)
$(CXX) $(CPPFLAGS) dumatestpp.o libduma.a -o dumatestpp$(EXEPOSTFIX) $(LIBS)
thread-test$(EXEPOSTFIX): libduma.a thread-test.o
- $(RMFORCE) thread-test$(EXEPOSTFIX)
$(CC) $(CFLAGS) thread-test.o libduma.a -o thread-test$(EXEPOSTFIX) $(LIBS)
testmt$(EXEPOSTFIX): libduma.a testmt.o
- $(RMFORCE) testmt$(EXEPOSTFIX)
$(CC) $(CFLAGS) testmt.o libduma.a -o testmt$(EXEPOSTFIX) $(LIBS)
testoperators$(EXEPOSTFIX): libduma.a testoperators.o duma_sem.h dumapp.h
- $(RMFORCE) testoperators$(EXEPOSTFIX)
$(CXX) $(CPPFLAGS) testoperators.o libduma.a -o testoperators$(EXEPOSTFIX) $(LIBS)
testmemlimit$(EXEPOSTFIX): libduma.a testmemlimit.o
- $(RMFORCE) testmemlimit$(EXEPOSTFIX)
$(CC) $(CFLAGS) testmemlimit.o libduma.a -o testmemlimit$(EXEPOSTFIX) $(LIBS)
tstheap_so$(EXEPOSTFIX): tstheap_so.o
- $(RMFORCE) tstheap_so$(EXEPOSTFIX)
$(CC) $(CFLAGS) tstheap_so.o -o tstheap_so$(EXEPOSTFIX) $(LIBS)
dumatestpp_so$(EXEPOSTFIX): dumatestpp_so.o
- $(RMFORCE) dumatestpp_so$(EXEPOSTFIX)
$(CXX) $(CPPFLAGS) dumatestpp_so.o -o dumatestpp_so$(EXEPOSTFIX) $(LIBS)
testmemlimit_so$(EXEPOSTFIX): testmemlimit_so.o
- $(RMFORCE) testmemlimit_so$(EXEPOSTFIX)
$(CC) $(CFLAGS) testmemlimit_so.o -o testmemlimit_so$(EXEPOSTFIX) $(LIBS)
$(OBJECTS) tstheap.o dumatest.o thread-test.o testmt.o dumatestpp.o: duma.h
ifeq ($(OS), windows_nt)
# do nothing
else
ifeq ($(OS), darwin)
$(DUMASO): duma_config.h verinfo.h $(SO_OBJECTS)
$(CXX) -g -dynamiclib -Wl -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
$(CXX) -g -dynamiclib -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
else
$(DUMASO): duma_config.h verinfo.h $(SO_OBJECTS)
$(CXX) -g -shared -Wl,-soname,$(DUMASO) -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
# $(CXX) -g -shared -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
endif
endif
#
# define rules how to build objects for createconf
#
createconf.o:
$(CC_FOR_BUILD) $(HOST_CFLAGS) $(DUMA_OPTIONS) -c createconf.c -o $@
#
# define rules how to build objects for shared library
#
dumapp_so.o: dumapp.cpp duma.h duma_sem.h dumapp.h
$(CXX) $(CPPFLAGS) $(DUMA_SO_OPTIONS) -c dumapp.cpp -o $@
duma_so.o: duma.c duma.h duma_config.h verinfo.h
$(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c duma.c -o $@
sem_inc_so.o: sem_inc.c duma_sem.h
$(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c sem_inc.c -o $@
print_so.o: print.c print.h
$(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c print.c -o $@
# DUMA_SO_OPTIONS needed cause duma.h is included explicitly
tstheap_so.o:
$(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c tests/tstheap.c -o $@
dumatestpp_so.o:
$(CXX) $(CPPFLAGS) $(DUMA_SO_OPTIONS) -c tests/dumatestpp.cpp -o $@
testmemlimit_so.o:
$(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c tests/testmemlimit.c -o $@
#
# define rules how to build objects for static library
#
dumapp.o: dumapp.cpp duma.h duma_sem.h dumapp.h
$(CXX) $(CPPFLAGS) -c dumapp.cpp -o $@
duma.o: duma.c duma.h duma_config.h verinfo.h
$(CC) $(CFLAGS) -c duma.c -o $@
sem_inc.o: sem_inc.c duma_sem.h
$(CC) $(CFLAGS) -c sem_inc.c -o $@
print.o: print.c print.h
$(CC) $(CFLAGS) -c print.c -o $@
#
# define rules how to build the test objects
#
dumatest.o: tests/dumatest.c duma.h duma_config.h verinfo.h
$(CC) $(CFLAGS) -c tests/dumatest.c -o $@
dumatestpp.o: tests/dumatestpp.cpp duma.h duma_sem.h dumapp.h duma_config.h verinfo.h
$(CXX) $(CPPFLAGS) -c tests/dumatestpp.cpp -o $@
tstheap.o: tests/tstheap.c duma.h duma_config.h verinfo.h
$(CC) $(CFLAGS) -c tests/tstheap.c -o $@
testoperators.o: tests/testoperators.cpp duma.h duma_sem.h dumapp.h duma_config.h verinfo.h
$(CXX) $(CPPFLAGS) -c tests/testoperators.cpp -o $@
thread-test.o: tests/thread-test.c duma.h duma_config.h verinfo.h
$(CC) $(CFLAGS) -c tests/thread-test.c -o $@
testmt.o: tests/testmt.c duma.h duma_config.h verinfo.h
$(CC) $(CFLAGS) -c tests/testmt.c -o $@
#
# default rules
#
#.c.o:
# $(CC) $(CFLAGS) -c $< -o $@
#
#.cpp.o:
# $(CXX) $(CPPFLAGS) -c $< -o $@
#
.PHONY: check test installcheck install uninstall clean distclean realclean clobber dos2unix printvars printuk printmod FORCE
FORCE:
duma-VERSION_2_5_21/INSTALL 0000664 0000000 0000000 00000005015 14012250560 0015123 0 ustar 00root root 0000000 0000000 This documents describes if and how the library is installed on your system.
I. Linux/Unix environments (including Cygwin and MinGW):
Configure the options by editing the Makefile.
Read carefully the description of options at top of the Makefile.
Take care for the special OS/OSTYPE depending sections.
Especially if you are going to use the LD_PRELOAD mechanism.
Call GNU make often called 'gmake' for building the library.
GNU make is called 'mingw32-make' for MinGW.
Add option 'OSTYPE=msys' when calling make for MinGW from command prompt
Add option 'OSTYPE=msys-sh' when calling make for MinGW from shell prompt
Add option 'OSTYPE=cygwin' when calling make for Cygwin.
Add option 'OS=osx' when calling make for MacOS X or Darwin.
Add option 'OS=freebsd' when calling make for FreeBSD.
Add option 'OS=netbsd' when calling make for NetBSD.
Add option 'OS=solaris' when calling make for Solaris.
Add option 'OS=linux' when calling make for Linux.
Get system user with 'su' or 'sudo', if you are going
to install into system directories
Call 'make' or 'gmake install' to install into system directories.
Note: You need not install DUMA. Setting system PATH for duma.sh
or INCLUDE/LIBS variables after compilation may suffice, too.
The (outdated) manual page should be installed as well.
II. Windows 2000/XP, Visual Studio Environments:
Compile and run 'createconf', that generates the file duma_config.h.
Compile 'dumalib' and set the directories 'INCLUDE' and 'LIBS'
in your environment or project.
III. Solaris Environment:
Add the location(s) of the GNU Toolchain (gmake, gcc, ar, ..) to the PATH:
On my Solaris 10 installation with the Companion CD it is:
/opt/sfw/bin and /opt/sfw/lib/bin
Also notice that the Makefile has to contain some special settings so that
the compiled executable can dynmically find and link to libstdc++. Have a
look at the solaris section in DUMA's Makefile.
IV. FreeBSD Environment:
At least on my FreeBSD-6.2 installation i have to set the shell environment
variable with 'export DUMA_DISABLE_BANNER=1' before running any programs
linked with libduma.a. There seems to be an initialization problem with
the pthreads library.
V. NetBSD Environment:
At least on my NetBSD-3.1 (HOSTTYPE=i386; OSTYPE=netbsdelf) installation
i always get exactly one memory leak. I've not tested to install.
Hayati Ayguen
15 September 2005,
updated 31 July 2007
updated 11 August 2007
updated 18 August 2007
updated 28 August 2007
updated 17 March 2009
duma-VERSION_2_5_21/LICENSE 0000664 0000000 0000000 00000126710 14012250560 0015105 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C) 19yy
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
-------------------------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
Copyright (C)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
duma-VERSION_2_5_21/README.md 0000664 0000000 0000000 00000017330 14012250560 0015354 0 ustar 00root root 0000000 0000000 # **D.U.M.A.**
---
[](https://app.codacy.com/gh/johnsonjh/duma?utm_source=github.com&utm_medium=referral&utm_content=johnsonjh/duma&utm_campaign=Badge_Grade)
[](https://github.com/johnsonjh/duma/blob/master/COPYING-GPL)
[](https://github.com/johnsonjh/duma/blob/master/COPYING-LGPL)
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fjohnsonjh%2Fduma?ref=badge_shield)
[](https://github.com/XAMPPRocky/tokei)
[](https://github.com/johnsonjh/OldCurve25519ScalarMult)
[](https://github.com/johnsonjh/duma/releases/)
[](https://lgtm.com/projects/g/johnsonjh/duma/alerts/)
[](https://app.codacy.com/gh/johnsonjh/duma?utm_source=github.com&utm_medium=referral&utm_content=johnsonjh/duma&utm_campaign=Badge_Grade)
[](https://codebeat.co/projects/github-com-johnsonjh-duma-master)
[](https://deepscan.io/dashboard#view=project&tid=12184&pid=15170&bid=299583)
[](https://deepsource.io/gh/johnsonjh/duma/?ref=repository-badge)
[](https://www.tickgit.com/browse?repo=github.com/johnsonjh/duma)
---
## **Detect Unintended Memory Access**
---
### **_A Red-Zone memory allocator_**
---
#### Introduction
After deciding it was important to revive D.U.M.A., it quickly became clear
continued use of the `cvs` version control system would be a limiting factor to
the success of a new D.U.M.A. distribution. If the project was going to survive
in the long-term, it would be necessary to perform a full conversion to a more
modern, commonly used, and accessible VCS system.
Unaware of the efforts of the
[original author](https://github.com/hayguen/duma), I created this repository
independently, and expended much effort to identify all contributors and authors
of the many patches and contributions that had been produced by the community
over many years. After many false starts, I'm now mostly satisfied with the end
result - especially considering that many of my conclusions turned out to be
very close (and sometimes identical) to those made in the original author's own
conversion efforts. It should be noted that I had no special knowledge of this
software, besides being a user, and no relationship or even any previous contact
with the author.
The most time consuming part of the conversion process was determining all the
non-canonical changes, figuring out who actually wrote them, and finally
deciding if these patches should be incorporated into a new official "mainline"
repository.
This process required more than a few "educated guesses", and, when the
necessary details were not available, simple judgment calls. With such an old,
widely distributed, and hacked-upon code-base, which survived as long as it did,
without an official maintainer or source for new releases for many years, much
of data available is fragmentary and conflicting. Sometimes, the only sources of
information are the often fading memories of those originally involved with
project. Often, inferences had to be made, usually based on incomplete and
inaccurate information.
Because of these uncertainties, I am certain that mistakes have been made and
new errors introduced. I welcome any contributions from the public that would
help to make the repository more historically accurate as well as improve
functionality.
---
#### The Future of D.U.M.A.
A large task, not yet complete, is reconciling this reconstruction against the
last version which was released by the
[original author](https://github.com/hayguen/duma). The intention is to focus on
correctly identifying any significant deviations, especially in regardings to
the identification of contributors, and ensuring that any disputes that might
arise are fairly handled. As new information becomes available, the commit logs
for the project will be updated to provide an accurate record for posterity.
The structure of this conversion very closely resembles that of the original
`cvs` repository. In contrast, the orignal author's conversion efforts included
a radical refactoring the source tree and directory structures. I believe that
this was a prudent decision, and eventually plan to incorporate similar
restructuring in this repository.
While every attempt was been made to ensure correctness, especially when
acknowledging contributors, extracting information where available from the
original SourceForge site, random web forums, other `cvs`, `svn`, and, `git`
repositories, and mailing lists archives, this release does incorporate changes
that were never part of the original work, mostly to ensure compatability with
modern systems operating systems and environments.
---
#### Official D.U.M.A.?
This repository should be considered the "official" source for D.U.M.A.
releases.
Hayati Ayguen, the original author, is no longer actively maintaining D.U.M.A.
and has moved on to other projects. While he was happy to correspond about the
project, it seems unlikely that he will take on the role of primary maintainer
of the package.
---
#### History
D.U.M.A. started out as a fork of Bruce Perens' venerable "Electric Fence", a
tool created at Pixar, back in 1987.
D.U.M.A. was ported to Linux as early as 1992.
---
#### Conclusion
Now, almost 30 years later, we thank to Hayati Ayguen and all other
contributors, who put time and effort into this project, but allow them move on
to other endeavours. They can do so knowing that D.U.M.A. is not gone or
forgotten. Even though it is a mature software and package, it will be properly
maintained and updated as needed.
---
#### Addendum
For some additional information on the history of D.U.M.A. and Electric Fence,
see , for
short blog entry by Bruce Perens' mentioning the creation of his Electric Fence
tool.
The orginal author, [Hayati Ayguen](https://github.com/hayguen), remains an
active developer.
---
#### Availability
##### Source Code (Releases)
- [GitHub Releases](https://github.com/johnsonjh/duma/releases/)
##### Source Code (Development Repositories)
- [SourceHut Git](https://git.sr.ht/~trn/duma)
- [GitHub](https://github.com/johnsonjh/duma)
---
#### Issue Tracking
- [GitLab Issue Tracker](https://github.com/johnsonjh/duma/issues)
---
#### Security Policy
- [Security Policy and Vulnerability Reporting](https://github.com/johnsonjh/duma/SECURITY.md)
---
#### License
- [GNU General Public License v2.0 (GPLv2)](https://tldrlegal.com/license/gnu-general-public-license-v2)
- [GNU Lesser General Public License v2.1 (LGPLv2.1)]()
- [](https://app.fossa.com/projects/git%2Bgithub.com%2Fjohnsonjh%2Fduma?ref=badge_small)
---
duma-VERSION_2_5_21/README.txt 0000664 0000000 0000000 00000076043 14012250560 0015601 0 ustar 00root root 0000000 0000000 D.U.M.A. - Detect Unintended Memory Access - A Red-Zone memory allocator:
DESCRIPTION:
DUMA helps you detect two of the most common programming errors:
1. software that overruns the boundaries of a malloc() memory allocation,
2. software that touches memory allocations already released by free().
Unlike other malloc() debuggers, DUMA will detect read accesses as well as
writes, and it will pinpoint the exact instruction that causes an error.
It has been in use at Pixar since 1987, and at many other sites for years.
DUMA uses the virtual memory hardware of your computer to place an inaccessible
memory page immediately after (or before, at the user's option) each memory
allocation. When software reads or writes this inaccessible page, the hardware
issues a segmentation fault, stopping the program at the offending instruction.
It is then trivial to find the erroneous statement using your favorite
debugger. In a similar manner, memory that has been released by free() is made
inaccessible, and any code that touches it will get a segmentation fault.
Simply linking your application with libduma.a will allow you to detect most,
but not all, malloc buffer overruns and accesses of free memory. If you want
to be reasonably sure that you've found all bugs of this type, you'll have to
read and understand the rest of this man page.
USAGE:
Link your program with the library libduma.a. Make sure you are not linking
with '-lmalloc', '-lmallocdebug', or with other malloc-debugger or
malloc-enhancer libraries. You can only use one at a time.
If your system administrator has installed DUMA for public use, you'll be able
to use the '-lduma' argument to the linker, otherwise you'll have to put the
path-name for libduma.a in the linker's command line.
You can also use dynamic linking. If you're using a Bourne shell, the statement
'export LD_PRELOAD=libduma.so.0.0' will cause DUMA to be loaded to run all
dynamic executables.
The command 'duma.sh ' runs a single command under DUMA.
Some systems will require special arguments to the linker to assure that you
are using the DUMA malloc() and not the one from your C library.
Run your program using a debugger. It's easier to work this way than to create
a core file and post-mortem debug it. DUMA can create huge core files, and some
operating systems will thus take minutes simply to dump core! Some operating
systems will not create usable core files from programs that are linked with
DUMA.
If your program has one of the errors detected by DUMA, it will get a
segmentation fault (SIGSEGV) at the offending instruction. Use the debugger to
locate the erroneous statement, and repair it.
GLOBAL AND ENVIRONMENT VARIABLES:
DUMA has several configuration switches that can be enabled via
the shell environment. These switches change what bugs DUMA will detect,
so it's important that you know how to use them.
In older versions of DUMA you could set the value of
global integer variables (using a debugger). In actual DUMA versions most
of the global variables don't exist any more: they changed to thread local
variables defined in structures. Instead you can call macro function to set
some variables - but not from debugger!
You can use the gdb command 'set environment variable value' to set shell
environment variables only for the program you are going to debug. This is
useful especially if you are using the shared DUMA library.
DUMA_ALIGNMENT - This is an integer that specifies the alignment for any memory
allocations that will be returned by malloc(), calloc(), and realloc().
The value is specified in bytes, thus a value of 4 will cause memory to be
aligned to 32-bit boundaries unless your system doesn't have a 8-bit
characters. DUMA_ALIGNMENT is set to the minimum required alignment specific
to your environment by default. The minimum required alignment is detected by
createconf and stored in the file duma_config.h.
If your program requires that allocations be aligned to 64-bit boundaries
you'll have to set this value to 8. This is the case when compiling with the
'-mips2' flag on MIPS-based systems such as those from SGI. For some
architectures the default is defined to even more - x86_64 uses alignment to
16 bytes by default.
DUMA internally uses a smaller value if the requested memory size is smaller
than the alignment value: the next smaller power of 2 is used.
Thus allocating blocks smaller than DUMA_ALIGNMENT may result into smaller
alignments - for example when allocating 3 bytes, they would be aligned to 2
byte boundary. This allows better detection of overrun.
For this reason, you will sometimes want to set DUMA_ALIGNMENT to 1 (no
alignment), so that you can detect overruns of less than your CPU's word
size. Be sure to read the section 'WORD-ALIGNMENT AND OVERRUN DETECTION' in
this manual page before you try this.
To change this value, set DUMA_ALIGNMENT in the shell environment to an
integer value, or call the macro function DUMA_SET_ALIGNMENT() from your
code.
You don't need to change this setting, if you just need bigger alignment for
some special buffers. In this case you may use the function
memalign(alignment, userSize).
DUMA_PROTECT_BELOW - DUMA usually places an inaccessible page immediately after
each memory allocation, so that software that runs past the end of the
allocation will be detected. Setting DUMA_PROTECT_BELOW to 1 causes DUMA to
place the inaccessible page before the allocation in the address space, so
that under-runs will be detected instead of over-runs.
To change this value, set DUMA_PROTECT_BELOW in the shell environment to an
integer value, or call the macro function DUMA_SET_PROTECT_BELOW() from your
code.
DUMA_SKIPCOUNT_INIT - DUMA usually does its initialization with the first
memory allocation. On some systems this may collide with initialization of
pthreads or other libaries and produce a hang. To get DUMA work even in these
situations you can control (with this environment variable) after how many
allocations the full internal initialization of DUMA is done. Default is 0.
DUMA_REPORT_ALL_LEAKS - DUMA usually reports only memory leaks where the source
filename with line number of the allocating instruction is known. Setting this
variable to 1 in shell environment reports all memory leaks.
The default is 0 to avoid reporting of irrelevant memory leaks from
system/compiler environment: there are many standard libraries leaking memory,
which by default is no real problem as the system frees up all memory on
program exit.
DUMA_FILL - When set to a value between 0 and 255, every byte of allocated
memory is initialized to that value. This can help detect reads of
uninitialized memory. When set to -1, DUMA does not initialise memory on
allocation. But some memory is filled with zeroes (the operating system
default on most systems) and some memory will retain the values written to
it during its last use.
Per default DUMA will initialise all allocated bytes to 255 (=0xFF).
To change this value, set DUMA_FILL in the shell environment to an
integer value, or call the macro function DUMA_SET_FILL() from your
code.
DUMA_SLACKFILL - As DUMA internally allocates memory in whole pages, there
retains an unused and unprotectable piece of memory: the slack or no mans
land. Per default DUMA will initialise this area to 170 (=0xAA), which
is 10101010 in binary representation.
To change this value, set DUMA_SLACKFILL in the shell environment to an
integer value.
DUMA automatically checks this area, the no mans land, at deallocation.
You can manually induce a check with the macro function DUMA_CHECK() for
one memory block. With the macro function DUMA_CHECKALL() all memory blocks
get checked.
DUMA_CHECK_FREQ - First see DUMA_SLACKFILL above for definition of no mans
land. Checking the integrity of the no mans land costs performance. This is
why this is usually done only at deallocation of a memory block. Set this
variable to let DUMA check all memory blocks no mans land every .th
allocation or deallocation. Set this variable to 1, to let DUMA check at
each allocation and deallocation.
Per default the value 0 is used, which means to check only at deallocation.
DUMA_ALLOW_MALLOC_0 - Memory allocation of size zero is ANSI conform. But
often this is the result of a software bug. For this reason DUMA may trap
such calls to malloc() with size zero. I leave this option disabled by
default, but you are free to trap these calls setting the DUMA_ALLOC_MALLOC_0
in the shell environment to an integer value.
DUMA_MALLOC_0_STRATEGY - This environment variable controls DUMA's behaviour
on malloc(0):
0 - like having former ALLOW_MALLOC_0 = 0 ==> abort program with segfault
1 - return NULL pointer
2 - return always the same pointer to some protected page
3 - return mid address of a unique protected page (=default)
ATTENTION: only 1 and 3 are ANSI conform. But value 1 will break most
programs, cause value 3 strategy most system libraries use/implement.
All returned pointers can be passed to free().
DUMA_NEW_0_STRATEGY - This environment variable controls DUMA's behaviour
on C++ operator new with size zero:
2 - return always the same pointer to some protected page
3 - return mid address of a unique protected page (=default)
ATTENTION: only 3 is standard conform. Value 2 may break some but will
work for most programs. With value 2 you may reduce the memory consumption.
DUMA_MALLOC_FAILEXIT - Many programs do not check for allocation failure. This
often leads to delayed errors, no more understandable. Set this variable to a
positive integer in the shell environment to exit the program immediately
when memory allocation fails. This option is set by default.
DUMA_PROTECT_FREE - DUMA usually returns free memory to a pool from which it
may be re-allocated. If you suspect that a program may be touching free
memory, set DUMA_PROTECT_FREE shell environment to -1. This is the default
and will cause DUMA not to re-allocate any memory.
For programs with many allocations and deallocations this may lead to the
consumption of the full address space and thus to the failure of malloc().
To avoid such failures you may limit the amount of protected deallocated
memory by setting DUMA_PROTECT_FREE to a positive value. This value in kB
will be the limit for such protected free memory.
A value of 0 will disable protection of freed memory.
DUMA_MAX_ALLOC - This shell environment variable limits the total memory print
of a program. This is another way to indirectly limit the sum of freed
protected memory (see DUMA_PROTECT_FREE). By default there is no limit (=-1).
A positive value is interpreted in kB, which stands for the sum of allocated
and freed protected memory.
DUMA_FREE_ACCESS - This is a debugging enhancer to catch deallocation of a
memory block using watch expressions. DUMA does a write access to the first
byte, which may lead a debugger to stop on a watch expression. You have to
enable this by setting the shell environment variable to non zero.
Default is disabled.
DUMA_SHOW_ALLOC - Set this shell environment variable to non-zero to let DUMA
print all allocations and deallocations to the console. Although this
generates a lot of messages, this option can be useful to detect inefficient
code containing many (de)allocations. This is switched off by default.
DUMA_SUPPRESS_ATEXIT - Set this shell environment variable to non-zero when
DUMA should skip the installation of its exit handler. The exit handler is
called at the end of the main program and checks for memory leaks, so the
handler's installation should *usually* not be suppressed. One reason for
doing so regardless are some buggy environments, where calls to the standard
C library's atexit()-function hangs.
DUMA_DISABLE_BANNER - Set this shell environment variable to non-zero to
suppress the usual startup message on console. Default is 0.
DUMA_OUTPUT_DEBUG - Set this shell environment variable to non-zero to output
all DUMA messages to the debugging console. This option is only available
on Windows and is off by default.
DUMA_OUTPUT_STDOUT - Set this shell environment variable to non-zero to output
all DUMA messages to STDOUT. This option is off by default.
DUMA_OUTPUT_STDERR - Set this shell environment variable to non-zero to output
all DUMA messages to STDERR. This option is on by default.
DUMA_OUTPUT_FILE - Set this shell environment variable to a filename where all
DUMA messages should be written to. This option is off by default.
DUMA_OUTPUT_STACKTRACE - Set this shell environment variable to non-zero to
output a stacktrace of the allocation that is not free'd. This option is
available only on Windows and is off by default. This option also requires a map
file generated by the linker.
DUMA_OUTPUT_STACKTRACE_MAPFILE - Set this shell environment variable to the map
file, when it isn't found. This is very useful when using detours version of
DUMA. This option is available only on Windows.
DUMA_MEMCPY_OVERLAP - Set this shell environment variable to allow overlapping
of memcpy regions if the destination address is less than source address.
(workaround for ARM port memmove/memcpy implementation).
WORD-ALIGNMENT AND OVERRUN DETECTION:
There is a conflict between the alignment restrictions that malloc() operates
under and the debugging strategy used by DUMA. When detecting overruns, DUMA
malloc() allocates two or more virtual memory pages for each allocation. The
last page is made inaccessible in such a way that any read, write, or execute
access will cause a segmentation fault. Then, DUMA malloc() will return an
address such that the first byte after the end of the allocation is on the
inaccessible page. Thus, any overrun of the allocation will cause a
segmentation fault.
It follows that the address returned by malloc() is the address of the
inaccessible page minus the size of the memory allocation. Unfortunately,
malloc() is required to return word-aligned allocations, since many CPUs can
only access a word when its address is aligned. The conflict happens when
software makes a memory allocation using a size that is not a multiple of the
word size, and expects to do word accesses to that allocation. The location of
the inaccessible page is fixed by hardware at a word-aligned address. If DUMA
malloc() is to return an aligned address, it must increase the size of the
allocation to a multiple of the word size.
In addition, the functions memalign() and valloc() must honor explicit
specifications on the alignment of the memory allocation, and this, as well can
only be implemented by increasing the size of the allocation. Thus, there will
be situations in which the end of a memory allocation contains some padding
space, and accesses of that padding space will not be detected, even if they
are overruns.
DUMA provides the variable DUMA_ALIGNMENT so that the user can control the
default alignment used by malloc(), calloc(), and realloc(). To debug overruns
as small as a single byte, you can set DUMA_ALIGNMENT to one. This will result
in DUMA malloc() returning unaligned addresses for allocations with sizes that
are not a multiple of the word size. This is not a problem in most cases,
because compilers must pad the size of objects so that alignment restrictions
are honored when storing those objects in arrays. The problem surfaces when
software allocates odd-sized buffers for objects that must be word-aligned. One
case of this is software that allocates a buffer to contain a structure and a
string, and the string has an odd size (this example was in a popular TIFF
library). If word references are made to un-aligned buffers, you will see a bus
error (SIGBUS) instead of a segmentation fault. The only way to fix this is to
re-write the offending code to make byte references or not make odd-sized
allocations, or to set DUMA_ALIGNMENT to the word size.
Another example of software incompatible with DUMA_ALIGNMENT < word-size
is the strcmp() function and other string functions on SunOS (and probably
Solaris), which make word-sized accesses to character strings, and may attempt
to access up to three bytes beyond the end of a string. These result in a
segmentation fault (SIGSEGV). The only way around this is to use versions of
the string functions that perform byte references instead of word references.
CATCHING THE ERRONEOUS LINE:
To get the line in your sources, where an error occurs, go as following:
1. Compile your program with debugging information
and statically linked to DUMA.
2. Start your program from debugger f.e. with 'gdb '
3. Set program environment variables like 'set environment DUMA_PROTECT_BELOW 1'
4. set your program arguments with 'set args ..'
5. Run and wait for the segmentation fault
alternatively
1. Compile your program (with debugging information) without DUMA.
2. Set 'ulimit -c unlimited' to get core files
3. Start your program, choose one of following options
a) Start your program (linked statically with DUMA)
b) Start your program with duma.sh
4. Wait for a segmentation fault. this should have created a core[.]
file. You can get into a debugger f.e. with 'gdb -c '
INSTRUCTIONS FOR DEBUGGING YOUR PROGRAM:
1. Link with libduma.a as explained above.
2. Run your program in a debugger and fix any overruns or accesses
to free memory.
3. Quit the debugger.
4. Set DUMA_PROTECT_BELOW = 1 in the shell environment.
5. Repeat step 2, this time repairing underruns if they occur.
6. Quit the debugger.
7. Read the restrictions in the section on
alternatively
read and install gdbinit.rc as ~/.gdbinit
if you are using a GNU gdb based debugger
WORD-ALIGNMENT AND OVERRUN DETECTION:
See if you can set DUMA_ALIGNMENT to 1 and repeat step 2. Sometimes this will
be too much work, or there will be problems with library routines for which you
don't have the source, that will prevent you from doing this.
MEMORY USAGE AND EXECUTION SPEED:
Since DUMA uses at least two virtual memory pages for each of its allocations,
it's a terrible memory hog. I've sometimes found it necessary to add a swap
file using swapon(8) so that the system would have enough virtual memory to
debug my program. Also, the way we manipulate memory results in various cache
and translation buffer entries being flushed with each call to malloc or free.
The end result is that your program will be much slower and use more resources
while you are debugging it with DUMA.
The Linux kernel also limits the number of different page mappings per process.
Have a look for
/proc/sys/vm/max_map_count
f.e. under
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/en-US/Reference_Guide/s3-proc-sys-vm.html
You may have to increase this value to allow debugging with DUMA with a
command like:
"sudo sysctl -w vm.max_map_count=1000000"
Don't leave libduma.a linked into production software! Use it only for
debugging. See section 'COMPILATION NOTES FOR RELEASE/PRODUCTION' below.
MEMORY LEAK DETECTION:
All memory allocation is protocoled from DUMA together with the filename and
linenumber of the calling function. The atexit() function checks if each
allocated memory block was freed. To disable leak detection add the
preprocessor definition 'DUMA_SO_NO_LEAKDETECTION' or
'DUMA_LIB_NO_LEAKDETECTION' to DUMA_OPTIONS in Makefile.
If a leak is reported without source filename and line number but is
reproducible with the same pointer, set a conditional breakpoint on the
function 'void * duma_alloc_return( void * address)'
f.e. with gdb command 'break duma_alloc_return if address==0x123'
C++ MEMORY OPERATORS AND LEAK DETECTION:
Macros for "new" and "delete" are defined in dumapp.h. These macros give
filename and linenumber of the calling functions to DUMA, thus allowing the
same leak detection reports as for malloc and free. 'dumapp.h' needs to be
included from your source file(s).
For disabling the C++ new/delete/new[] and delete[] operators, add the
preprocessor definition 'DUMA_NO_CPP_SUPPORT' to DUMA_OPTIONS in Makefile.
DEFINITION OF OWN MEMBER NEW/DELETE OPERATORS:
Definition of own member new/delete operators for a class will fail cause the
new/delete keywords are defined as macros from DUMA. You will have to undefine
DUMA's macros with following line:
:#include "noduma.h"
Then you have to call DUMA's operators directly inside your own definition.
For using DUMA's C++ operators without having the preprocessor macros defined,
following syntax can be used:
(start code)
// const char * file or __FILE__ macro
// int line or __LINE__ macro
ptr = new(file,line) type; // scalar new throwing bad_alloc() on error
ptr = new(std::nothrow,file,line) type; // scalar new returning 0 on error
operator delete(ptr,file,line); // scalar delete
ptr = new(file,line) type[n]; // vector new throwing bad_alloc() on error
ptr = new(std::nothrow,file,line) type[n]; // vector new returning 0 on error
operator delete[](ptr, file,line); // vector delete
(end code)
The default syntax without file/line info can be used, too.
PREPACKAGED RPM FILES FOR REDHAT & CO:
You can download prepackaged .rpm files for RedHat, Fedora Core and similar
systems from
http://dries.ulyssis.org/apt/packages/duma/info.html
Dries Verachtert wrote the .spec file.
COMPILATION NOTES FOR VISUAL C++:
Here some Compilation Notes for your Application in Debug Mode
for the Microsoft Visual C++ (v6) Compiler:
1) Don't use Program Database for "Edit and Continue":
Project-Options -> C++ -> General -> Debug-Info
2) Don't use the "multithreaded-dll" runtime library:
Project-Options -> C++ -> Code Generation -> Runtime library
3) Switch off incremental linking
Project-Options -> Linker -> General
4) Switch off precompiled headers:
Project-Options -> C++ -> Precompiled Headers
5) Add following Linker option "/FORCE:MULTIPLE"
Project-Options -> Linker -> General
The labels may differ a bit cause i'm using the german version:
Options in german language:
1) Projekteinstellungen -> C++ -> Kategorie =Allgemein
-> Debug-Info =Programmdatenbank
2) Projekteinstellungen -> C++ -> Kategorie =Codegeneration
-> Laufzeitbibliothek anpassen (Release/Debug),
nicht die DLL-Variante verwenden
3) Projekteinstellungen -> Linker -> Kategorie =Allgemein
- Inkrementelles Binden =Aus
4) Projekteinstellungen -> Linker -> Projekt Optionen
"/FORCE:MULTIPLE" unten eingeben
Now everything you have to do is to set a dependency to "duma" from your
application.
COMPILATION NOTES FOR RELEASE/PRODUCTION:
Set the preprocessor definition
#define DUMA_NO_DUMA
in your Makefiles to disable DUMA usage and don't link with DUMA library.
With DUMA_NO_DUMA-definition all DUMA macro functions get defined but do
nothing. This way you don't have to change your code for release compilation
even when using special DUMA macros.
WARNINGS:
I have tried to do as good a job as I can on this software, but I doubt that it
is even theoretically possible to make it bug-free. This software has no
warranty. It will not detect some bugs that you might expect it to detect, and
will indicate that some non-bugs are bugs.
FILES:
/dev/zero: Source of memory pages (via mmap(2)).
SEE ALSO:
malloc(3), mmap(2), mprotect(2), swapon(8)
DIAGNOSTICS:
Segmentation Fault: Examine the offending statement for violation of the
boundaries of a memory allocation.
Bus Error: See the section on WORD-ALIGNMENT AND OVERRUN DETECTION in this
manual page.
BUGS:
My explanation of the alignment issue could be improved.
Some Sun systems running SunOS 4.1 were reported to signal an access to a
protected page with 'SIGBUS' rather than 'SIGSEGV', I suspect this is an
undocumented feature of a particular Sun hardware version, not just the
operating system. On these systems, dumatest will fail with a bus error until
you modify the Makefile to define PAGE_PROTECTION_VIOLATED_SIGNAL as SIGBUS.
There are, without doubt, other bugs and porting issues. Please contact me via
e-mail if you have any bug reports, ideas, etc.
OTHER ALTERNATIVE/ADDITIONAL DEBUGGING SOFTWARE/TOOLS:
GCC
option -Warray-bounds up from gcc 4.3
options -fmudflap -fmudflapth -fmudflapir up from gcc 4.0
See http://gcc.gnu.org/
See http://gcc.gnu.org/wiki/Mudflap_Pointer_Debugging
IBM Stack Smashing Protector aka Pro Police
it is a GCC (Gnu Compiler Collection) extension for protecting applications
from stack-smashing attacks. Applications written in C will be protected by
the method that automatically inserts protection code into an application at
compilation time. The protection is realized by buffer overflow detection and
the variable reordering feature to avoid the corruption of pointers. The basic
idea of buffer overflow detection comes from StackGuard system.
See http://www.trl.ibm.com/projects/security/ssp/
Checkergcc
a modified version of the GNU C Compiler that instruments all memory
references, is available on Linux systems and where GCC is used. It performs
some of the same tasks as Purify, but only on code that it has compiled.
Valgrind
Valgrind is an award-winning suite of tools for debugging and profiling Linux
programs. With the tools that come with Valgrind, you can automatically detect
many memory management and threading bugs, avoiding hours of frustrating
bug-hunting, making your programs more stable. You can also perform detailed
profiling, to speed up and reduce memory use of your programs.
The Valgrind distribution currently includes four tools: a memory error
detector, a cache (time) profiler, a call-graph profiler, and a heap (space)
profiler. It runs on the following platforms: X86/Linux, AMD64/Linux,
PPC32/Linux, PPC64/Linux.
See http://valgrind.org/
Pageheap.exe
Another alternative to using duma on Windows (XP, 2000, Server 2003) is to use
the built in heap debugging provided by Microsoft. It's not as feature rich as
duma, but for complex projects were duma is causing issues it will work with less
hassle (it sits in the heap manager itself).
You can control it using the global flags (gflags) utility that comes with windbg.
You can enable it by saying: gflags.exe /p /full /enable MyProgram.exe
And do unaligned by saying: gflags.exe /p /full /unaligned /enable MyProgram.exe
gflags will set specific registry keys to enable the pageheap debugging on the
executable. You can disable it using the "/disable" flag.
See http://support.microsoft.com/kb/286470
MPATROL
The mpatrol library is a powerful debugging tool that attempts to diagnose
run-time errors that are caused by the wrong use of dynamically allocated
memory. It acts as a malloc() debugger for debugging dynamic memory
allocations, although it can also trace and profile calls to malloc()
and free() too.
See http://www.cbmamiga.demon.co.uk/mpatrol/
Purify
does a much more thorough job than DUMA, and does not have the huge memory
overhead.
LibSafe
protects Critical Elements of Stack.
See http://www.research.avayalabs.com/
DieHard
helps buggy programs run correctly and protects them from a range of security
vulnerabilities.
See http://www.diehard-software.org/
electric-fence-win32
another Win32 port of Electric Fence.
See http://code.google.com/p/electric-fence-win32/
FURTHER READING:
Hunting Memory Bugs
http://www.edm2.com/0508/membug.html
An OS/2 Allocator for the STL
http://www.edm2.com/0508/stl.html
Wikipedia
http://en.wikipedia.org/wiki/Memory_debugger
CONTACTING THE AUTHOR:
Hayati Ayguen
Michael Eddington
http://duma.sf.net
FILES IN PACKAGE:
SubDirectories:
---------------
win32-vide/* project files for VIDE 1.24 (see http://www.objectcentral.com)
using the Borland C++ Builder 5.5 compiler
(FreeCommandLineTools, see http://www.borland.com)
win32-devcpp/* project files for Dev-C++ 4.9.6 (see http://www.bloodshed.net)
using the gcc compiler (see http://gcc.gnu.org)
win32-msvc/* projects files for Microsoft Visual C++ 6.0 IDE/compiler
(see http://www.microsoft.com)
debian/* don't know; maybe some files for the Debian Linux distribution?
Projects:
---------
dumalib DUMA library. this library should be linked with YOUR program
dumatest first small test program
tstheap second small test program
Files:
------
COPYING-* License files; reade carefully!
README this text file
CHANGES text file listing done CHANGES
duma.h belongs to dumalib
this header file should be included from within YOUR C source
dumapp.h belongs to dumalib
this header file should be included from within YOUR C++ source
duma.c belongs to dumalib
contains malloc/free/.. functions
dumapp.cpp belongs to dumalib
contains C++ new/delete/.. functions redirecting them
to ANSI C malloc/free
page.c belongs to dumalib
library internal source file: contains paging functions
print.c belongs to dumalib; library internal source file: contains
printing/aborting functions
dumatest.c belongs to dumatest
small test program; checks wether dumalib's paging does its job
should work without any errors
tstheap.c belongs to tstheap
small test program; checks wether dumalib's heap does its job
should report many memory leaks after execution.
Makefile Makefile for UNIX/Linux/..
duma.3 source for UNIX man page
duma.sh script for UNIX/Linux to start other programs using the
LD_PRELOAD mechanism
LICENSE:
Copyright (C) 2006 Michael Eddington
Copyright (C) 2002-2008 Hayati Ayguen , Procitec GmbH
Copyright (C) 1987-1999 Bruce Perens
License: GNU GPL (GNU General Public License, see COPYING-GPL) for all files except dumapp.h
License: GNU LGPL (GNU Lesser General Public License, see COPYING-GPL) for dumapp.h
--- GPL --
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--- LGPL --
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
duma-VERSION_2_5_21/SECURITY.md 0000664 0000000 0000000 00000011406 14012250560 0015664 0 ustar 00root root 0000000 0000000 # Security Policy
## Supported releases
- Only the most recent current release is **_SUPPORTED_**.**☨**
[](https://github.com/johnsonjh/duma/releases/)
- **☨** Support is offered on a **best-effort** basis **ONLY**.
```text
BECAUSE THE THE SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING, THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU.
SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION. IN NO EVENT, UNLESS REQUIRED BY APPLICABLE LAW, OR AGREED TO IN
WRITING, WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE SOFTWARE AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING
ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THE SOFTWARE (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA, OR DATA
BEING RENDERED INACCURATE, OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES, OR A FAILURE
OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
```
- Pre-release versions and past releases are **_NOT SUPPORTED_**.
## Report a security vulnerability
- Send a **PGP-encrypted** email to
```text
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBF+T+MsBEACtYMkgx9xjhj0cCGwiCMCqieWdjGRcIYEUKZ+VVuWrB69ig1Vp
CDGWIUBSWz3I2G/3Orx3gClCLjb0NfsarIaxNMMQJpjKZuxUkBhE/9AUYwAXa1Q9
sEEqiH+rDx1RyV1h0HErBs9p1JsLBCaUbybwwVhyiomJVbA8AnEH/HSWT519vmbs
muEBTbcfjuYmt2bAPXBhT70xn+PYyBVTpYc6HXSJj6sbNL5KI0rS0DQE3NOHnWgu
WibMlpmWkhmo7QmXFmrrThnTqqw11edMTYHP4R+H8WRUjpKsKIir/Zeq+5OD0y+Z
8U+brfCpy0NL+2V8YPcHI//DOxXoLkesXEMRD+Ut8FFZ3vTbS4e0RpXsjHpfI+t9
f+Z4dUV103aMi8/NwNcpDJTRN7SqHoh0EWgjM2/uhg+7WWZNZCqBhKtQuSDPAdnM
XDa24STVZitoPuudrcW9h4zRJTG7NbHNS5AaDTf139jrVSWx/9/46eYxzkm+1onk
TbkVePBuoy8Nc3BbWMjbrtsAu12+vHaTfF3Rhz2ZUg9O8s5GQLWgTXebc8MuARUq
bU9VZCPLUQAtWq0BEaBLy954iS4OIkcVGuol8dv88LZbQDDG11s3LzbTiG+LgCpp
9by9LgDAeMz+0jVPi/arJ+5JSS/EMta5DfMqUv9D9X0jl3Uh0MMC5NPKzwARAQAB
tCRKZWZmcmV5IEguIEpvaG5zb24gPHRybnN6QHBvYm94LmNvbT6JAlQEEwEIAD4W
IQSvrWsVt5J8N4AbGg3tvLPrAjvH7QUCX5P4ywIbAwUJB4TOAAULCQgHAgYVCgkI
CwIEFgIDAQIeAQIXgAAKCRDtvLPrAjvH7eGXD/4yjiZxYgsEnFedbB5UkFkzV6bG
i1vw1R+0Yp6b7pgJaiDOq8IMWFkQBLbkzEs/EGly2rDde4snfinkZa+j7rg7opcI
Brzfm9aSgOwdgEmIEkEJd7DYdsz2dGjR1XoYX25mIPk7oUTTCAO6nKaXd6ZMMVf9
Nhfs1Ru7ggRM0QRZv+ymCf8KMgCkKCYiLP8YxsMe1I518yDpyIwMqFnW+SnRQ+7N
A+JpMfBXIOnnbRYT867VovQGABrQ0nnw9sxZNFoKfPDNfTcmiU0HLCVpeV0A8XfS
wbE1B15dtsgDo/ul6wb7AdUPyYxt5UpIWTxMgtSy/l4wr2EV6nYleNd/RooJL27/
AHYlY7V4OgwGkRTQzW5J4dYP5qPnFMkBAqJGEHQgqUlQiu1jqvemlNHbHnXDB7MB
y/CZeZsI287gVPuf8lhnGXEK56WnBSpY8HnKRrqu/ZF/9qELhGXx0lgNIgz87BcH
FgpczeTrARENLOgF1SpTfjJJVGXOPZFhkQ2A+WDV9+Lmcg2Az4hNDYM4H4KKSwrv
r7XZG2DVk3lN5wI6r2iZXg/3l5O/xB2XXAVyM/ShvR0XQ8NXYtsqJCQ5Hb/SJH2t
+wRJHMlB0hrrHsBA3O0e1xvPZ9ZmAKx0h6lQZT5qgALrnA5tEksHFKIkTSdOhjfV
OgoquLuzhmOYgqaOV7kCDQRfk/jLARAAunxDFWs1hDfw2A05rhQDXG5gQACw+dRX
9XMVPJgmIr7/sxBT+Un4tAYWppjLkNNsOWuXtJM3Xs3NGn1NKImSKxW0XKCNE5V5
TEm1NWbKL2uB06SSuKWJypP8sudp1mZofhbRfm4tobYNncUGldO15qYYZfsifTD0
ruxtzOjsHLrH48F0lTKhR0dFXF+xdO+y/LKydC2Eo8DBev3C3qf6POCM/vF11R4w
a6Hl3kkGtaZtr5X70JxCnklW0BLYb7TrCtZXgywf/AMAW27S69n4QUFYk9IgZCTc
OOiE31U7zsL29T4WCV4b+DSo52PDysHy0KF3BjIUM0KNH18cSSdH5gcK8UZM9eFf
bCSM1+fuXUqrZn0dDH6iCLQiFx0S7/I3f+hoXrb4VHCaDHu+19ICqfoVWSMYMino
ogC56ZH9dDsVrhBAuW57H9sK2KCfLfEznGdT7aCp4MWyNYwjFcnesQ5ze+tLVC2X
4foLh21qRVc6i2G4+gAxDW7orBFw2qsW2qzoVy/POHho22g6XBBhwHhh7dNPJjzC
4HPvXeP8ukVRWNiU3tkPGrC5w84vXc+eWSw+BD7bwAF2oGcKCbvtyCdPRF6u5xrq
DqMfSxssYuoNk8GtcTX+GFmanx+ANJN37nTwUAmBYn/ainw57gOh74vKYaHXZGat
ka74wUNJNxkAEQEAAYkCPAQYAQgAJhYhBK+taxW3knw3gBsaDe28s+sCO8ftBQJf
k/jLAhsMBQkHhM4AAAoJEO28s+sCO8ftE2AP+gJUUoCZboAfvBiXDkUR3pKCt1z+
djlaTu/K2coalemNItQ/facunKG4XUO+4ZGHOXVRbEL0s9t1tp36/QNPv3o/kPfy
5knCrDEadkp8ut1xgN/2rC16yA9JJDxa+O62R3Uw7j+ZN4OBCjIdfPwaApADebvm
9/r0C1bd3mzzkIHoGc4HSYX4maPUzd8S8Vi1xjB4xT6047yVU9lVgPc+SMIrUG6r
X1NXukwEqnqiYHNmbbvk+AY06YVHmqynjrJyYiUUbFttKG8WSsJmg/rkk5fu9b63
1XFRZIvhQbyH/05FHFQgi2jTeP8mBPAfbPPFLytOWOXsKhllzlgJ2nLoYfckILVu
3YJul44LuQelZxbQAYVQMPv9OivG13RKgXFKBowBfx4kCCdOkXv1LyKdQb6/66qj
fEP6nBVMVEzBql3zkQj27XDo8TLHrPJbptSY5StXopRycDYd9d5kKNcpspO73NvD
y4YFFA/pQpSZrIfZG+SzP87GsFLp9//8bb20wdjTIzIN9jHVJfgNpx05bkfDO+iV
ArVOSirsDz/oG/H7FxNPGUrwC+7xL1lFYA5LVqrU2HCzVkDeXtp8rcGmdt7viBxX
+9C5KMC+yB7FqZ3SUbbDUlIo9HG+pbU1cN0xdYzgUHU/JOt0ghgagVoxy3FdCjHI
db6SFclbQx5x03Wn
=wvMh
-----END PGP PUBLIC KEY BLOCK-----
```
duma-VERSION_2_5_21/TODO 0000664 0000000 0000000 00000015606 14012250560 0014571 0 ustar 00root root 0000000 0000000 TODO items (listed by general priority):
========================================
-Linux symbol support
-Win32 use dbghelp for symbol support
-Win64 support
-In-kernel suppor-In-kernel support
-prevent inclusion of duma_sem.h from outside duma headers
-memccpy(), bcopy() + test for all overloaded string functions
-Interface to cause verification walk
-add additional target/compiler switches in GNUmakefile to build with
1- native Solaris compiler / linker
2- Microsoft compiler cl / link
-integrate modifications of
http://tutorial.gsse.at/dynamicmemory/
http://tutorial.gsse.at/uploads/media/duma_iue.tgz
-enhance detection of DUMA_MIN_ALIGNMENT in createconf
use defines specifying the target architecture
use compiler attributes which specify the necessary alignment
-add autoconf/automake build process
-use libtool to build shared libraries in Makefile
depends on autoconf/automake
-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
-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 freely available/downloadable compilers:
1- OpenWatcom C/C++ compiler from http://www.openwatcom.org/
2- Digital MARS C/C++ compiler from http://www.digitalmars.com/
3- Intel C++ compiler from http://www.intel.com/cd/software/products
/asmo-na/eng/compilers/clin/219856.htm
4- Borland C++ Builder from
http://www.borland.com/products/downloads/download_cbuilder.html
5- Macintosh Programmer's Workshop from
http://developer.apple.com/tools/mpw-tools/
6- TenDRA C/C++ compiler from http://www.tendra.org/
or http://www.cse.unsw.edu.au/~patrykz/TenDRA/
-test cmake, dmake, pmake, smake
maybe no more necessary when build is done via autoconf/automake
-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
-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
-modification of manual page duma.3
-check documents for line lengths of 80 coloumns
-check and replace tabs in documents
-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 machine.
getpagesize 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
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.
====================
PRI LOW
====================
-get duma running/compiling on all platforms which are supported on
sourceforge.net's compile farms. see
http://sourceforge.net/docman/display_doc.php?docid=762&group_id=1
--> outdated: sourceforge's compile farm is no more available
-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()
-document 'J. "MUFTI" Scheurich' way of compiling/using DUMA's memory
replacement functions only from own source files. Thus usage of DUMA
for several system libraries is avoided.
--> outdated with preprocessor option DUMA_NO_GLOBAL_MALLOC_FREE
and compiler options "-include" (gcc) and "/FI" (MS Visual C++)
-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.
====================
DONE
====================
-define new thread-safe macros,
which don't have to use the global variable DUMA_PROTECT_BELOW:
1- NEW_PROTECT_BELOW: a 'new' replacement which protects the lower bound
2- NEW_PROTECT_ABOVE: a 'new' replacement which protects the upper bound
3- MALLOC_PROTECT_BELOW: a 'malloc' replacement which protects the lower bound
4- MALLOC_PROTECT_ABOVE: a 'malloc' replacement which protects the upper bound
--> done other way: thread safe macro DUMA_SET_PROTECT_BELOW(V) saves setting in TLS
-implement/use TLS - Thread Local Storage for some variables
f.e. file/line information per delete operator
--> done
-use "-include" option of preprocessor, when having gcc
see http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC11
see http://gcc.gnu.org/onlinedocs/gcc-3.0.4/gcc_3.html#SEC14
see http://gcc.gnu.org/onlinedocs/gcc-4.0.1/gcc/Preprocessor-Options.html
--> done: see example_makes/ex6/Makefile
-use "/FI" option of preprocessor, when having ms visual c++
see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore
/html/_core_.2f.fi.asp
--> done: see win32-msvc.net/example6/example6.sln project settings
-provide a function/macro, which tests the non-protectable side of an
allocated memory block for illegal writes.
--> done: duma_check(), duma_checkAll(), DUMA_CHECK() and DUMA_CHECKALL()
-check and replace tabs in documents
done in version 2.5.7
- gain thread safety: get testmt.c work properly
done in version 2.5.11
- add environment variable DUMA_CHECK_FREQ to autmatically check
no man's land at each n'th allocation/deallocation.
n=0 for no automatic checks
done for version 2.5.12
- enhance testmt.c to run on Windows without pthread library
done for version 2.5.15
duma-VERSION_2_5_21/WIN32_DETOURS_HOWTO.txt 0000664 0000000 0000000 00000003136 14012250560 0017624 0 ustar 00root root 0000000 0000000 It is now possible to use detours with duma on already compiled binaries.
This document will explain an example working configuration and environment.
Known Limitations:
- Detours v2.1 only works with Visual Studio 2005 currently. It does not
build cleanly under 2003.
- Detours v1.5 is not directly available for d/l anymore. Contact detours
support alias for a copy if you need support for earlier then VS 2005.
Things you will need:
- Detours v1.5 or v2.1, available from Microsoft research as a free download
- DebugView from Sysinternals, this allows you to read the debug console
- Microsoft Visual Studio 2003 or 2005
Conifiguration:
- Expand detours into your duma\detours folder
- Open Visual Studio command prompt, browse to duma\detours and
build detours (nmake)
- Open Visual Studio, select "Detours1.5" or "Detours2.1" build (instead of
debug or release) and build solution
- Open detoursexample1 and build (debug version)
- Open command prompt and issue the following:
: set DUMA_OUTPUT_DEBUG=1
: set DUMA_OUTPUT_STDOUT=0
: set DUMA_OUTPUT_STDERR=0
: set DUMA_OUTPUT_STACKTRACE=1
: set DUMA_OUTPUT_STACKTRACE_MAPFILE=detoursexample1.map
- Copy dumadetours.exe, detoursexample1.exe, detoursexample1.map into the
dumadetoursdll Detours1.5 or Detours2.1 build folder
- Run DebugView
- Run "dumadetours detoursexample1.exe"
- You should see duma output in the DebugView window.
- For detours v2.1 you will also need detoured.dll from the detours distribution in the current directory.
Bug reports:
Report problems and patches for DUMA + Detours to meddington@gmail.com
duma-VERSION_2_5_21/builddocs.bat 0000664 0000000 0000000 00000000225 14012250560 0016530 0 ustar 00root root 0000000 0000000 @echo off
cd c:\projects\naturaldocs
NaturalDocs -i c:\projects\duma -o html c:\projects\duma\docs -p c:\projects\duma\docs-data
cd c:\projects\duma
duma-VERSION_2_5_21/comparisons/ 0000775 0000000 0000000 00000000000 14012250560 0016426 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/README.txt 0000664 0000000 0000000 00000000604 14012250560 0020124 0 ustar 00root root 0000000 0000000
copy of html comparison charts/text and C source code examples from
http://www.cs.utexas.edu/~jpmartin/memCheckers.html
with kind permission of Jean-Philippe Martin.
i've added Makefiles and "#include" lines to the examples
for best DUMA results and to remove compilation errors
occuring when autoincluding the DUMA header files.
Hayati Ayguen
13 January 2008
updated 14 January 2008
duma-VERSION_2_5_21/comparisons/ex11/ 0000775 0000000 0000000 00000000000 14012250560 0017204 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex11/Makefile 0000664 0000000 0000000 00000000543 14012250560 0020646 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=wrong1
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex11/wrong1.c 0000664 0000000 0000000 00000000341 14012250560 0020563 0 ustar 00root root 0000000 0000000 #include
int main() {
printf("Hello world!\n");
int* pI = (int*)malloc(sizeof(int));
*pI=2;
free(pI);
printf("Now freeing a pointer twice...\n");
free(pI);
printf("Did you notice?\n");
return 0;
} duma-VERSION_2_5_21/comparisons/ex12/ 0000775 0000000 0000000 00000000000 14012250560 0017205 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex12/Makefile 0000664 0000000 0000000 00000000543 14012250560 0020647 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=wrong3
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex12/wrong3.c 0000664 0000000 0000000 00000000740 14012250560 0020571 0 ustar 00root root 0000000 0000000 #include
int main() {
printf("Hello world!\n");
int* pI = (int*)malloc(sizeof(int));
int j;
printf("Now reading uninitialized memory\n");
j = *pI+2;
printf("Did you notice? (value was %i)\n",j);
free(pI);
printf("(No memory leak here)\n");
int* pJ;
printf("Now writing to uninitialized pointer\n");
*pJ = j;
printf("Did you notice?\n");
// valgrind reports 8, but that's ok
printf("There should be 2 errors in this run\n");
return 0;
} duma-VERSION_2_5_21/comparisons/ex13/ 0000775 0000000 0000000 00000000000 14012250560 0017206 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex13/Makefile 0000664 0000000 0000000 00000000543 14012250560 0020650 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=wrong6
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex13/wrong6.c 0000664 0000000 0000000 00000000451 14012250560 0020574 0 ustar 00root root 0000000 0000000 #include
struct Test {
int a;
char st[10];
};
int main() {
printf("Hello world!\n");
struct Test ar[10];
struct Test b;
printf("Let's index out of bounds \n");
ar[10].a=10;
printf("Did you notice?\n");
printf("There should be 1 error in this run\n");
return 0;
} duma-VERSION_2_5_21/comparisons/ex14/ 0000775 0000000 0000000 00000000000 14012250560 0017207 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex14/Makefile 0000664 0000000 0000000 00000000543 14012250560 0020651 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=wrong7
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex14/wrong7.c 0000664 0000000 0000000 00000000461 14012250560 0020577 0 ustar 00root root 0000000 0000000 #include
int main() {
int *p;
p = (int*) malloc( sizeof(int) * 10 );
printf("Now writing before our allocated array\n");
p[-1] ^= 0x0F; /* bash before */
printf("... and now after our allocated array\n");
p[10] ^= 0x0F; /* bash after */
printf("Did you notice?\n");
free(p);
} duma-VERSION_2_5_21/comparisons/ex15/ 0000775 0000000 0000000 00000000000 14012250560 0017210 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex15/Makefile 0000664 0000000 0000000 00000000542 14012250560 0020651 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=leak1
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex15/leak1.c 0000664 0000000 0000000 00000000262 14012250560 0020351 0 ustar 00root root 0000000 0000000 #include
int main() {
printf("Hello world!\n");
int* pI;
pI = (int*)malloc(sizeof(int));
printf("Let's leak a pointer to int\n");
*pI = 303;
return 0;
} duma-VERSION_2_5_21/comparisons/ex16/ 0000775 0000000 0000000 00000000000 14012250560 0017211 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex16/Makefile 0000664 0000000 0000000 00000000542 14012250560 0020652 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=leak2
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex16/leak2.c 0000664 0000000 0000000 00000000535 14012250560 0020356 0 ustar 00root root 0000000 0000000 #include
int main() {
printf("Hello world!\n");
int* pI;
pI = (int*)malloc(10*sizeof(int));
printf("Let's leak a pointer to an array of 10 ints\n");
int i=0;
for (i=0; i<9; i++) {
pI[i] = 303+i;
}
int j=0;
for (j=0; j<9; j++) {
if (pI[j] != 303+j) printf(" Something strange is happening...\n");
}
return 0;
} duma-VERSION_2_5_21/comparisons/ex17/ 0000775 0000000 0000000 00000000000 14012250560 0017212 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex17/Makefile 0000664 0000000 0000000 00000000540 14012250560 0020651 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=ok5
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex17/ok5.c 0000664 0000000 0000000 00000000503 14012250560 0020052 0 ustar 00root root 0000000 0000000 struct Test {
int a;
char st[10];
};
int main() {
printf("Hello world!\n");
struct Test* ar = (struct Test*)malloc(10*sizeof(struct Test));
ar[9].a=10;
printf("Let's correctly delete an array of 10 objects\n");
free(ar);
printf("Done\n");
printf("There should be 0 error in this run\n");
return 0;
} duma-VERSION_2_5_21/comparisons/ex21/ 0000775 0000000 0000000 00000000000 14012250560 0017205 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex21/Makefile 0000664 0000000 0000000 00000000571 14012250560 0020650 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=wrong1
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.cc.o:
$(CXX) $(CPPFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex21/wrong1.cc 0000664 0000000 0000000 00000000444 14012250560 0020733 0 ustar 00root root 0000000 0000000 #include
#include
#include
using namespace std;
int main() {
cout << "Hello world!" << endl;
int* pI = new int;
*pI=2;
delete(pI);
cerr << "Now deleting a pointer twice..." << endl;
delete(pI);
cerr << "Did you notice?" << endl;
return 0;
} duma-VERSION_2_5_21/comparisons/ex22/ 0000775 0000000 0000000 00000000000 14012250560 0017206 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex22/Makefile 0000664 0000000 0000000 00000000571 14012250560 0020651 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=wrong2
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.cc.o:
$(CXX) $(CPPFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex22/wrong2.cc 0000664 0000000 0000000 00000000736 14012250560 0020741 0 ustar 00root root 0000000 0000000 #include
#include
#include
using namespace std;
int main() {
cout << "Hello world!" << endl;
int* pI = new int;
*pI=2;
cerr << "Now freeing a pointer instead of deleting it..." << endl;
free(pI);
cerr << "Did you notice?" << endl;
pI = new int;
delete(pI);
cerr << "Now deleting twice..." << endl;
delete(pI);
cerr << "Did you notice?" << endl;
cerr << "There should be 2 errors in this run" << endl;
return 0;
} duma-VERSION_2_5_21/comparisons/ex23/ 0000775 0000000 0000000 00000000000 14012250560 0017207 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex23/Makefile 0000664 0000000 0000000 00000000571 14012250560 0020652 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=wrong3
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.cc.o:
$(CXX) $(CPPFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex23/wrong3.cc 0000664 0000000 0000000 00000001100 14012250560 0020725 0 ustar 00root root 0000000 0000000 #include
#include
#include
using namespace std;
int main() {
cout << "Hello world!" << endl;
int* pI = new int;
int j;
cerr << "Now reading uninitialized memory" << endl;
j = *pI+2;
cerr << "Did you notice? (value was " << j << ") " << endl;
delete pI;
cerr << "(No memory leak here)" << endl;
int* pJ;
cerr << "Now writing to uninitialized pointer" << endl;
*pJ = j;
cerr << "Did you notice?" << endl;
// valgrind reports 4, but that's ok
cerr << "There should be 2 errors in this run" << endl;
return 0;
} duma-VERSION_2_5_21/comparisons/ex24/ 0000775 0000000 0000000 00000000000 14012250560 0017210 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex24/Makefile 0000664 0000000 0000000 00000000571 14012250560 0020653 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=wrong4
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.cc.o:
$(CXX) $(CPPFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex24/wrong4.cc 0000664 0000000 0000000 00000000744 14012250560 0020744 0 ustar 00root root 0000000 0000000 #include
#include
#include
using namespace std;
int main() {
cout << "Hello world!" << endl;
{
int* pI = new int[10];
cerr << "Let's delete instead of delete [] " << endl;
delete pI;
cerr << "Did you notice?" << endl;
}
{
int* pI = new int[10];
cerr << "Now let's free instead of delete [] " << endl;
free(pI);
cerr << "Did you notice?" << endl;
}
cerr << "There should be 2 errors in this run" << endl;
return 0;
} duma-VERSION_2_5_21/comparisons/ex25/ 0000775 0000000 0000000 00000000000 14012250560 0017211 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex25/Makefile 0000664 0000000 0000000 00000000571 14012250560 0020654 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=wrong5
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.cc.o:
$(CXX) $(CPPFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex25/wrong5.cc 0000664 0000000 0000000 00000001126 14012250560 0020741 0 ustar 00root root 0000000 0000000 #include
#include
#include
#include
using namespace std;
class Test {
public:
int a;
string stdstr;
Test() {
a=2;
stdstr = "test";
}
};
int main() {
cout << "Hello world!" << endl;
{
Test* pI = new Test[10];
cerr << "Let's delete instead of delete [] " << endl;
delete pI;
cerr << "Did you notice?" << endl;
}
{
Test* pI = new Test[10];
cerr << "Now let's free instead of delete [] " << endl;
free(pI);
cerr << "Did you notice?" << endl;
}
cerr << "There should be 2 errors in this run" << endl;
return 0;
} duma-VERSION_2_5_21/comparisons/ex26/ 0000775 0000000 0000000 00000000000 14012250560 0017212 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex26/Makefile 0000664 0000000 0000000 00000000571 14012250560 0020655 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=wrong6
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.cc.o:
$(CXX) $(CPPFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex26/wrong6.cc 0000664 0000000 0000000 00000000762 14012250560 0020750 0 ustar 00root root 0000000 0000000 #include
#include
#include
#include
using namespace std;
class Test {
public:
int a;
string stdstr;
Test() {
a=2;
stdstr = "test";
}
void doNothing() {
cout << " hi!" << endl;
};
};
int main() {
cout << "Hello world!" << endl;
Test ar[10];
Test b;
cerr << "Let's index out of bounds " << endl;
ar[10].doNothing();
cerr << "Did you notice?" << endl;
cerr << "There should be 1 error in this run" << endl;
return 0;
} duma-VERSION_2_5_21/comparisons/ex27/ 0000775 0000000 0000000 00000000000 14012250560 0017213 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex27/Makefile 0000664 0000000 0000000 00000000570 14012250560 0020655 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=leak1
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.cc.o:
$(CXX) $(CPPFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex27/leak1.cc 0000664 0000000 0000000 00000000345 14012250560 0020521 0 ustar 00root root 0000000 0000000 #include
#include
#include
using namespace std;
int main() {
cout << "Hello world!" << endl;
int* pI = new int;
cerr << "Let's leak a pointer to int" << endl;
*pI = 303;
return 0;
} duma-VERSION_2_5_21/comparisons/ex28/ 0000775 0000000 0000000 00000000000 14012250560 0017214 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex28/Makefile 0000664 0000000 0000000 00000000570 14012250560 0020656 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=leak2
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.cc.o:
$(CXX) $(CPPFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex28/leak2.cc 0000664 0000000 0000000 00000000610 14012250560 0020516 0 ustar 00root root 0000000 0000000 #include
#include
#include
using namespace std;
int main() {
cout << "Hello world!" << endl;
int* pI = new int[10];
cerr << "Let's leak a pointer to an array of 10 ints" << endl;
for (int i=0; i<9; i++) {
pI[i] = 303+i;
}
for (int i=0; i<9; i++) {
if (pI[i] != 303+i) cerr << " Something strange is happening..." << endl;
}
return 0;
} duma-VERSION_2_5_21/comparisons/ex29/ 0000775 0000000 0000000 00000000000 14012250560 0017215 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/ex29/Makefile 0000664 0000000 0000000 00000000566 14012250560 0020664 0 ustar 00root root 0000000 0000000
DUMADIR=../..
CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
LFLAGS=$(DUMADIR)/libduma.a
ifeq ($(OS), Windows_NT)
LIBS=
else
LIBS=-lpthread
endif
CC=gcc
CXX=g++
BIN=ok5
OBJ=$(BIN).o
all: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
.cc.o:
$(CXX) $(CPPFLAGS) -c $< -o $@
duma-VERSION_2_5_21/comparisons/ex29/ok5.cc 0000664 0000000 0000000 00000000713 14012250560 0020223 0 ustar 00root root 0000000 0000000 #include
#include
#include
#include
using namespace std;
class Test {
public:
int a;
string stdstr;
Test() {
a=2;
stdstr = "test";
}
};
int main() {
cout << "Hello world!" << endl;
{
Test* pI = new Test[10];
cerr << "Let's correctly delete an array of 10 objects " << endl;
delete [] pI;
cerr << "Done" << endl;
}
cerr << "There should be 0 errors in this run" << endl;
return 0;
} duma-VERSION_2_5_21/comparisons/memCheckers-Dateien/ 0000775 0000000 0000000 00000000000 14012250560 0022223 5 ustar 00root root 0000000 0000000 duma-VERSION_2_5_21/comparisons/memCheckers-Dateien/boringstyle.css 0000664 0000000 0000000 00000000117 14012250560 0025275 0 ustar 00root root 0000000 0000000 SPAN.definition {
font-style: italic;
}
a {
text-decoration: underline;
}
duma-VERSION_2_5_21/comparisons/memCheckers-Dateien/jpstyle.css 0000664 0000000 0000000 00000000742 14012250560 0024432 0 ustar 00root root 0000000 0000000 a.local {
color: blue;
text-decoration: none;
}
a.local:hover {
text-decoration: underline;
}
a.title {
color: black;
text-decoration: none;
}
a.title:hover {
text-decoration: underline;
}
a.fold {
text-decoration: none;
}
a.fold:hover {
text-decoration: underline;
}
SPAN.definition {
font-style: italic;
}
h1 {
font-size: x-large;
}
h2 {
font-size: large;
}
/*
body { background-color:"#D0D0D0"; color:black; background-image:url("images/stone.gif") }
*/
duma-VERSION_2_5_21/comparisons/memCheckers-Dateien/viewed-any.gif 0000664 0000000 0000000 00000001412 14012250560 0024760 0 ustar 00root root 0000000 0000000 GIF87aU Ä ÿÿÿçççÎÆÆÆÆÆÎµµµµµÖžžÖ¡¡¡Þ„„àuu”””ŒŒŒçbb„„„èQQ{{{oooô11ccc÷!!ÿRZZRRRÿ JJJ999111!!!, U @ÿ Ždižhª®lùl@0ÌÉ6\ÑPlZ14¼æƒ™
žY§ðÈÕ4L#šƒîz¿
åcìz¿àÙ+.›Ïè´º;–ß_ˆNÿ¶ëø|þ>cx6SPKE]3ƒA6P“•Cz^| 6§]r3
F ‹3G £I©Ê©
>bÞßàáâãäåæçèâ0nŸíî`¡«9oÛ“¯x\ï¡4PÈÈÆƒ¬¤ê"AÃ…W« â°L°}˜ˆªØ»Ië>ŠìrF·V©ÿP8pàFËka*XX³ŒAI#¹‘1¢ÁÃr¬jõÊU«F8@€`‚‚» `˜‘©€àJ³ž
z"¡AB4êd—³-œ6âÊK·®Ý»xóêÝ+7”Û¿iüÆß©›f0"‹3B–yø¹ó7¬ˆ¢}Hв†—S ¬ºCÃC“¾pù€äv¡:uO©^ü´’™‘gŠ:ˆò}D¸ë‚ +7’|¹òP¬ä›!aº‘
c¿@°¦À¼¿¡$<êÀåÂÏH˜q¤‹æ˜Ðt€ 3 aG«Eœ¥Á°Rš*¢l°AK@°ôøå„``ÃPFqPTvT9 AH%U-,p@mÅ›G ÑA¬,ÓÔ8Zkuq´4ÔŽ¨¼B‘„8€ÀDt ÇHfІDÀÅŽ3XèlBl”ô‰d–if™ÉÝrÍ97Ø
Æ)çœtÖiçxæ©§! ; duma-VERSION_2_5_21/comparisons/memCheckers.html 0000664 0000000 0000000 00000040455 14012250560 0021552 0 ustar 00root root 0000000 0000000
Comparison of Free Memory Checkers
Memory Checkers
Memory checkers are debugging tools that help programmers find
improper use of pointers, typically memory leaks.
There are some freely available memory checkers. I ran a series of
very simple tests to determine what they can do. The wrong
series of tests contains code that makes pointer mistakes that are not
memory leaks, for example freeing a pointer twice, writing to
uninitialized memory or using delete instead of delete []. The
leak series of tests contains simple memory leaks,
i.e. pointers that are allocated but not released. The ok
series of tests contains programs that are correct and thus should not
cause the memory checker to output any alarm message.
C tests
(updated 3/10/2006)
C++ tests
Conclusion
memWatch and memCheckDeluxe are both memory leak detectors, and they
passed all the memory leak tests. Memwatch wins this round because it
was able to detect the double-free in wrong1.c and the out-of-bounds
accesses in the dynamically allocated array of wrong7.c (not the
static array of wrong6 - but no one else did, either).
Both programs are designed to work with C and require a
recompilation.
MALLOC_CHECK_ is an interesting test: it is triggered simply by
setting the environment variable MALLOC_CHECK_ to 1, and the rest of
the magic is done by glibc (see the link in references, below). This
is the easiest check to set up and it requires no recompilation. It
detected the double free in wrong1 and the mismatched malloc/delete or
new/free pairs in wrong2.cc and wrong5.cc. It was able to see that
something was fishy in wrong7.c, but it reports a single error at the "free"
instead of when we are accessing the memory instead of two errors, for
each out-of-bounds access. MALLOC_CHECK_ cannot detect
memory leaks and did not detect the use of uninitialized memory in
wrong3.
dmalloc is more than a leak detector, but it didn't detect as
many bad cases as valgrind and requires a recompile. Also, its C++
support is (in the author's words) minimal. In particular, I have not
been able to get dmalloc to report line numbers with C++ (log ), although that feature mostly
works with C code - in both leak1.c and leak2.c it pointed to
the return() instead of the line that allocated the unfreed
memory. Dmalloc also often reports unfreed memory, even for programs
that are correct. This may be because of errors in the c++ library,
but it makes the reports harder to read. In contrast, valgrind has a
way to hide leaks that it knows about so its reports are more
clear. See also the author's comments .
valgrind is clearly the winner of this little contest. valgrind
requires no recompilation of the program, so it's very easy to set
up. It identified almost all of the incorrect pointer uses and memory
leaks. The only test that it missed is wrong6, in which we break the
bounds of an array. No other checker spotted that one, though. Also,
valgrind has been improved since we ran this test, so it may perform
even better than what we show here.
DUMA is a very close second. The results I am posting here come from
Koneru Srikanth (kpsrikanth at gmail dot com) who generously sent them
to me. DUMA seems not to require a recompile, but the tests were run
on recompiled code. DUMA performs really well. It was also able to
detect out-of-bounds writes
(it is reported as failing wrong3.cc because it missed the
out-of-bounds read). If for some reason valgrind does not work for
you, then I recommend that you give DUMA a spin.
Reference
I tested:
MALLOC_CHECK_
for glibc (C and C++: requires no recompilation)
dmalloc-5.2.2 (C, minimal C++ support; requires recompilation)
memCheckDeluxe-1.2.2 (C,
some C++. Requires recompilation)
memwatch-2.71 (C
only; requires recompilation)
valgrind-1.9.6
(C, C++ and more: requires no recompilation)
DUMA version 2.4.26
(C and C++. Documentation says that no recompilation is needed, but
the tests were run on recompiled code) (as mentioned above, these tests
were contributed by Koneru Srikanth).
I did not test:
Test programs:
ToDo
The following memory checkers have been mentionned to me but I haven't
tried them yet:
mpatrol at http://www.cbmamiga.demon.co.uk/mpatrol/
Change History
March 10, 2006: added DUMA, contributed by Koneru Srikanth
Oct 6, 2003: mention of mpatrol
Sept 29, 2003: added dmalloc
June 25, 2003: minor change in the text
June 24, 2003: corrected result for memwatch's wrong1.c, added wrong7.c
June 15, 2003: initial release
Please contact me if you have feedback or
would like to suggest another tool for the test.
[J P Martin ]
[res ources ]
[c ontact information ]