Skip to content

apt_dpkg: fix GDB command for amd64 sandbox on non-amd64#600

Open
bdrung wants to merge 2 commits into
canonical:mainfrom
bdrung:fix-search-paths-2150427
Open

apt_dpkg: fix GDB command for amd64 sandbox on non-amd64#600
bdrung wants to merge 2 commits into
canonical:mainfrom
bdrung:fix-search-paths-2150427

Conversation

@bdrung
Copy link
Copy Markdown
Member

@bdrung bdrung commented Apr 27, 2026

test_retrace_jammy_sandbox fails on non-amd64 (e.g. on arm64):

$ pytest tests/system/test_apport_retrace.py::test_retrace_jammy_sandbox
[...]
/usr/lib/python3.14/subprocess.py:578: CalledProcessError
--------------------------- Captured stdout call ---------------------------
Get:1 http://de.archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:2 http://de.archive.ubuntu.com/ubuntu jammy/main Sources [1340 kB]
Get:3 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1395 kB]
Get:4 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 Components [423 kB]
Get:5 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 c-n-f Metadata [30.3 kB]
Fetched 3458 kB in 0s (0 B/s)
Fetched 0 B in 0s (0 B/s)
Extracting downloaded debs...
dynamically loaded /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 needs package libc6, queueing
dynamically loaded /usr/lib/x86_64-linux-gnu/libc.so.6 needs package libc6, queueing
Installing extra package coreutils to get ExecutablePath
Get:1 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 libc6 amd64 2.35-0ubuntu3 [3235 kB]
Get:2 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 coreutils amd64 8.32-4.1ubuntu1 [1438 kB]
Get:3 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 libc6-dbg amd64 2.35-0ubuntu3 [13.9 MB]
Get:4 [6087 kB]
Fetched 24.7 MB in 0s (0 B/s)
Extracting downloaded debs...
--------------------------- Captured stderr call ---------------------------
ERROR: [Errno 2] No such file or directory: '/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2'

Avoid calling binaries from other architectures to determine the library search path. So add a hard-coded mapping from the Debian architecture to the multi-arch triplet instead.

Extent get_library_paths to take an optional architecture parameter which returns the default value from ld.so.

The dpkg-dev dependency can be dropped for the integration tests, because dpkg-architecture is not called any more.

Bug: https://launchpad.net/bugs/2150427

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.53%. Comparing base (b24ed44) to head (2c69dc5).

Files with missing lines Patch % Lines
apport/report.py 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #600      +/-   ##
==========================================
- Coverage   84.54%   84.53%   -0.02%     
==========================================
  Files         104      104              
  Lines       21028    21013      -15     
  Branches     3219     3216       -3     
==========================================
- Hits        17779    17763      -16     
  Misses       2809     2809              
- Partials      440      441       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

bdrung added 2 commits April 29, 2026 17:56
`test_retrace_jammy_sandbox` fails on non-amd64 (e.g. on arm64):

```
$ pytest tests/system/test_apport_retrace.py::test_retrace_jammy_sandbox
[...]
/usr/lib/python3.14/subprocess.py:578: CalledProcessError
--------------------------- Captured stdout call ---------------------------
Get:1 http://de.archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:2 http://de.archive.ubuntu.com/ubuntu jammy/main Sources [1340 kB]
Get:3 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1395 kB]
Get:4 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 Components [423 kB]
Get:5 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 c-n-f Metadata [30.3 kB]
Fetched 3458 kB in 0s (0 B/s)
Fetched 0 B in 0s (0 B/s)
Extracting downloaded debs...
dynamically loaded /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 needs package libc6, queueing
dynamically loaded /usr/lib/x86_64-linux-gnu/libc.so.6 needs package libc6, queueing
Installing extra package coreutils to get ExecutablePath
Get:1 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 libc6 amd64 2.35-0ubuntu3 [3235 kB]
Get:2 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 coreutils amd64 8.32-4.1ubuntu1 [1438 kB]
Get:3 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 libc6-dbg amd64 2.35-0ubuntu3 [13.9 MB]
Get:4 [6087 kB]
Fetched 24.7 MB in 0s (0 B/s)
Extracting downloaded debs...
--------------------------- Captured stderr call ---------------------------
ERROR: [Errno 2] No such file or directory: '/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2'
```

Avoid calling binaries from other architectures to determine the library
search path. So add a hard-coded mapping from the Debian architecture to
the multi-arch triplet instead.

Extent `get_library_paths` to take an optional `architecture` parameter
which returns the default value from ld.so.

The dpkg-dev dependency can be dropped for the integration tests,
because `dpkg-architecture` is not called any more.

Bug: https://launchpad.net/bugs/2150427
The method `get_native_multiarch_triplet` was introduced in commit
bd9e862 ("report: gdb_command: don't hardcode the GNU triplet for
the search paths"). `get_native_multiarch_triplet` and `gdb_command` do
not use this method any more. Therefore `get_native_multiarch_triplet`
can be dropped.
@bdrung bdrung force-pushed the fix-search-paths-2150427 branch from a9bb09f to 2c69dc5 Compare April 29, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant