Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
9c80d7c
Merge pull request #824 from secure-software-engineering/master
fabianbs96 Apr 10, 2026
4f502b1
Fix init-submodules-release.sh (#826)
fabianbs96 Apr 13, 2026
6a94e07
Make Compose and Join optional in EdgeFunction (#736)
fabianbs96 Apr 17, 2026
201012b
Make most namespace-scope operators hidden friends (#825)
fabianbs96 Apr 17, 2026
7b3aa57
ICFG Integration (#829)
fabianbs96 Apr 21, 2026
8daaa34
Remove Deprecated Entities (#827)
fabianbs96 Apr 27, 2026
a1094b9
Add missing IdBasedSolverResults APIs (#831)
fabianbs96 Apr 29, 2026
c19d725
Remove std::shared_ptr flow-functions (#830)
fabianbs96 May 2, 2026
ccfa43c
Compatibility with libstdc++ from gcc 15. (#833)
fabianbs96 May 2, 2026
d03dd6b
Fix linking issue: phasar_llvm_utils must link against LLVMAnalysis (…
fabianbs96 May 6, 2026
0f4c0bf
LLVM 22 Compatibility (#828)
fabianbs96 May 7, 2026
c9564a2
Fix LLVMTaintConfig struct-field tainting mapping all struct types (#…
fabianbs96 May 19, 2026
310161b
Improve UnionFind Alias Analyses (#838)
fabianbs96 May 28, 2026
58e725e
Alternate Sparse Control-Flow API (#841)
fabianbs96 May 31, 2026
5ca66dc
WPDS Solver (#839)
fabianbs96 Jun 1, 2026
1f73cdb
Fix Linker RUNPATH (#844)
fabianbs96 Jun 9, 2026
ab4b7ff
Fix memory explosion in construction of TypeAssignmentGraph while com…
fabianbs96 Jun 10, 2026
0ad3d3e
MonoIFDS (#837)
fabianbs96 Jun 11, 2026
6385aa7
Update Readme (#840)
fabianbs96 Jun 16, 2026
26de306
Add CMake uninstall target (#848)
e345ee Jul 4, 2026
305624f
Improve CFL Field Sensitivity (#847)
fabianbs96 Jul 4, 2026
7554611
Model Extern Callback Calls in LLVM Call Graphs (#849)
e345ee Jul 9, 2026
8a671bb
Andersen Pointer Analysis (#842)
fabianbs96 Jul 31, 2026
ee5cf0c
Rework PAMM (#850)
fabianbs96 Aug 10, 2026
e3727ed
phasar-cli entry-points (#853)
fabianbs96 Aug 15, 2026
5dbdde2
IterIDE Path Tracking (#854)
fabianbs96 Aug 15, 2026
6037ceb
Fix SparseIDE with IterativeIDESolver (#857)
fabianbs96 Aug 19, 2026
6ae5af8
Context-Sensitive Andersen Pointer Analysis (#856)
fabianbs96 Aug 20, 2026
25cda65
Devirtualize IFDS/IDE Tabulation Problem (#851)
fabianbs96 Aug 20, 2026
b56b4bd
Misc Fixes (#858)
fabianbs96 Aug 27, 2026
09372fa
Fix getDefaultEntryPoints (#859)
fabianbs96 Sep 2, 2026
3a5af40
Handle global ctors/dtors for libraries (without main fn). (#860)
fabianbs96 Sep 8, 2026
7926239
Enable LIT Testing (#861)
fabianbs96 Sep 23, 2026
d595485
Add callsite-level, source-located call graph export example (#863)
WizardBornov Sep 23, 2026
bcb5331
Fix Src-Code Info (#865)
fabianbs96 Sep 30, 2026
41d97da
Update Docs (#864)
fabianbs96 Sep 30, 2026
9e16a1c
DFI Solver (#866)
fabianbs96 Oct 19, 2026
44277d7
Misc Fixes II (#867)
fabianbs96 Oct 19, 2026
d3ac3ce
Replace dependency to removed tag and pin git-hash instead (#869)
fabianbs96 Oct 24, 2026
18a0032
Bump v2610 (#868)
fabianbs96 Oct 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Checks: '-*,
-readability-identifier-length,
-readability-redundant-member-init,
-readability-use-anyofallof,
-readability-avoid-return-with-void-value,
-readability-use-std-min-max,
-readability-math-missing-parentheses,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
Expand All @@ -36,6 +39,7 @@ Checks: '-*,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
performance-*,
-performance-enum-size,
clang-analyzer-*
'

Expand Down
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*
!.git
!cmake/
!config/
!external/
!include/
!lib/
!test/
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm]
compiler: [ [clang++-19, clang-19, "clang-19 libclang-rt-19-dev clang-tools-19"] ]
compiler: [ [clang++-21, clang-21, "clang-21 libclang-rt-21-dev clang-tools-21"] ]
build: [ Debug, Release, DebugLibdeps, DebugCov ]
llvm-version: [ 16, 17 ]
llvm-version: [ 16, "22.1" ]
include:
- build: Debug
cmake_build_type: Debug
Expand All @@ -31,7 +31,11 @@ jobs:
- build: DebugCov
cmake_build_type: Debug
flags: -DCODE_COVERAGE=ON
extra_dependencies: llvm-19 # For coverage
extra_dependencies: llvm-21 # For coverage
- llvm-version: 16
llvm-major-version: 16
- llvm-version: "22.1"
llvm-major-version: 22
exclude:
- os: ubuntu-24.04-arm
build: Debug
Expand All @@ -43,7 +47,7 @@ jobs:
continue-on-error: false
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive
Expand All @@ -56,7 +60,11 @@ jobs:
- name: Install Phasar Dependencies
shell: bash
run: |
./utils/InstallAptDependencies.sh --llvm-version ${{ matrix.llvm-version }} --noninteractive tzdata ccache ${{ matrix.compiler[2] }} ${{ matrix.extra_dependencies }}
./utils/InstallAptDependencies.sh \
--llvm-version ${{ matrix.llvm-major-version }} \
--noninteractive \
tzdata ccache ${{ matrix.compiler[2] }} ${{ matrix.extra_dependencies }} \
llvm-${{ matrix.llvm-major-version }}-tools # For lit, FileCheck

- name: Building Phasar in ${{ matrix.build }} with ${{ matrix.compiler[0] }}
env:
Expand All @@ -71,6 +79,7 @@ jobs:
-DBUILD_PHASAR_CLANG=OFF \
-DPHASAR_USE_Z3=ON \
-DPHASAR_BUILD_MODULES=ON \
-DPHASAR_TARGET_ARCH="" \
-DPHASAR_LLVM_VERSION=${{ matrix.llvm-version }} \
${{ matrix.flags }} \
-G Ninja
Expand All @@ -79,7 +88,7 @@ jobs:
- name: Run Unittests
shell: bash
run: |
cmake --build ./build --target check-phasar-unittests
cmake --build ./build --target check-phasar-unittests check-phasar-cli

- name: Install PhASAR and Build Examples
if: matrix.build == 'DebugLibdeps' # Circumvent conflicting ASAn flags
Expand All @@ -91,7 +100,7 @@ jobs:
cmake -DCMAKE_INSTALL_PREFIX=./INSTALL -P ./build/cmake_install.cmake
PHASAR_ROOT_DIR=$(pwd)
cd ./examples/how-to
cmake -S . -B build -Dphasar_ROOT="$PHASAR_ROOT_DIR/INSTALL"
cmake -S . -B build -G Ninja -Dphasar_ROOT="$PHASAR_ROOT_DIR/INSTALL"
cmake --build ./build --target run_sample_programs

- name: Check test coverage and generate HTML report
Expand All @@ -102,7 +111,7 @@ jobs:

- name: Upload coverage HTML report artifact
if: matrix.build == 'DebugCov'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: phasar-coverage-report-llvm-${{ matrix.llvm-version }}
path: ./build/ccov/all-merged/
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ jobs:
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,6 @@ unittests/PhasarLLVM/ifdside/Problems/IFDSTaintAnalysisTest
unittests/PhasarLLVM/Pointer/LLVMTypeHierarchyTest
unittests/Utils/LLVMShorthandsTest
unittests/Utils/PAMMTest

# LLVM lit test times files
*.lit_test_times.txt
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
[submodule "external/json-schema-validator"]
path = external/json-schema-validator
url = https://github.com/pboettch/json-schema-validator.git
[submodule "external/CRoaring"]
path = external/CRoaring
url = https://github.com/fabianbs96/CRoaring.git
80 changes: 63 additions & 17 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
It is recommended to compile PhASAR yourself in order to get the full C++ experience and to have full control over the build mode.
However, you may also want to try out one of the pre-built versions of PhASAR or the Docker container.

As a shortcut for the very first PhASAR build on your system, you can use our [bootstrap](./bootstrap.sh) script.
As a shortcut for the very first PhASAR build on your system, you can use our [bootstrap](./bootstrap.sh) script. It installs required dependencies and builds the libraries.<br>
**For subsequent builds**, see [Compiling PhASAR](#compiling-phasar-if-not-already-done-using-the-bootstrap-script).

Please note that you must have python installed for the script to work properly.

```bash
Expand All @@ -19,11 +21,22 @@ Note: If you want to do changes within PhASAR, it is recommended to build it in

The bootstrap script may ask for superuser permissions (to install the dependencies); however it is not recommended to start the whole script with `sudo`.

For subsequent builds, see [Compiling PhASAR](#compiling-phasar-if-not-already-done-using-the-installation-scripts).
### Requirements

PhASAR requires the following system dependencies:
- LLVM >=16
- We have tested PhASAR only with LLVM versions built with RTTI (runtime-type-info) enabled. Usually, this is no problem as the `llvm-dev` apt package ships with RTTI by default, but may be relevant if you wish to build LLVM from source.
- C++20 compatible compiler, *we recommend clang >=20*
- cmake >=3.23
- some build system, *we recommend ninja*
- depending on your LLVM configuration, you may need `zlib1g-dev`, `libzstd-dev`
- *optional*: SVF >= 3.1, if you want to use SVF's points-to analyses from within PhASAR (`-DPHASAR_USE_SVF=ON` in cmake)

If you are on a Debian-based system, you may use `./utils/InstallAptDependencies.sh` to install all required dependencies. If using the `bootstrap.sh` script, it does that for you.

### Compiling PhASAR (if not already done using the bootstrap script)

Set the system's variables for the C and C++ compiler to clang:
Set the system's variables for the C and C++ compiler to clang (gcc should also work, but we strongly recommend clang):

```bash
export CC=/usr/local/bin/clang
Expand All @@ -45,21 +58,31 @@ utils/init-submodules-release.sh
Navigate into the PhASAR directory. The following commands will do the job and compile the PhASAR framework:

```bash
mkdir build
mkdir -p build
cd build/
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. # ninja is not required, but recommended for
# build-performance
ninja -j $(nproc) # or use a different number of cores to compile it
sudo ninja install # only if you wish to install PhASAR system wide
```

To uninstall PhASAR from the same install location, invoke the `uninstall` target
from the build directory:

```bash
sudo ninja uninstall
```

When you have used the `bootstrap.sh` script to install PhASAR, the above steps are already done.
Use them as a reference if you wish to modify PhASAR and recompile it.

After compilation using cmake the following two binaries can be found in the build/tools directory:
After compilation using cmake the following two binaries can be found in the `build/tools` directory:

+ `phasar-cli` - the PhASAR command-line tool (previously called `phasar-llvm`) that provides access to analyses that are already implemented within PhASAR. Use this if you don't want to build an own tool on top of PhASAR.
+ `myphasartool` - an example tool that shows how tools can be build on top of PhASAR

Also, find the `libphasar.a` or `libphasar.so` library in `build/lib/`.

Please be careful and check if errors occur during the compilation.

When using CMake to compile PhASAR the following optional parameters can be used:
Expand All @@ -69,34 +92,51 @@ When using CMake to compile PhASAR the following optional parameters can be used
| **BUILD_SHARED_LIBS** : BOOL | Build shared libraries -- Not recommended anymore. You may want to use PHASAR_BUILD_DYNLIB instead (default is OFF) |
| **PHASAR_BUILD_DYNLIB** : BOOL | Build one fat shared library (default is OFF) |
| **CMAKE_BUILD_TYPE** : STRING | Build PhASAR in 'Debug', 'RelWithDebInfo' or 'Release' mode (default is 'Debug') |
| **CMAKE_INSTALL_PREFIX** : PATH | Path where PhASAR will be installed if "ninja install” is invoked or the “install” target is built (default is /usr/local/phasar) |
| **CMAKE_INSTALL_PREFIX** : PATH | Path where PhASAR will be installed if "ninja install” is invoked or the “install” target is built (default is /usr/local/phasar or whatever is your system's default install location) |
| **PHASAR_CUSTOM_CONFIG_INSTALL_DIR** : PATH | If set, customizes the directory, where configuration files for PhASAR are installed (default is /usr/local/.phasar-config)|
| **PHASAR_ENABLE_DYNAMIC_LOG** : BOOL|Makes it possible to switch the logger on and off at runtime (default is ON)|
| **PHASAR_BUILD_DOC** : BOOL | Build PhASAR documentation (default is OFF) |
| **PHASAR_BUILD_UNITTESTS** : BOOL | Build PhASAR unit tests (default is ON) |
| **PHASAR_ENABLE_DYNAMIC_LOG** : BOOL|Makes it possible to switch the logger on and off at runtime, otherwise all log-statements are compiled-out (default is ON)|
| **PHASAR_BUILD_DOC** : BOOL | Build PhASAR's Doxygen documentation (default is OFF) |
| **PHASAR_BUILD_IR** : BOOL | Build PhASAR IR (required for running the unit tests) (default is ON) |
| **PHASAR_BUILD_UNITTESTS** : BOOL | Build PhASAR unit tests. Requires `PHASAR_BUILD_IR` (default is ON) |
| **PHASAR_ENABLE_INTEGRATIONTESTS** : BOOL | Build PhASAR LIT integration tests. Requires `PHASAR_BUILD_IR` (default is ON) |
| **PHASAR_BUILD_OPENSSL_TS_UNITTESTS** : BOOL | Build PhASAR unit tests that require OpenSSL (default is OFF) |
| **PHASAR_ENABLE_PAMM** : STRING | Enable the performance measurement mechanism ('Off', 'Core' or 'Full', default is Off) |
| **PHASAR_ENABLE_PIC** : BOOL | Build Position-Independed Code (default is ON) |
| **PHASAR_ENABLE_WARNINGS** : BOOL | Enable compiler warnings (default is ON) |
| **CMAKE_CXX_STANDARD** : INT|Adapt the used C++ standard (minimum required is 20)|
| **PHASAR_LLVM_VERSION** : INT|The LLVM major-version to use. Can be 16 or 17 (default is 16)|
| **PHASAR_LLVM_VERSION** : VERSION|The LLVM major-version to use. Can be between 16 and 22.1 (default is 16)|
| **PHASAR_USE_SVF** : BOOL| Enable using SVF points-to info from PhASAR. See [Use PhASAR with SVF](https://github.com/secure-software-engineering/phasar/wiki/FAQ#how-to-use-phasar-with-svf). Requires SVF installed (default OFF) |

You can use these parameters either directly or modify the installer-script `bootstrap.sh`

#### A Remark on Compile Time

C++'s long compile times are always a pain. As shown in the above, when using cmake the compilation can easily be run in parallel, resulting in shorter compilation times. Make use of it!

### Running a Test Solver
### Using PhASAR with Conan v2

To test if everything works as expected please run the following command:
To export the recipe and dependencies, execute from the repo root:

`$ phasar-cli -m test/llvm_test_code/basic/module_cpp.ll -D ifds-solvertest`
- `conan export utils/conan/llvm-core/ --version 15.0.7 --user secure-software-engineering`
- `conan export utils/conan/clang/ --version 15.0.7 --user secure-software-engineering`
- `conan export .`
- View exported: `conan list "phasar/*"`
- [Consume the package](https://docs.conan.io/2/tutorial/consuming_packages.html)

You can find the `phasar-cli` tool in the build-tree under `tools/phasar-cli`.
If you just want to use phasar-cli:

If you obtain output other than a segmentation fault or an exception terminating the program abnormally everything works as expected.
- `conan install --tool-requires phasar/... --build=missing -of .`
- `source conanbuild.sh`
- `phasar-cli --help`

### Running a Test Solver

To test if everything works as expected please run the following command (from the `build/` folder):

`$ ./tools/phasar-cli/phasar-cli -m test/llvm_test_code/basic/module_cpp.ll -D ifds-solvertest --emit-raw-results`

The output should show that the `@zero_value` data-flow fact holds at every LLVM instruction in the module.
Especially, there should be no segmentation fault, exception, or other non-zero exit condition.

### Building PhASAR on a MacOS System

Expand All @@ -107,7 +147,7 @@ Now you can just attach your docker container to VS Code or any other IDE, which
## Installation

PhASAR can be installed using the installer scripts as explained in the following.
However, you do not need to install PhASAR in order to use it.
However, **you do not need to install PhASAR in order to use it**.

### Installing PhASAR on an Ubuntu System

Expand All @@ -129,3 +169,9 @@ If You have already built phasar, you can just invoke
```bash
sudo ninja install
```

To uninstall PhASAR again, invoke the uninstall target from the same build directory:

```bash
sudo ninja uninstall
```
13 changes: 12 additions & 1 deletion BreakingChanges.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

## development HEAD

*None*
- *None*

## v2610

- Existing IFDS/IDE problems provided by PhASAR do no longer inherit from `IFDSTabulationProblem`/`IDETabulationProblem`. The solvers can now deal with them without polymorphic inheritance hierarchy. However, **you cannot cast an analysis problem to one of these base classes anymore**. If that's required (unlikely), wrap your problem in a `LegacyIDEProblemWrapper`.
- Although the IFDS/IDETabulationProblem classes still work, new IFDS/IDE analysis problems should conform to the `IFDSProblem`/`IDEProblem` concepts instead. Use `IfdsIdeProblemMixin` as helper for that.
- `IDESolver` and `IFDSSolver` now take analysis problems by pointer instead of by reference to better document that they capture the address (without taking ownership).
- `FlowFunctionPtrType` is now a move-only type.
- Removed the CRTP-template `ProjectIRDBBase`. Use the concept `ProjectIRDB` instead.
- Removed `EdgeFunction<L>::equals`. Use `operator==` instead.
- Removed ctor-overloads of `LLVMProjectIRDB` that use the `EnableOpaquePointers` parameter. LLVM is removing support for non-opaque pointers. Use the other ctors instead.
- Removed type-trait `has_getAsJson`, as it is not used in our codebase anymore. We switched from `getAsJson` to `printAsJson` a while ago.

## v2604

Expand Down
Loading
Loading