Skip to content
Open
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
3b60f89
added function name option on target pass
Nov 13, 2020
483aabc
removed definition from pass
Nov 13, 2020
7d1aa83
feat(0.1): incorporate PR #44 nondet-generator + fix GoogleTest tag
GuilhermeBn198 May 17, 2026
4d31256
docs(0.2): baseline pre-migration report
GuilhermeBn198 May 17, 2026
1c518be
feat: add Dockerfile.dev (Ubuntu 22.04 + LLVM 16) and migrate all pas…
GuilhermeBn198 May 17, 2026
e98c4a8
feat(1.2): migrate CMake modules to LLVM 16 pre-installed stack
GuilhermeBn198 May 30, 2026
8a92fe0
feat(1.3.1-4): migrate simple passes to New Pass Manager
GuilhermeBn198 May 30, 2026
6517245
feat(1.3.5-6): migrate medium passes to New Pass Manager
GuilhermeBn198 May 30, 2026
b92b1ef
feat(1.3.7-9): migrate complex passes to New Pass Manager
GuilhermeBn198 May 30, 2026
0e87c74
docs(1.3): add consolidated New PM migration report and update schedule
GuilhermeBn198 May 30, 2026
b5f2759
feat(1.4.1-2): migrate frontend to New PM + C++17 stdlib
GuilhermeBn198 May 30, 2026
dc6777a
build(1.4.3): update CMake for C++17 migration
GuilhermeBn198 May 30, 2026
7faa87d
docs(1.4): add frontend and C++17 migration report
GuilhermeBn198 May 30, 2026
c46551d
fix(cmake): use CACHE FORCE for compiler vars in FindClang
GuilhermeBn198 May 30, 2026
ddd98d6
docs(1.4): update report with build/test results
GuilhermeBn198 May 30, 2026
284aef1
fix(klee): update CLI flags for KLEE 3.x (LLVM 16)
GuilhermeBn198 May 31, 2026
9bede1c
feat(testcomp): add TestComp 2026 checkpoint framework
GuilhermeBn198 May 31, 2026
0deb84e
fix(passes): add isRequired() and fix target function propagation
GuilhermeBn198 May 31, 2026
db15d93
docs: add smoke test report for checkpoint 1.4
GuilhermeBn198 May 31, 2026
77cff1c
docs(testcomp): add reproduction guide and iteration report
GuilhermeBn198 May 31, 2026
9a00b27
docs: update checkpoint report with full smoke test results
GuilhermeBn198 May 31, 2026
f7a0a7b
feat(testcomp): complete Heap execution + verdict verification
GuilhermeBn198 Jun 13, 2026
63e45bb
ci: add GitHub Actions CI and Docker publish workflows
GuilhermeBn198 Jun 14, 2026
65138ba
build: add sanitizer support and cppcheck to dev image
GuilhermeBn198 Jun 14, 2026
49d1c50
chore: add static analysis configs (clang-tidy, cppcheck)
GuilhermeBn198 Jun 14, 2026
b5ae9de
docs: update badges and LLVM version in README
GuilhermeBn198 Jun 14, 2026
9de7eb8
docs: add Phase 1.5 OpenSSF badge to migration schedule
GuilhermeBn198 Jun 14, 2026
d70c38b
fix(ci): use apt install instead of GHCR image
GuilhermeBn198 Jun 14, 2026
f82829d
fix: remove comments from cppcheck suppressions file
GuilhermeBn198 Jun 14, 2026
5855edb
fix(build): enable PIC for sanitizer builds
GuilhermeBn198 Jun 14, 2026
87b54ad
fix(ci): adjust cppcheck and sanitizer sensitivity
GuilhermeBn198 Jun 14, 2026
8961350
fix(ci): make C backend cppcheck informational
GuilhermeBn198 Jun 14, 2026
f1e0b92
docs: document CI findings and add Phase 2.0 code health tasks
GuilhermeBn198 Jun 14, 2026
c320918
docs: add clang-tidy findings (strcpy CWE-119, dead stores)
GuilhermeBn198 Jun 14, 2026
1fcfef2
docs: update migration schedule status and mark incomplete tasks as d…
GuilhermeBn198 Jun 14, 2026
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
36 changes: 36 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# ============================================================
# clang-tidy configuration for Map2Check
#
# Focus on security-relevant checks for C/C++ code:
# - clang-analyzer-*: deep static analysis (null deref, buffer overflow, etc.)
# - bugprone-*: common bug patterns
# - performance-*: performance anti-patterns
# - modernize-*: C++17 modernization
#
# Phase 1.5 — OpenSSF Best Practices Badge
# ============================================================

Checks: >
-*,
clang-analyzer-*,
-clang-analyzer-cplusplus.NewDeleteLeaks,
-clang-analyzer-optin.cplusplus.UninitializedObject,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-narrowing-conversions,
performance-*,
-performance-avoid-endl,
modernize-use-override

WarningsAsErrors: >
clang-analyzer-core.*,
clang-analyzer-security.*,
bugprone-use-after-move

HeaderFilterRegex: 'modules/.*'

CheckOptions:
- key: bugprone-assert-side-effect.AssertMacros
value: 'assert,BOOST_ASSERT'
- key: bugprone-dangling-handle.HandleClasses
value: 'std::string_view;std::experimental::string_view'
8 changes: 8 additions & 0 deletions .cppcheck-suppressions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
unmatchedSuppression
missingIncludeSystem
*:modules/backend/library/lib/json11/*
unknownMacro
unusedFunction:modules/backend/pass/*
unusedFunction:modules/backend/library/*
uninitMemberVar
missingReturn:modules/frontend/counter_example/*
191 changes: 191 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
############################################################
# Map2Check CI — Build, Test, Static & Dynamic Analysis
#
# Runs on every push and pull request.
# Installs LLVM 16 directly on ubuntu-22.04 runner.
# Unit tests use -DSKIP_KLEE=ON -DSKIP_LIB_FUZZER=ON,
# so the full Dockerfile.dev dependencies are not needed.
#
# Phase 1.5 — OpenSSF Best Practices Badge (Analysis section)
############################################################
name: CI

on:
push:
branches: [develop, main, master, 'feat-*']
pull_request:
branches: [develop, main, master]

jobs:
# ===========================================================
# Job 1: Build + Unit Tests
# ===========================================================
build-and-test:
name: Build & Unit Tests
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install LLVM 16
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | sudo tee /etc/apt/sources.list.d/llvm-16.list
sudo apt-get update
sudo apt-get install -y \
clang-16 llvm-16 llvm-16-dev libclang-16-dev \
cmake ninja-build libboost-all-dev zlib1g-dev

- name: Configure CMake
run: |
mkdir -p build && cd build
cmake .. -G Ninja \
-DLLVM_DIR=/usr/lib/llvm-16/lib/cmake/llvm \
-DSKIP_LIB_FUZZER=ON \
-DSKIP_KLEE=ON \
-DENABLE_TEST=ON
env:
CC: /usr/bin/clang-16
CXX: /usr/bin/clang++-16

- name: Build
run: cd build && ninja

- name: Run Unit Tests
run: cd build && ctest --output-on-failure

# ===========================================================
# Job 2: Static Analysis (cppcheck + clang-tidy)
# ===========================================================
static-analysis:
name: Static Analysis
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install LLVM 16 + cppcheck
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | sudo tee /etc/apt/sources.list.d/llvm-16.list
sudo apt-get update
sudo apt-get install -y \
clang-16 clang-tidy-16 llvm-16 llvm-16-dev libclang-16-dev \
cmake ninja-build libboost-all-dev zlib1g-dev \
cppcheck

- name: Generate compile_commands.json
run: |
mkdir -p build && cd build
cmake .. -G Ninja \
-DLLVM_DIR=/usr/lib/llvm-16/lib/cmake/llvm \
-DSKIP_LIB_FUZZER=ON \
-DSKIP_KLEE=ON \
-DENABLE_TEST=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
env:
CC: /usr/bin/clang-16
CXX: /usr/bin/clang++-16

- name: Run cppcheck (C++)
run: |
cppcheck \
--enable=warning,portability \
--suppress=missingIncludeSystem \
--suppress=unknownMacro \
--suppress=unusedFunction \
--suppress=passedByValue \
--suppressions-list=.cppcheck-suppressions.txt \
--inline-suppr \
--error-exitcode=1 \
--std=c++17 \
--language=c++ \
-I modules/ \
modules/frontend/ \
tests/unit/

- name: Run cppcheck (C backend — informational)
run: |
echo "::warning::C backend library has pre-existing issues — scan is informational only"
cppcheck \
--enable=warning,portability \
--suppress=missingIncludeSystem \
--suppress=unknownMacro \
--suppress=unusedFunction \
--suppressions-list=.cppcheck-suppressions.txt \
--inline-suppr \
--std=c11 \
--language=c \
-I modules/ \
modules/backend/library/ || true

- name: Build (for clang-tidy)
run: cd build && ninja
env:
CC: /usr/bin/clang-16
CXX: /usr/bin/clang++-16

- name: Run clang-tidy
run: |
find modules/frontend -name '*.cpp' | \
xargs -I{} clang-tidy-16 -p build/ \
--config-file=.clang-tidy \
--warnings-as-errors='clang-analyzer-core.*,clang-analyzer-security.*,bugprone-use-after-move' \
{} 2>&1 || true

# ===========================================================
# Job 3: Dynamic Analysis (ASan + UBSan)
# ===========================================================
sanitizer-tests:
name: Sanitizer Tests (ASan + UBSan)
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install LLVM 16
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | sudo tee /etc/apt/sources.list.d/llvm-16.list
sudo apt-get update
sudo apt-get install -y \
clang-16 llvm-16 llvm-16-dev libclang-16-dev \
cmake ninja-build libboost-all-dev zlib1g-dev

- name: Configure CMake with Sanitizers
run: |
mkdir -p build && cd build
cmake .. -G Ninja \
-DLLVM_DIR=/usr/lib/llvm-16/lib/cmake/llvm \
-DSKIP_LIB_FUZZER=ON \
-DSKIP_KLEE=ON \
-DENABLE_TEST=ON \
-DMAP2CHECK_ENABLE_SANITIZERS=ON
env:
CC: /usr/bin/clang-16
CXX: /usr/bin/clang++-16

- name: Build with Sanitizers
run: cd build && ninja
env:
CC: /usr/bin/clang-16
CXX: /usr/bin/clang++-16

- name: Run Tests with ASan + UBSan
env:
# detect_leaks=0: test code intentionally allocates without freeing
# (tests allocation tracking, not ownership)
ASAN_OPTIONS: "detect_leaks=0:halt_on_error=1:abort_on_error=1"
# halt_on_error=0: report pre-existing UB issues without blocking CI
# Known: BTree.c:276 off-by-one (tracked for fix in Phase 2)
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=0"
run: cd build && ctest --output-on-failure
58 changes: 58 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
############################################################
# Publish map2check-dev Docker image to GitHub Container Registry
#
# Triggers:
# - Push to develop (Dockerfile.dev changes)
# - Manual dispatch (workflow_dispatch)
#
# Phase 1.5 — OpenSSF Best Practices Badge
############################################################
name: Publish Docker Image

on:
push:
branches: [develop]
paths:
- 'Dockerfile.dev'
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/map2check-dev

jobs:
build-and-push:
name: Build & Push to GHCR
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=sha,prefix=

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.dev
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ target_wrapper.*

# QtCreator CMake
CMakeLists.txt.user*
test-comp2026/simulation/release/*
44 changes: 26 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
cmake_minimum_required(VERSION 3.5)
project(Map2Check)
cmake_minimum_required(VERSION 3.20)
project(Map2Check VERSION 8.0.0 LANGUAGES C CXX)

set(Map2Check_VERSION_MAJOR 7)
set(Map2Check_VERSION_MINOR 0)

option(USE_PREBUILT_CLANG "Download and Install pre-built clang" ON)
option(BUILD_DOC "Build documentation" OFF)
option(SKIP_LIB_FUZZER "Don't build libFuzzer" OFF)
option(SKIP_KLEE "Don't build KLEE" OFF)
option(SKIP_LIB_FUZZER "Don't use libFuzzer" OFF)
option(SKIP_KLEE "Don't use KLEE" OFF)
option(REGRESSION "Prepare Regression Tests" OFF)
option(ENABLE_TEST "Build all tests" OFF)
option(MAP2CHECK_ENABLE_SANITIZERS "Enable AddressSanitizer + UndefinedBehaviorSanitizer for testing" OFF)

set (CMAKE_CXX_STANDARD 11)

# set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
# set(CMAKE_EXE_LINKER_FLAGS "-Bstatic -static-libgcc -static-libstdc++")
# include(cmake/ExternalDeps.cmake)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# --- Sanitizer configuration (Phase 1.5 — OpenSSF Best Practices) ---
if(MAP2CHECK_ENABLE_SANITIZERS)
message(STATUS "Sanitizers enabled: ASan + UBSan (dynamic linking)")
add_compile_options(-fsanitize=address,undefined -fno-omit-frame-pointer -g)
add_link_options(-fsanitize=address,undefined)
# Ensure all targets (including OBJECT libraries) are compiled with -fPIC,
# required for LLVM pass shared libraries (.so)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# ASan requires dynamic linking — skip static config
set(Map2Check_MODE "SHARED")
else()
# --- Static linking configuration ---
set(Map2Check_MODE "STATIC")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(CMAKE_EXE_LINKER_FLAGS "-Bstatic -static-libgcc -static-libstdc++")
endif()

set(Map2Check_MODE "STATIC")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(CMAKE_EXE_LINKER_FLAGS "-Bstatic -static-libgcc -static-libstdc++")

# --- Core dependencies ---
include(cmake/FindClang.cmake)
include(cmake/FindBoost.cmake)

Expand All @@ -46,7 +54,7 @@ include_directories(${PROJECT_SOURCE_DIR})
if(ENABLE_TEST)
enable_testing()
include(cmake/FindGTest.cmake)
message("Adding tests")
message(STATUS "Adding tests")
add_subdirectory(tests)
endif()

Expand Down
Loading
Loading