Bug 2517408 - libtracefs leaks memory during tracefs_iterate_raw_events()
Summary: libtracefs leaks memory during tracefs_iterate_raw_events()
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: libtracefs
Version: 43
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Zamir SUN
QA Contact:
URL:
Whiteboard:
Depends On: 2359606
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-08-17 12:49 UTC by Tomas Glozar
Modified: 2026-09-05 11:05 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Tomas Glozar 2026-08-17 12:49:24 UTC
Repeatedly calling tracefs_iterate_raw_events() leads to memory being allocated that is not freed until the release of the trace instance.

This affects rtla osnoise and hwnoise tools, which call tracefs_iterate_raw_events() every one second to read events in a loop. On long runs, it will consume all of the system's memory and crash.

Reproducible: Always

Steps to Reproduce:
1. Run the command: `rtla osnoise -c 0` as root.
2. Observe memory usage of the rtla process with `htop` command.
Actual Results:
Memory usage of rtla increases by around 100kB every second.

Expected Results:
Memory usage of rtla stays the same.

Additional Information:
The issue is fixed in upstream libtracefs 1.8.2, likely by commit d49b6fa41ad53fdd8e82dd324e15df9ef7fcd250 ("libtrace: Fix memory leak in tracefs_cpu"; unconfirmed).

The same bug is likely present in Fedora 44, 45, and Rawhide, as they ship the same version of libtracefs. No extra patches are present, version number increases are just from mass rebuilds.

NVRs:
[tglozar@fedora ~]$ rpm -qa rtla
rtla-7.1.3-100.fc43.x86_64
[tglozar@fedora ~]$ rpm -qa libtracefs
libtracefs-1.8.1-3.fc43.x86_64

Note that the Fedora packages are behind CentOS Stream 10, which already ships libtracefs 1.8.2, and does not have the issue.


Note You need to log in before you can comment on or make changes to this bug.