• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

drakenclimber / libcgroup / 22956879275
56%
main: 56%

Build:
Build:
LAST BUILD BRANCH: test
DEFAULT BRANCH: main
Ran 11 Mar 2026 02:13PM UTC
Jobs 5
Files 39
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 Mar 2026 02:11PM UTC coverage: 56.21% (+0.04%) from 56.167%
22956879275

push

github

drakenclimber
src/config: free namespace table on success and failure

The per-thread namespace table (cg_namespace_table[]) is populated by
config_order_namespace_table() / config_validate_namespaces() under
cg_mount_table_lock and then consumed by cg_build_path_locked().
Before this patch we reset the array with a bespoke loop + memset at the
front of config_order_namespace_table(), but error paths relied on the
call chain eventually unwinding into cgroup_free_config() to release
any partially populated entries. That worked, yet it meant the table
could briefly hold dangling pointers after an error while the lock was
already dropped, one subtle slip or new return path would have left stale
namespaces visible to the rest of the library.

This change introduces a small helper,
cgroup_config_free_namespaces_table(), that walks the thread-local
array, frees each string, and nulls the slot. We invoke it in three
places:

- right at the start of config_order_namespace_table(), so every run
  begins with a clean slate.
- from the error branches of both namespace helpers, guaranteeing that
  even a mid-stream failure leaves the table empty before the lock is
  released.
- and (unchanged) from cgroup_free_config(), so the happy path tears
  everything down once the config work finishes.

The end result is both cleaner and safer: we delete the redundant
set-to-NULL/memset sequence and the namespace table is always in a known
state no matter how the parser exits.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>

8 of 10 new or added lines in 1 file covered. (80.0%)

1116 existing lines in 5 files now uncovered.

5621 of 10000 relevant lines covered (56.21%)

602.01 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
35.81
0.28% src/config.c

Uncovered Existing Lines

Lines Coverage ∆ File
48
78.76
0.27% src/tools/cgget.c
94
17.76
0.03% src/parse.y
115
41.88
-0.31% src/tools/cgxget.c
291
35.81
0.28% src/config.c
568
61.65
-0.0% src/api.c
Jobs
ID Job ID Ran Files Coverage
1 No systemd Functional Tests - 22956879275.1 11 Mar 2026 02:14PM UTC 28
46.66
GitHub Action Run
2 Sudo Tests - 22956879275.2 11 Mar 2026 02:14PM UTC 37
31.69
GitHub Action Run
3 Container Tests - 22956879275.3 11 Mar 2026 02:14PM UTC 28
35.53
GitHub Action Run
4 No Container Tests - 22956879275.4 11 Mar 2026 02:14PM UTC 37
37.39
GitHub Action Run
5 Unit Tests - 22956879275.5 11 Mar 2026 02:13PM UTC 37
11.11
GitHub Action Run
Source Files on build 22956879275
  • Tree
  • List 39
  • Changed 6
  • Source Changed 0
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 9bd62ff3 on github
  • Prev Build on test (#22781467195)
  • Next Build on test (#22957196270)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc