Debian Patches

Status for babeltrace/1.5.11-6

Patch Description Author Forwarded Bugs Origin Last update
fix-clean-bison-files.patch Add the bison generated files to maintainer clean files so they are not deleted
on a make distclean.
no
0001-Fix-Hurd-compat-for-PATH_MAX.patch [PATCH babeltrace] Fix: Hurd compat for PATH_MAX Michael Jeanson <mjeanson@efficios.com> no 2016-07-08
cross.patch Fix the elfutils check to work with cross-compilation. no
fix-pkgconfig-private-requires.patch Remove superfluous pkgconfig private requires. no
Fix-handle-NULL-list-pointer-to-avoid-Python-segfaul.patch [PATCH 1/2] Fix: handle NULL list pointer to avoid Python segfault
Before a change in SWIG 4.3.0 [0], `AppendOutput(Py_None, count_obj)`
returned just `count_obj`, an `int`, when an error happens. That value
is garbage because `*len` (`== count_obj`) is not initialized by
`bt_ctf_get_field_list()` & friends when they return an error (e.g.,
when called for an event scope that does not exist on the event, like
`EVENT_CONTEXT` on an event without per-event context). However, it's
not a `list`, so `if not isinstance(ret, list): return` in
`EventDeclaration.fields_scope()` (and other location) prevents it from
resulting in a crash.

After that change, SWIG returns `[None, count_obj]` (still with garbage
`count_obj`) in this case since it's a non-void return (see the SWIG
commit). This is unfortunately a `list`, so it keeps going, iterates
`range(garbage_count)` and dereferences a `NULL` list pointer.

```
Current thread 0x000073d613434200 [python3] (most recent call first):
File "/usr/lib/python3/dist-packages/babeltrace/babeltrace.py", line 83 in _bt_python_field_one_from_list
File "/usr/lib/python3/dist-packages/babeltrace/babeltrace.py", line 839 in _field_list_with_scope
File "/usr/lib/python3/dist-packages/babeltrace/babeltrace.py", line 719 in field_list_with_scope
File "/usr/lib/python3/dist-packages/babeltrace/babeltrace.py", line 792 in keys
```

See the new Python regression test.

Fix this on the Python caller side: `count` shouldn't be used if the
call failed in the first place. If `[list_ptr, count]` is returned
(always the case in SWIG >=4.3.0), make sure `list_ptr is not None`
before interpreting `count`. The existing checks for
`isinstance(ret, list)` handle SWIG <4.3.0 returning just `count` when
the underlying call fails.

I used Claude Opus 4.7 to identify and fix this issue. I've verified
that this actually resolves the issue.

[0] https://github.com/swig/swig/commit/cd39cf132c96a0887be07c826b80804d7677a701
Christophe Bedard <bedard.christophe@gmail.com> no 2026-04-29
Print-a-clear-error-when-reading-a-CTF-2-trace.patch [PATCH 2/2] Print a clear error when reading a CTF 2 trace
A CTF 2 metadata stream starts with an ASCII RS (0x1e) byte, which
Babeltrace 1.x can't parse as TSDL.

Detect it and fail with a message pointing to Babeltrace 2.1+ instead of
confusing syntax errors.
Philippe Proulx <eeppeliteloop@gmail.com> no 2026-06-04

All known versions for source package 'babeltrace'

Links