Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

077 reduced memory usage coverity fix #86

Merged
merged 35 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
1b1de51
index on master: 2e292e1 Fixed email
WojciechRynczuk May 5, 2017
a0ec5df
WIP on master: 2e292e1 Fixed email
WojciechRynczuk May 5, 2017
df5bf11
Bump year
endrjux Nov 22, 2018
c601364
#48 Delete objects
WojciechRynczuk Nov 25, 2018
ba6544a
#48 Unified parser interface
WojciechRynczuk Nov 25, 2018
91acc18
Merge pull request #49 from WojciechRynczuk/048_Parser_memory_leak
WojciechRynczuk Nov 25, 2018
b9cac61
#48 Release only initialized parsers
WojciechRynczuk Nov 25, 2018
7aba320
Merge pull request #50 from WojciechRynczuk/048_Parser_memory_leak
WojciechRynczuk Nov 25, 2018
1a20075
#51 Package update
WojciechRynczuk Nov 26, 2018
477ef48
Merge pull request #52 from WojciechRynczuk/051_Release_package
WojciechRynczuk Nov 26, 2018
41ef883
#51 Command line
WojciechRynczuk Nov 26, 2018
4a14b65
Merge pull request #53 from WojciechRynczuk/051_Release_package
WojciechRynczuk Nov 26, 2018
5040593
#51 Date update
WojciechRynczuk Nov 27, 2018
5a398c1
Merge pull request #54 from WojciechRynczuk/051_Release_package
WojciechRynczuk Nov 27, 2018
b2346cb
#51 No nullptr check
WojciechRynczuk Nov 27, 2018
6513da7
Merge pull request #55 from WojciechRynczuk/051_Release_package
WojciechRynczuk Nov 27, 2018
3aa7f0d
Merge pull request #56 from WojciechRynczuk/v3_release
WojciechRynczuk Nov 27, 2018
8913c7c
#57 Added missing vcd declaration
WojciechRynczuk Dec 18, 2018
866f61a
#57 VCD files update
WojciechRynczuk Dec 18, 2018
3ea9d94
#57 Updated doc
WojciechRynczuk Dec 18, 2018
be5f737
#57 New version
WojciechRynczuk Dec 18, 2018
bf25f9c
Merge pull request #59 from WojciechRynczuk/057_Vcd_declaration
WojciechRynczuk Dec 18, 2018
eb5fcd1
Merge pull request #60 from WojciechRynczuk/v3_release
WojciechRynczuk Dec 18, 2018
e081075
#63 Code coverage & Coveralls integration
WojciechRynczuk Mar 20, 2019
0f79ff8
Release 4 branch
WojciechRynczuk Apr 28, 2019
3d1a90a
#63 Date comparison fix
WojciechRynczuk Apr 8, 2019
0ca7ab3
#63 Local coverage generation
WojciechRynczuk Apr 8, 2019
1183455
#63 Coverage clean
WojciechRynczuk Apr 9, 2019
67caefe
072 std out check (#73)
WojciechRynczuk Nov 10, 2019
d29f09b
#75 Out of memory exception (#82)
WojciechRynczuk Mar 4, 2020
1c798c9
#77 Added signal descriptors
WojciechRynczuk Apr 20, 2020
21b73aa
#77 Added prefixes
WojciechRynczuk Apr 21, 2020
9685e8f
#77 Consistency check
WojciechRynczuk Apr 21, 2020
ef62120
#77 Cleanup
WojciechRynczuk Apr 21, 2020
7b7e6aa
Merge branch 'coverity_scan' into 077_ReducedMemoryUsage
WojciechRynczuk Apr 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 104 additions & 43 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,122 @@
#The initial configuration came from the article: http://genbattle.bitbucket.org/blog/2016/01/17/c++-travis-ci/

sudo: required
dist: trusty

python:
- "3.5"

git:
depth: 5

#Disable the default Travis submodule behavior.
git:
submodules: false

env:
global:
#COVERITY_SCAN_TOKEN
- secure: "OtVLkLQ+O18ZOxFCVTotdxWwxOqE0HcCh7LEguFPpPOp5KX9JsBrRdN8Hq689AK+GnQVuYVHkRPdiduYq8CUoLppZy0AMus7muJp2bdnotwufOIZ0r9lqzau9F4HKcdg8LBjyoHq2gnJZgNsSlrma9AGJ8nKBlVCsOJU/2DB0zJ0ufUR92otRsbKlF0TFXC2SARHYL1fgjoJBtwtKyUkHcn5/85EZjUeZGVvvRIA1oqFN2ksHv2QSevSb4auZgi8Gz4LdkQFfWa+SYDoguMYDZCkJRg4kP/ciuAxWfulroXUyAHOGvg29AwkK7hpnFCiGCxm+mOoDousBrJymuqdblwyTzy3d84i1QZQWEAaSROuPA/cpmSPHBvx+H/YTkmdPKXp46728I1wSILOclN1icWll9KhuiDMGY48e2Zmux5SKuLTjg1wzFNrVEwLeiGT7kExWXeKdPMRo/xmH2vPDlBUVrl2z12RRinpGLW0lgG70f5EJl0K30ArNXmFfFZ775nUBokc9nVgK/bjA9t2olRlOC3tzkhgZnDYp7N/AudKeOnpsWeZEQjf9p/o7SjvMvqgbGXL6kZ74n8Jkau1nKIB+9viplLpBInxEYyMSZ/9qFZf3roYmBVYRA8v6G6PsFagYnqp4vl1zGjiO49KEW1jEF56gWKRYuYHQOaebsI="
#Compilers
- CC=gcc-8
- CXX=g++-8

#Disable the default Travis submodule behavior.
git:
submodules: false
matrix:
fast_finish: true
include:
# Just run tests
- if: NOT branch = coverity_scan
os: linux
dist: trusty
sudo: required
name: "vcdMaker Tests"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-8
- g++-8
- txt2man
- doxygen
- graphviz
before_script:
- git submodule update --init --recursive
- cd ./sources
script:
- cmake -DUSE_STATIC_PUGIXML=ON -DCMAKE_BUILD_TYPE=Release .
- VERBOSE=1 make
- make check

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-8
- g++-8
- txt2man
- doxygen
- graphviz
# Code coverage
- if: NOT branch = coverity_scan
os: linux
dist: xenial
sudo: required
name: "vcdMaker Code Coverage"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-8
- g++-8
- txt2man
- doxygen
- graphviz
- lcov
install:
- gem install coveralls-lcov
before_script:
- sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-5 0
- sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-8 100
- sudo update-alternatives --auto gcov
- wget http://mirrors.kernel.org/ubuntu/pool/universe/l/lcov/lcov_1.13-4_all.deb
- sudo dpkg -i lcov_1.13-4_all.deb
- rm -f lcov_1.13-4_all.deb
- git submodule update --init --recursive
- cd ./sources
- lcov --directory . --zerocounters
script:
- cmake -DUSE_STATIC_PUGIXML=ON -DCMAKE_BUILD_TYPE=Debug -DCODE_COVERAGE=ON .
- VERBOSE=1 make
- make check
after_success:
- lcov --directory . --capture --output-file raw.info
- lcov --remove raw.info '/usr/*' '*/3rdParty/*' '*/test/*' --output-file coverage.info
- lcov --list coverage.info
- coveralls-lcov --repo-token ${COVERALLS_REPO_TOKEN} coverage.info

coverity_scan:
project:
name: vcdMaker
version: v3.0
description: Coverity Scan by Travis CI
notification_email: vcdmaker@mail.com
build_command_prepend: "cov-configure --comptype gcc --compiler g++-8 --template && cmake -DUSE_STATIC_PUGIXML=ON -DCMAKE_BUILD_TYPE=Release ."
build_command: "make"
branch_pattern: coverity_scan

# Blocklist - branches not to be built. RegEx is allowed.
branches:
except:
- r2_release
# Coverity
- if: branch = coverity_scan
os: linux
dist: trusty
sudo: required
name: "vcdMaker Coverity"
env:
- secure: "OtVLkLQ+O18ZOxFCVTotdxWwxOqE0HcCh7LEguFPpPOp5KX9JsBrRdN8Hq689AK+GnQVuYVHkRPdiduYq8CUoLppZy0AMus7muJp2bdnotwufOIZ0r9lqzau9F4HKcdg8LBjyoHq2gnJZgNsSlrma9AGJ8nKBlVCsOJU/2DB0zJ0ufUR92otRsbKlF0TFXC2SARHYL1fgjoJBtwtKyUkHcn5/85EZjUeZGVvvRIA1oqFN2ksHv2QSevSb4auZgi8Gz4LdkQFfWa+SYDoguMYDZCkJRg4kP/ciuAxWfulroXUyAHOGvg29AwkK7hpnFCiGCxm+mOoDousBrJymuqdblwyTzy3d84i1QZQWEAaSROuPA/cpmSPHBvx+H/YTkmdPKXp46728I1wSILOclN1icWll9KhuiDMGY48e2Zmux5SKuLTjg1wzFNrVEwLeiGT7kExWXeKdPMRo/xmH2vPDlBUVrl2z12RRinpGLW0lgG70f5EJl0K30ArNXmFfFZ775nUBokc9nVgK/bjA9t2olRlOC3tzkhgZnDYp7N/AudKeOnpsWeZEQjf9p/o7SjvMvqgbGXL6kZ74n8Jkau1nKIB+9viplLpBInxEYyMSZ/9qFZf3roYmBVYRA8v6G6PsFagYnqp4vl1zGjiO49KEW1jEF56gWKRYuYHQOaebsI="
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-8
- g++-8
- txt2man
- doxygen
- graphviz
coverity_scan:
project:
name: vcdMaker
version: v4.0
description: Coverity Scan by Travis CI
notification_email: vcdmaker@mail.com
build_command_prepend: "cov-configure --comptype gcc --compiler g++-8 --template && cmake -DUSE_STATIC_PUGIXML=ON -DCMAKE_BUILD_TYPE=Release ."
build_command: "make"
branch_pattern: coverity_scan
before_script:
- git submodule update --init --recursive
- cd ./sources
script:
- tail cov-int/scm_log.txt

# Safelist - branches to be built.
branches:
only:
- master
- v3_release
- v4_release
- coverity_scan

before_script:
- git submodule update --init --recursive
- cd ./sources

script:
- cmake -DUSE_STATIC_PUGIXML=ON -DCMAKE_BUILD_TYPE=Release .
- VERBOSE=1 make
- make check
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020 vcdMaker team
Copyright (c) 2018 vcdMaker team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![GitHub License](https://github-basic-badges.herokuapp.com/license/WojciechRynczuk/vcdMaker.svg)](https://github.com/WojciechRynczuk/vcdMaker/blob/master/LICENSE)
[![GitHub Release](https://github-basic-badges.herokuapp.com/release/WojciechRynczuk/vcdMaker.svg)](https://github.com/WojciechRynczuk/vcdMaker/releases/latest)
[![Build Status](https://travis-ci.org/WojciechRynczuk/vcdMaker.svg?branch=master)](https://travis-ci.org/WojciechRynczuk/vcdMaker)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/11276/badge.svg)](https://scan.coverity.com/projects/vcdmaker)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/11276/badge.svg)](https://scan.coverity.com/projects/vcdmaker) [![Coverage Status](https://coveralls.io/repos/github/WojciechRynczuk/vcdMaker/badge.svg)](https://coveralls.io/github/WojciechRynczuk/vcdMaker)


## Basic information
Expand Down
2 changes: 1 addition & 1 deletion development/config/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = vcdMaker
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 3.0
PROJECT_NUMBER = 4.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
9 changes: 7 additions & 2 deletions sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
# - parserSources.cmake: list of parser related files.
# - vcdMaker.cmake, vcdMerge.cmake: executable targets with source list.
# - unitTests.cmake: list of unit tests.
# - codeCoverage.cmake: enables creating coverage data. Just for Linux target.
#
# Copyright (c) 2018 vcdMaker team
# Copyright (c) 2019 vcdMaker team
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand All @@ -33,7 +34,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.8)

include(FeatureSummary)

Expand All @@ -48,6 +49,8 @@ include(commonSources)

include(parserSources)

include(codeCoverage)

include(commonTarget)

include(vcdMaker)
Expand All @@ -74,4 +77,6 @@ include(doxygen)

include(pugixml)

include(clean)

feature_summary(WHAT ALL)
26 changes: 26 additions & 0 deletions sources/cmake/clean.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# clean.cmake
#
# Make clean.
#
# Copyright (c) 2019 vcdMaker team
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${MAKE_CLEAN_FILES})

65 changes: 65 additions & 0 deletions sources/cmake/codeCoverage.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# codeCoverage.cmake
#
# Code Coverage generation.
#
# Copyright (c) 2019 vcdMaker team
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

option(CODE_COVERAGE "Enable code coverage generation")
add_feature_info(GCOV CODE_COVERAGE "Code coverage generation enabled.")

if (CODE_COVERAGE)

# Build type must be Debug
if (NOT ${CMAKE_BUILD_TYPE} STREQUAL Debug)
message(FATAL_ERROR "To generate code coverage data Debug build type must be used.")
endif()

# Generate code coverage just for the Linux target
if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
add_compile_options(--coverage)
link_libraries(--coverage)
else()
message(FATAL_ERROR "Code coverage generation available only for the GNU compiler.")
endif()

# Clean code coverage html
list(APPEND MAKE_CLEAN_FILES CodeCoverage)
list(APPEND MAKE_CLEAN_FILES raw.info)
list(APPEND MAKE_CLEAN_FILES vcdMaker.coverage)

endif()

add_custom_target(coverage_clean
COMMAND rm -rf CodeCoverage
COMMAND rm -f raw.info vcdMaker.coverage
COMMAND find . -type f -name '*.gcda' -delete
COMMENT "Cleaning code coverage data."
)

add_custom_target(coverage
COMMAND mkdir CodeCoverage
COMMAND lcov --directory . --capture --rc lcov_branch_coverage=1 --output-file=raw.info
COMMAND lcov --remove raw.info '/usr/*' '*/3rdParty/*' '*/test/*' --rc lcov_branch_coverage=1 --output-file=vcdMaker.coverage
COMMAND genhtml --output-directory CodeCoverage --rc lcov_branch_coverage=1 vcdMaker.coverage
DEPENDS coverage_clean check
COMMENT "Generating code coverage."
)

7 changes: 6 additions & 1 deletion sources/cmake/commonSources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# List of common source files and directories.
#
# Copyright (c) 2017 vcdMaker team
# Copyright (c) 2020 vcdMaker team
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -42,6 +42,8 @@ set(COMMON_SOURCES
${COMMON_SOURCES_DIR}/Signal.cpp
${COMMON_SOURCES_DIR}/SignalDb.cpp
${COMMON_SOURCES_DIR}/SourceRegistry.cpp
${COMMON_SOURCES_DIR}/SignalDescriptor.cpp
${COMMON_SOURCES_DIR}/SignalDescriptorRegistry.cpp
${COMMON_SOURCES_DIR}/TxtParser.cpp
${COMMON_SOURCES_DIR}/LogParser.cpp
${COMMON_SOURCES_DIR}/LineCounter.cpp
Expand Down Expand Up @@ -77,6 +79,8 @@ set(COMMON_HEADERS
${COMMON_HEADERS_DIR}/SignalStructureBuilder.h
${COMMON_HEADERS_DIR}/Signal.h
${COMMON_HEADERS_DIR}/SourceRegistry.h
${COMMON_HEADERS_DIR}/SignalDescriptor.h
${COMMON_HEADERS_DIR}/SignalDescriptorRegistry.h
${COMMON_HEADERS_DIR}/SignalDb.h
${COMMON_HEADERS_DIR}/VcdException.h
${COMMON_HEADERS_DIR}/VcdExceptionList.h
Expand All @@ -88,6 +92,7 @@ set(COMMON_HEADERS
${COMMON_HEADERS_DIR}/VCDTracer.h
${COMMON_HEADERS_DIR}/SafeUInt.h
${COMMON_HEADERS_DIR}/Timestamp.h
${COMMON_HEADERS_DIR}/OutOfMemory.h
${VERSION_HEADER})

# 3rd party directories.
Expand Down
8 changes: 5 additions & 3 deletions sources/cmake/installCpack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# CPack settings.
#
# Copyright (c) 2017 vcdMaker team
# Copyright (c) 2018 vcdMaker team
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand All @@ -25,9 +25,10 @@
# Set Cpack.

set(AUTHOR "vcdMaker team")
set(WEBSITE "http://vcdmaker.org")
set(DESCRIPTION "Commandline tools that can generate VCD files from text logs")
set(WEBSITE "https://vcdmaker.org")
set(DESCRIPTION "Command line tools that can generate VCD files from text logs")

set(CPACK_PACKAGE_NAME "vcdMaker")
set(CPACK_PACKAGE_VENDOR ${AUTHOR})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Generates VCD files from text logs")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
Expand All @@ -52,5 +53,6 @@ set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${AUTHOR})
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${DESCRIPTION})
set(CPACK_DEBIAN_PACKAGE_SECTION "electronics")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${WEBSITE})
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")

include(CPack)
2 changes: 1 addition & 1 deletion sources/cmake/pugixml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if (USE_STATIC_PUGIXML)

target_include_directories(${COMMON_LIB_TARGET} PUBLIC ${PUGIXML_INCLUDE_DIR})

set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${PUGIXML_LIB_FILE})
list(APPEND MAKE_CLEAN_FILES ${PUGIXML_LIB_FILE})
else()
find_package(pugixml REQUIRED)
set_package_properties(pugixml PROPERTIES
Expand Down
Loading