Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
2a04600
feat(platform): add no-heap static allocation PAL backend for lockste…
vtz Jun 11, 2026
a33acfd
refactor(platform): remove #ifdef SOMEIP_STATIC_ALLOC from message.h/cpp
vtz Jun 12, 2026
71c63b0
fix(platform): address merge-readiness review findings
vtz Jun 12, 2026
95e99cd
fix(platform): resolve clang-tidy warnings from intrusive ptr changes
vtz Jun 12, 2026
34ffd73
fix(platform): add message_ptr_impl.h to all PAL backend directories
vtz Jun 12, 2026
2a32a98
feat(platform): add follow-up safety hardening for static-alloc backend
vtz Jun 12, 2026
e354267
feat(platform): add container conformance tests and fix doc traceability
vtz Jun 12, 2026
69bbeda
docs: align FMEA and architecture with implementation
vtz Jun 13, 2026
ce164e3
fix(platform): add CI coverage, fix traceability, guard double-release
vtz Jun 13, 2026
1dc6696
fix(platform): mark malloc_trap operator new as noexcept
vtz Jun 13, 2026
4539753
fix(platform): make malloc_trap armable for test compatibility
vtz Jun 13, 2026
9794ef0
fix(platform): add missing <new> include for std::bad_alloc
vtz Jun 13, 2026
75f24dc
feat(platform): migrate core protocol types to PAL abstractions
vtz Jun 19, 2026
1d4bf1c
fix: resolve CI failures across static-alloc, clang-tidy, and Zephyr
vtz Jun 19, 2026
4dd19e6
fix: use pointer+size deserialize overload in UDP transport
vtz Jun 19, 2026
f9e07fe
fix: resolve remaining clang-tidy and static-alloc build issues
vtz Jun 19, 2026
64bb20c
fix: add erase() and iterator-pair ctor to static ByteBuffer
vtz Jun 19, 2026
db0c4a6
fix: cast char iterators to uint8_t for ByteBuffer insert
vtz Jun 19, 2026
1ceeb51
fix: cast uint8_t* to char* for config string deserialization
vtz Jun 19, 2026
c32ab56
fix: resolve ETL string compatibility in SD subsystem
vtz Jun 19, 2026
3994a98
fix: migrate event_subscriber maps and string concat for ETL
vtz Jun 19, 2026
e0a6947
fix: suppress redundant-string-cstr for ETL dual-backend compat
vtz Jun 19, 2026
2e3d7f0
fix: migrate test_serialization.cpp to platform types
vtz Jun 19, 2026
7dc9b15
fix: use c_str()-only ctor for String in serialize_array
vtz Jun 19, 2026
3820c2c
fix: migrate all test files to platform:: types for ETL compat
vtz Jun 19, 2026
842b6a6
ci: disable examples in static-alloc CI job
vtz Jun 19, 2026
2f6a67e
fix: static-alloc test failures — capacity and pool exhaustion
vtz Jun 19, 2026
0cfbe26
fix: prevent segfault on pool exhaustion in UDP receive loop
vtz Jun 19, 2026
f84dd7e
fix: address review findings — overflow, heap-free, and robustness
vtz Jul 1, 2026
a8d68bd
fix: field-request key mismatch and deserializer capacity check
vtz Jul 1, 2026
d0d662e
fix: replace snprintf with MISRA-compliant uint16_to_str
vtz Jul 1, 2026
1200f6c
fix: resolve remaining clang-tidy warnings in uint16_to_str
vtz Jul 1, 2026
6313569
fix: add missing cstddef include for size_t
vtz Jul 1, 2026
68fc7df
ci: fix Windows build and FreeRTOS Renode job timeout
vtz Jul 1, 2026
d0f1092
fix: address all deferred review items
vtz Jul 1, 2026
e962326
fix: use PAL-compatible capacity check instead of #ifdef guard
vtz Jul 1, 2026
3c1493a
fix: revert Actions SHA pinning to tag refs (bad SHAs broke CI)
vtz Jul 1, 2026
c9f1f88
fix: clean stale FetchContent subbuilds on Windows
vtz Jul 1, 2026
5ddced4
fix: complete no-heap static allocation migration
vtz Jul 2, 2026
46f3bc5
fix: add explicit move ctors for SD variant types (GCC -Wmaybe-uninit…
vtz Jul 2, 2026
1b677d6
fix: suppress GCC variant false-positive and clang-tidy include-cleaner
vtz Jul 2, 2026
581a7d5
fix: proper move ctors for SD variant types (GCC + clang-tidy clean)
vtz Jul 2, 2026
a1758dc
fix: resolve all clang-tidy and GCC warnings from static-alloc migration
vtz Jul 2, 2026
ce97490
fix: use NOLINTBEGIN/END for bugprone-use-after-move in SD move ctors
vtz Jul 2, 2026
85b7f6e
refactor(sd): use defaulted Rule of Five, drop hand-written move ctors
vtz Jul 24, 2026
47430ac
feat(static): add message pool double-release safety + ETL error handler
vtz Jul 24, 2026
cce6764
fix(static): add capacity checks before bounded container inserts
vtz Jul 24, 2026
6f57ecc
fix(session): thread-safe get_session + capacity guard
vtz Jul 24, 2026
3d05e38
perf(static): reduce EventPublisherImpl from 680KiB to 33KiB
vtz Jul 24, 2026
a41ede5
fix: sync budget script defaults + eliminate SyncState heap alloc
vtz Jul 24, 2026
f250f31
feat: add PayloadView span-like type for zero-copy payload access
vtz Jul 24, 2026
e2b499b
refactor(static): replace shared_ptr<UdpTransport> with by-value storage
vtz Jul 24, 2026
abb60b3
test: add API pimpl construction tests under malloc trap
vtz Jul 24, 2026
7a32ab3
ci: add static-alloc Renode presets and CI jobs
vtz Jul 24, 2026
743d486
docs: fix traceability tags for ETL error handler and malloc trap
vtz Jul 24, 2026
5fff076
docs: regenerate traceability matrices after static-alloc additions
vtz Jul 24, 2026
0832ed5
fix: guard malloc trap build for hosted platforms only
vtz Jul 24, 2026
afc434e
fix: resolve clang-tidy warnings and FreeRTOS static-alloc build
vtz Jul 24, 2026
9df7464
fix: add zero-arg store_callable overload for FreeRTOS thread
vtz Jul 24, 2026
dd02739
fix: harden static-alloc for Renode CI and host tests
vtz Jul 25, 2026
4594c25
fix: add --build-dir to Renode scripts, suppress char8_t -Wc++20-compat
vtz Jul 25, 2026
11df56e
fix: resolve clang-tidy warnings in tp_types.h and tp_segmenter.cpp
vtz Jul 25, 2026
d824948
fix: make init_static_allocator / init_buffer_pool idempotent
vtz Jul 25, 2026
1024e55
fix: harden SD, event publisher, PayloadView; add changelog & integra…
vtz Jul 30, 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
65 changes: 64 additions & 1 deletion .github/workflows/host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,69 @@ jobs:
path: ${{ github.workspace }}/gtest_results/
retention-days: 14

build-static:
name: Static allocation (no-heap)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
Comment thread
vtz marked this conversation as resolved.

- name: Install ccache
run: sudo apt-get update -qq && sudo apt-get install -y ccache

- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-${{ runner.os }}-static-alloc-${{ github.sha }}
restore-keys: |
ccache-${{ runner.os }}-static-alloc-

- name: Cache CMake FetchContent
uses: actions/cache@v4
with:
path: build/_deps
key: fetchcontent-${{ runner.os }}-static-alloc-${{ hashFiles('CMakeLists.txt') }}
restore-keys: |
fetchcontent-${{ runner.os }}-static-alloc-

- name: Configure CMake (static allocation)
run: >
cmake -B build
-DCMAKE_CXX_COMPILER=g++
-DCMAKE_C_COMPILER=gcc
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_BUILD_TYPE=Release
-DSOMEIP_USE_STATIC_ALLOC=ON
-DENABLE_WERROR=ON

- name: Build
run: cmake --build build --config Release

- name: Test
working-directory: build
run: |
mkdir -p "$GITHUB_WORKSPACE/gtest_results"
export GTEST_OUTPUT="xml:$GITHUB_WORKSPACE/gtest_results/"
ctest --build-config Release --output-on-failure --timeout 30 --no-tests=error --output-junit junit_results.xml

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-host-static-alloc
path: build/junit_results.xml
retention-days: 14

- name: Upload GTest detailed results
uses: actions/upload-artifact@v4
if: always()
with:
name: gtest-results-host-static-alloc
path: ${{ github.workspace }}/gtest_results/
retention-days: 14

coverage:
runs-on: ubuntu-latest
needs: build
Expand Down Expand Up @@ -360,7 +423,7 @@ jobs:
publish-test-results:
name: Publish Test Results
runs-on: ubuntu-latest
needs: [build, build-fedora, coverage, sanitizers]
needs: [build, build-fedora, build-static, coverage, sanitizers]
if: always()
permissions:
checks: write
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/preset-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
preset:
- host-linux
- host-linux-tests
- static-alloc-linux-tests
- freertos-compile-check
- threadx-compile-check
steps:
Expand Down
28 changes: 28 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ option(ENABLE_WERROR "Treat compiler warnings as errors (recommended for CI)" OF
option(SOMEIP_USE_FREERTOS "Use FreeRTOS for threading primitives" OFF)
option(SOMEIP_USE_THREADX "Use ThreadX for threading primitives" OFF)
option(SOMEIP_USE_LWIP "Use lwIP for network sockets" OFF)
option(SOMEIP_USE_STATIC_ALLOC "Use static allocation (no heap)" OFF)

# RTOS linux/POSIX port runtime tests (Linux only)
option(SOMEIP_FREERTOS_LINUX_TESTS "Build and run FreeRTOS runtime tests using FreeRTOS POSIX port" OFF)
Expand Down Expand Up @@ -196,6 +197,19 @@ if(SOMEIP_USE_LWIP)
)
endif()

# --- ETL (Embedded Template Library) for static-allocation containers ---
if(SOMEIP_USE_STATIC_ALLOC)
set(BUILD_TESTS_SAVED ${BUILD_TESTS})
set(BUILD_TESTS OFF)
FetchContent_Declare(etl
GIT_REPOSITORY https://github.com/ETLCPP/etl.git
GIT_TAG 20.47.1
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(etl)
set(BUILD_TESTS ${BUILD_TESTS_SAVED})
endif()

# Set policy for FetchContent timestamp handling (CMake 3.24+)
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
Expand Down Expand Up @@ -251,6 +265,15 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Include directories
include_directories(include)

# Allocation backend (selects containers_impl.h, buffer_pool_impl.h, memory_impl.h)
# SOMEIP_STATIC_ALLOC is set via target_compile_definitions on opensomeip (PUBLIC),
# so it propagates to dependents but NOT to PAL mock tests that compile sources directly.
if(SOMEIP_USE_STATIC_ALLOC)
include_directories(include/platform/static)
else()
include_directories(include/platform/dynamic)
endif()

# Platform backend include directories (selects which *_impl.h files are found)
if(SOMEIP_USE_FREERTOS)
include_directories(include/platform/freertos)
Expand Down Expand Up @@ -611,6 +634,11 @@ elseif(WIN32)
else()
message(STATUS " Networking ............ BSD sockets")
endif()
if(SOMEIP_USE_STATIC_ALLOC)
message(STATUS " Allocation ............ Static (ETL, no heap)")
else()
message(STATUS " Allocation ............ Dynamic (STL)")
endif()
message(STATUS " Build tests ............. ${BUILD_TESTS}")
message(STATUS " Build examples .......... ${BUILD_EXAMPLES}")
message(STATUS " Dev tools ............... ${SOMEIP_DEV_TOOLS}")
Expand Down
26 changes: 26 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,17 @@
"SOMEIP_THREADX_RENODE_TESTS": "ON",
"ARM_FLOAT_ABI": "soft"
}
},
{
"name": "static-alloc-linux-tests",
"displayName": "Static Allocation (No-Heap) with Tests",
"description": "Host build with static allocation backend and unit tests. Exercises slab pools, ETL containers, malloc trap, and PAL conformance for no-heap lockstep mode.",
"inherits": "base",
"cacheVariables": {
"SOMEIP_USE_STATIC_ALLOC": "ON",
"BUILD_TESTS": "ON",
"BUILD_EXAMPLES": "OFF"
}
}
],
"buildPresets": [
Expand Down Expand Up @@ -232,6 +243,10 @@
{
"name": "threadx-cortexm4-renode",
"configurePreset": "threadx-cortexm4-renode"
},
{
"name": "static-alloc-linux-tests",
"configurePreset": "static-alloc-linux-tests"
}
],
"testPresets": [
Expand Down Expand Up @@ -289,6 +304,17 @@
"timeout": 30,
"noTestsAction": "error"
}
},
{
"name": "static-alloc-linux-tests",
"configurePreset": "static-alloc-linux-tests",
"output": {
"outputOnFailure": true
},
"execution": {
"timeout": 30,
"noTestsAction": "error"
}
}
]
}
21 changes: 21 additions & 0 deletions docs/requirements/implementation/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,27 @@ Testing Infrastructure

**Code Location**: ``tests/``

Static Allocation
-----------------

.. requirement:: Static Allocation Policy
:id: REQ_ARCH_008
:satisfies: REQ_ARCH_003
:status: implemented
:priority: high
:category: happy_path
:verification: Build with ``SOMEIP_USE_STATIC_ALLOC=ON`` and run unit tests with heap-interception enabled (``REQ_PAL_NOOP_HEAP_VERIFY``). Verify no ``malloc``, ``free``, ``new``, or ``delete`` calls occur during protocol operation. Inspect container and pool types for compile-time capacity bounds.

When ``SOMEIP_USE_STATIC_ALLOC`` is enabled, the stack shall not perform
dynamic memory allocation (heap) at runtime. All buffers, containers, and
object pools shall use compile-time-sized static storage.

**Rationale**: Freedom from interference per ISO 26262 Part 6 clause 7.4.6;
WCET determinism per clause 7.4.11.

**Code Location**: ``CMakeLists.txt``, ``include/platform/static/``,
``src/platform/static/``

Traceability
============

Expand Down
Loading
Loading