Skip to content

Commit f4ba646

Browse files
authored
Merge branch 'main' into feat/create_timer
2 parents 173c0c8 + 7b6d54a commit f4ba646

File tree

148 files changed

+2917
-1045
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+2917
-1045
lines changed

.cppcheck_suppressions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*:*/test/*
22

33
uninitvar:*/agnocast_kmod/*
4+
nullPointer:*/agnocast_kmod/*
45
unusedStructMember:*/agnocast_kmod/*
56

67
checkersReport

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
## How was this PR tested?
66

77
- [ ] Autoware (required)
8-
- [ ] `bash scripts/e2e_test_1to1` (required)
9-
- [ ] `bash scripts/e2e_test_2to2` (required)
8+
- [ ] `bash scripts/test/e2e_test_1to1` (required)
9+
- [ ] `bash scripts/test/e2e_test_2to2` (required)
1010
- [ ] kunit tests (required when modifying the kernel module)
1111
- [ ] sample application
1212

.github/workflows/build-and-test-agnocastlib-heaphook.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
echo "$CHANGED_FILES" >> "$GITHUB_OUTPUT"
5050
echo "EOF" >> "$GITHUB_OUTPUT"
5151
52-
if echo "$CHANGED_FILES" | grep -qE '(agnocastlib|agnocast_ioctl_wrapper|cie_thread_configurator)/.*\.(cpp|hpp)$'; then
52+
if echo "$CHANGED_FILES" | grep -qE '(agnocastlib|agnocast_ioctl_wrapper|agnocast_cie_thread_configurator)/.*\.(cpp|hpp)$'; then
5353
echo "cpp_changed=true" >> "$GITHUB_OUTPUT"
5454
else
5555
echo "cpp_changed=false" >> "$GITHUB_OUTPUT"
@@ -89,7 +89,7 @@ jobs:
8989
sudo apt-get install -y --no-install-recommends python3-rosdep
9090
sudo rosdep init
9191
rosdep update
92-
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
92+
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO --skip-keys glog
9393
9494
- name: Cache ccache
9595
if: github.event_name == 'push' || (steps.check_diff.outputs.cpp_changed == 'true' || steps.check_diff.outputs.heaphook_changed == 'true')

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ __pycache__
1616
*.changes
1717
*.build
1818
*.upload
19+
*.o.d

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ repos:
1616
hooks:
1717
- id: kunit
1818
name: Run KUnit tests
19-
entry: scripts/run_kunit
19+
entry: scripts/test/run_kunit
2020
language: system
2121
types: [c]

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ Examples:
6868
Before submitting a PR, please ensure the following tests pass:
6969

7070
- [ ] Autoware (required)
71-
- [ ] `bash scripts/e2e_test_1to1` (required)
72-
- [ ] `bash scripts/e2e_test_2to2` (required)
71+
- [ ] `bash scripts/test/e2e_test_1to1` (required)
72+
- [ ] `bash scripts/test/e2e_test_2to2` (required)
7373
- [ ] kunit tests (required when modifying the kernel module)
7474

7575
## Questions?

README.md

Lines changed: 75 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ This reflects the current status, and support is expected to expand in the futur
4040

4141
| Category | Supported Versions / Notes |
4242
|--------------------|--------------------------------------------------------------|
43-
| ROS 2 | Humble (only with `rclcpp` client library) |
44-
| Linux Distribution | Ubuntu 22.04 (Jammy Jellyfish) |
43+
| ROS 2 | Humble / Jazzy (only with `rclcpp` client library) |
44+
| Linux Distribution | Ubuntu 22.04 (Jammy) / Ubuntu 24.04 (Noble) |
4545
| Linux Kernel | 5.x / 6.x series (detailed version matrix not yet available) |
4646

47-
ROS 2 Jazzy (Ubuntu 24.04) is now supported in the main branch and will be included in the v2.2.0 release.
47+
> **Warning**: Agnocast service/client is not officially supported yet and the API may change in the future. Use at your own risk.
4848
4949
---
5050

@@ -56,19 +56,22 @@ Since ROS packages under `src/` such as `agnocastlib` are not yet distributed fr
5656
Therefore, to perform the source build, first check out the specific version as follows:
5757

5858
```bash
59-
git clone --branch 2.1.2 https://github.com/tier4/agnocast.git
59+
git clone --branch 2.2.0 https://github.com/tier4/agnocast.git
6060
cd agnocast
6161
```
6262

6363
### System Configuration
6464

65+
Agnocast uses POSIX message queues for inter-process notification. The following system parameters may need adjustment.
66+
67+
#### `msg_max`: Maximum number of messages per queue (Required)
68+
6569
Agnocast requires increasing the system limit for the maximum number of messages in a queue.
6670

6771
**Temporary setting (Current session only):**
6872

6973
```bash
7074
sudo sysctl -w fs.mqueue.msg_max=256
71-
7275
```
7376

7477
**Permanent setting:**
@@ -78,6 +81,55 @@ echo "fs.mqueue.msg_max=256" | sudo tee -a /etc/sysctl.conf
7881
sudo sysctl -p
7982
```
8083

84+
#### `queues_max`: Maximum number of message queues system-wide (Optional)
85+
86+
Agnocast creates a message queue for each subscriber, so the total number of message queues grows with the number of topics and subscribers. The system default for `queues_max` is typically 256, which may not be sufficient for large-scale deployments.
87+
88+
You can check the current limit with:
89+
90+
```bash
91+
cat /proc/sys/fs/mqueue/queues_max
92+
```
93+
94+
If you encounter `mq_open failed: No space left on device`, you may need to increase this limit.
95+
96+
**Temporary setting (Current session only):**
97+
98+
```bash
99+
sudo sysctl -w fs.mqueue.queues_max=1024
100+
```
101+
102+
**Permanent setting:**
103+
104+
```bash
105+
echo "fs.mqueue.queues_max=1024" | sudo tee -a /etc/sysctl.conf
106+
sudo sysctl -p
107+
```
108+
109+
#### `msgqueue`: Per-user POSIX message queue memory limit (Optional)
110+
111+
Each bridge manager message queue consumes memory proportional to the maximum message size and queue depth.
112+
When running many Agnocast processes simultaneously, the per-user POSIX message queue memory limit
113+
(`RLIMIT_MSGQUEUE`) may be exceeded, causing `mq_open` to fail.
114+
115+
To increase the limit, either add the following line to `/etc/security/limits.conf`:
116+
117+
```text
118+
* - msgqueue unlimited
119+
```
120+
121+
Or use `prlimit` to change the limit for the current shell:
122+
123+
```bash
124+
sudo prlimit --pid=$$ --msgqueue=unlimited
125+
```
126+
127+
You can verify the current limit with:
128+
129+
```bash
130+
ulimit -q
131+
```
132+
81133
### Setup
82134

83135
Run the setup script to install dependencies:
@@ -104,14 +156,14 @@ sudo chmod 0644 /etc/apt/keyrings/agnocast-ppa.gpg
104156
cat <<EOF | sudo tee /etc/apt/sources.list.d/agnocast.sources
105157
Types: deb
106158
URIs: http://ppa.launchpad.net/t4-system-software/agnocast/ubuntu
107-
Suites: jammy
159+
Suites: jammy noble
108160
Components: main
109161
Signed-By: /etc/apt/keyrings/agnocast-ppa.gpg
110162
EOF
111163

112164
# Install packages
113165
sudo apt update
114-
sudo apt install agnocast-heaphook-v2.1.2 agnocast-kmod-v2.1.2
166+
sudo apt install agnocast-heaphook-v2.2.0 agnocast-kmod-v2.2.0
115167
```
116168

117169
</details>
@@ -132,12 +184,21 @@ Insert kernel module.
132184
sudo modprobe agnocast
133185
```
134186

187+
You can optionally specify the mempool size per process (default: 8GB).
188+
Note that this parameter is experimental and may be removed or changed in future versions:
189+
190+
```bash
191+
sudo modprobe agnocast mempool_size_gb=16
192+
```
193+
194+
See [shared_memory.md](docs/shared_memory.md) for details on mempool configuration.
195+
135196
Run sample app (different window for each script).
136197
The order does not matter.
137198

138199
```bash
139-
bash scripts/run_listener
140-
bash scripts/run_talker
200+
bash scripts/sample_application/run_listener
201+
bash scripts/sample_application/run_talker
141202
```
142203

143204
Stop applications and unload kernel module.
@@ -268,7 +329,7 @@ sudo lsmod
268329
You can build, test and generate the coverage report by following:
269330

270331
```bash
271-
bash scripts/test_and_create_report
332+
bash scripts/test/test_and_create_report
272333
```
273334

274335
### Kernel Module Test
@@ -281,7 +342,7 @@ A custom kernel with the following CONFIG enabled is required to run KUnit Test
281342
If booting with the custom kernel, the following script can be used to run unit tests on kernel modules and generate coverage reports.
282343

283344
```bash
284-
bash scripts/run_kunit
345+
bash scripts/test/run_kunit
285346
```
286347

287348
You can also use [pre-commit](#setup-pre-commit)
@@ -341,14 +402,16 @@ Although Agnocast includes cleanup procedures for resources like shared memory a
341402
rm /dev/shm/agnocast@*
342403
```
343404

344-
Additionally, if you encounter the error `mq_open failed: No space left on device`, it means that the system has reached the maximum number of message queues. In that case, you may need to remove leftover message queues by running:
405+
Additionally, if you encounter the error `mq_open failed: No space left on device`, it means that the system has reached the maximum number of message queues. In that case, first try removing leftover message queues by running:
345406

346407
```bash
347408
rm /dev/mqueue/agnocast@*
348409
rm /dev/mqueue/agnocast_bridge_manager_parent@*
349410
rm /dev/mqueue/agnocast_bridge_manager_daemon@*
350411
```
351412

413+
If the error persists after cleanup, you may need to increase the system-wide limit on the number of message queues. See the [System Configuration](#system-configuration) section above for how to increase `queues_max`.
414+
352415
## Documents
353416

354417
- [shared memory](./docs/shared_memory.md)

agnocast_heaphook/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "agnocast_heaphook"
3-
version = "2.1.2"
3+
version = "2.2.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
authors = [

agnocast_heaphook/debian/changelog

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
agnocast-heaphook-v2.2.0 (2.2.0-6) noble; urgency=medium
2+
3+
* fix(test): fix test failures in cie and heaphook test (#887 <https://github.com/tier4/agnocast/issues/887>)
4+
* feat(heaphook)[need-minor-update] :add init_child_allocator (#798 <https://github.com/tier4/agnocast/issues/798>)
5+
* test(heaphook) Refactor heaphook test (#743 <https://github.com/tier4/agnocast/issues/743>)
6+
* test(heaphook) Split test_memory_limit into separate tests for each functions (#742 <https://github.com/tier4/agnocast/issues/742>)
7+
* fix(heaphook): typo (#737 <https://github.com/tier4/agnocast/issues/737>)
8+
* fix(heaphook): distribution architecture from all to any (#735 <https://github.com/tier4/agnocast/issues/735>)
9+
* fix(kmod) [needs minor version update]: Remove AGNOCAST_MEMPOOL_SIZE (#719 <https://github.com/tier4/agnocast/issues/719>)
10+
* test(heaphook) Add unit tests for zero-sized allocation (#733 <https://github.com/tier4/agnocast/issues/733>)
11+
* test(heaphook) Add a unit test to check realloc behaves like malloc when called with a null pointer (#734 <https://github.com/tier4/agnocast/issues/734>)
12+
* test(heaphook): Add unit tests for the fundamental alignment (#726 <https://github.com/tier4/agnocast/issues/726>)
13+
* fix(heaphook) Fix calloc to return a null pointer when the total size does not fit in size_t (#722 <https://github.com/tier4/agnocast/issues/722>)
14+
* fix(heaphook) Fix `aligned_alloc` to always return a `MIN_ALIGN`-byte aligned address when the fundamental alignment is requested. (#713 <https://github.com/tier4/agnocast/issues/713>)
15+
* fix(heaphook) Fix `realloc` to call `malloc` when the pointer is `NULL` (#705 <https://github.com/tier4/agnocast/issues/705>)
16+
* fix(heaphook): Handle unexpected `realloc` by returning null (#700 <https://github.com/tier4/agnocast/issues/700>)
17+
* refactor(heaphook) Refactor test code to use `is_shared` function (#699 <https://github.com/tier4/agnocast/issues/699>)
18+
* feat(heaphook) Support Custom Memory Allocators (#691 <https://github.com/tier4/agnocast/issues/691>)
19+
* feat(heaphook) Define `AgnocastSharedMemoryAllocator` trait to support custom memory allocators (#686 <https://github.com/tier4/agnocast/issues/686>)
20+
* fix: error when upgrading heaphook (#685 <https://github.com/tier4/agnocast/issues/685>)
21+
22+
-- Takahiro Ishikawa-Aso <sykwer@gmail.com> Thu, 19 Feb 2026 2:18:00 +0900
23+
124
agnocast-heaphook-v2.1.2 (2.1.2-2) jammy; urgency=medium
225

326
* fix(heaphook): fix memory-related functions to match C semantics (#657 <https://github.com/tier4/agnocast/issues/657>)

agnocast_heaphook/debian/control

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
Source: agnocast-heaphook-v2.1.2
1+
Source: agnocast-heaphook-v2.2.0
22
Section: libs
33
Priority: optional
44
Maintainer: Takahiro Ishikawa-Aso <sykwer@gmail.com>
55
Build-Depends: debhelper (>= 13), cargo, rustc, dh-cargo
66
Standards-Version: 4.6.1
77
Homepage: https://github.com/tier4/agnocast
88

9-
Package: agnocast-heaphook-v2.1.2
9+
Package: agnocast-heaphook-v2.2.0
1010
Architecture: any
1111
Depends: ${shlibs:Depends}, ${misc:Depends}
1212
Provides: agnocast-heaphook
13-
Conflicts: agnocast-heaphook, agnocast-heaphook-v2.1.0, agnocast-heaphook-v2.1.1
14-
Replaces: agnocast-heaphook-v2.1.0, agnocast-heaphook-v2.1.1
13+
Conflicts: agnocast-heaphook, agnocast-heaphook-v2.1.0, agnocast-heaphook-v2.1.1, agnocast-heaphook-v2.1.2
14+
Replaces: agnocast-heaphook-v2.1.0, agnocast-heaphook-v2.1.1, agnocast-heaphook-v2.1.2
1515
Description: A heap runtime replacement for Agnocast.
1616
To achieve true zero-copy communication with Agnocast, message objects must be placed in shared memory. Therefore, all heap allocation and deallocation operations are intercepted and customized using LD_PRELOAD hooks.

0 commit comments

Comments
 (0)