qemu uncaught target signal 11 when running dpkg --configure libc-bin - docker

When running a docker container (arm64v8/aarch64) on my host machine (amd64) and trying to install/configure libc-bin on a debian container, it gives me the following error:
[ cut for size, full log at https://pastebin.com/7ZtvqZsD ]
#6 18.65 Setting up libc-bin (2.31-13+deb11u3) ...
#6 18.92 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#6 19.03 Segmentation fault (core dumped)
#6 19.06 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#6 19.15 Segmentation fault (core dumped)
#6 19.15 dpkg: error processing package libc-bin (--configure):
#6 19.15 installed libc-bin package post-installation script subprocess returned error exit status 139
#6 19.20 Errors were encountered while processing:
#6 19.20 libc-bin
#6 19.31 E: Sub-process /usr/bin/dpkg returned an error code (1)
------
executor failed running [/bin/sh -c apt-get -y reinstall libc-bin]: exit code: 100
Minimal reproducible example
FROM arm64v8/debian
RUN apt-get -y update
RUN apt-get -y reinstall libc-bin
Versions
$ qemu-system-aarch64 --version # installed via pacman -S qemu-full
QEMU emulator version 7.0.0
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developer
$ qemu-system-arm --version # installed via pacman -S qemu-full
QEMU emulator version 7.0.0
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developer
$ docker --version
Docker version 20.10.17, build 100c70180f
## Binfmt extensions installed with
docker run --privileged --rm tonistiigi/binfmt --install all &
$ uname -a
Linux <hostname> 5.18.7-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Sat, 25 Jun 2022 20:22:03 +0000 x86_64 GNU/Linux
## OS
Arch linux
Prior reading
(a.k.a. please don't mark my question as duplicates of these, it is distinct from them)
qemu: uncaught target signal 11 (Segmentation fault) - core dumped in docker containers
None of these answers work for me, I'm running the latest qemu in the arch linux repos, arm64v8/debian is not a deprecated container image as far as I can tell, and I'm not using docker-for-mac. Plus, this question regards the opposite direction (amd64 containers on arm64).
qemu: uncaught target signal 11 (Segmentation fault)
Issue doesn't stem from git, so this question's answer isn't helpful.
qemu-arm qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Not helpful either, I've tried using qemu-user-static v7.0.0 (both compiled and -bin) which didn't fix my issue either. Not sure what the TCG interpreter is, so that could possibly be the issue, but I'm not familiar enough with qemu to know how to "disable the TCG interpreter".
qemu uncaught target signal 11 segmentation fault -- only on arm64 build
My kernel is 5.18.7-zen1-1-zen which is newer than the 5.10.0-8 that the answer suggests, and is the latest available on arch linux repos at time of writing.
qemu: uncaught target signal 11 (Segmentation fault) - core dumped, when trying to return a struct
Answers all related to C, which I'm not using.
Goal
My ultimate goal is to build a root filesystem using multistrap to eventually be put on an arm64 device, but this issue is preventing me from doing pretty much anything, as running dpkg --configure -a is one of the steps that has to be run from the very start.

After bashing my head against this wall for weeks, the solution I found was:
Use a native docker container instead of an architecture-based one
e.g. FROM debian:11 instead of FROM arm64v8/debian:11
Install qemu-user-static inside the docker container
e.g. apt install qemu-user-static
Copy qemu-aarch64-static to the rootfs
e.g. cp $(which qemu-aarch64-static) /rootfs_location/usr/bin/qemu-aarch64 (note the filename change as well)
Chroot normally
e.g. chroot /rootfs_location/
I'm not sure exactly why this works, but it likely stems from an incompatibility between debian and the qemu-user-static binaries that were compiled for arch linux (or whatever OSes happen to be used) but i'm not entirely sure of that.

Related

While installing Jenkins on Raspberry Pi 4B (sed: -e expression 1st row, 65th character: invalid contrast character)

I am using Ubuntu 22.04 version on my Raspberry Pi 4B(RAM 8GB).
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
I tried to install Jenkins here and set it up, but if I do installation, the following error is confirmed.
$ sudo apt-get install -y jenkins
Reading package list... Completion
Creating dependency tree... Completion
Reading status information... Completion
We will install the next new package:
jenkins
Zero upgrades, one fresh installation, zero removal, and seven upgrades.
You must receive 0 bytes/92.9 M bytes of archive.
After this operation, 93.6 M bytes of disk space will be used.
Selecting previously unselected package jenkins.
(Reading database...)There are currently 224160 files and directories installed.)
Preparing to unpack .../jenkins_2.375.1_all.deb ...
Unpacking jenkins (2.375.1) ...
Setting jenkins (2.375.1)...
sed: -e expression 1st row, 65th character: invalid contrast character
Created symlink /etc/systemd/system/multi-user.target.wants/jenkins.service → /lib/systemd/system/jenkins.service.
Job for jenkins.service failed because a timeout was exceeded.
See "systemctl status jenkins.service" and "journalctl -xeu jenkins.service" for details.
invoke-rc.d: initscript jenkins, action "start" failed.
● ● jenkins.service - Jenkins Continuous Integration Server
Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: timeout) since Thu 2022-12-15 22:49:44 KST; 24ms ago
Process: 459913 ExecStart=/usr/bin/jenkins (code=exited, status=143)
Main PID: 459913 (code=exited, status=143)
Status: "Jenkins stopped"
CPU: 3min 20.145s
dpkg: error processing package jenkins (--configure):
installed jenkins package post-installation script subprocess returned error exit status 1
There was an error processing:
jenkins
E: Sub-process /usr/bin/dpkg returned an error code (1)
I've tried many things, but I haven't found an answer yet.
If anyone has experienced or solved a similar phenomenon, could you tell me how to solve it?
① I deleted the package and reinstalled it, ② deleted the apt or dpkg cache, and tried to reinstall it, but the same error continues to appear.
In addition, ③ the same error occurs when performing the same operation after rebooting, and if force the Jenkins service to start while installed as above, java accounts for 99% of the CPU and waits indefinitely as shown.
As CPU occupancy continues, Jenkins moves to Bad Message 431.

RTL8188FU driver couldn't be installed because of a missing kernel tree module?

I am relatively new to Arch Linux.
So i have been dealing with this issue for quite a long time now. I got this new RTL8188FTV wireless USB network adapter and i have tried installing the drivers for it with Paru AUR helper. The installation seems to fail, as it throws this error at the end :
==> ERROR: Missing 5.15.70-1-lts kernel modules tree for module 8188fu/r112.89d7288.
I can confirm the wireless adapter is functional, since it works on Windows
Package Name: 8188fu-kelebek333-dkms-git
Is there a way to install this "kernel modules tree" so i could finish the installation?
Thanks!
Edit: back with more errors
Building module:
Cleaning build area...
'make' all KVER=6.0.5-arch1-1.............(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.0.5-arch1-1 (x86_64)
Consult /var/lib/dkms/8188fu/r113.f5df53d/build/make.log for more information.
error: command failed to execute correctly
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Install DKMS modules
==> dkms install --no-depmod 8188fu/r113.f5df53d -k 6.0.5-arch1-1
Error! Bad return status for module build on kernel: 6.0.5-arch1-1 (x86_64)
Consult /var/lib/dkms/8188fu/r113.f5df53d/build/make.log for more information.
==> WARNING: `dkms install --no-depmod 8188fu/r113.f5df53d -k 6.0.5-arch1-1' exited 10
==> ERROR: Missing 5.15.75-1-lts kernel modules tree for module 8188fu/r113.f5df53d.
(3/3) Performing snapper post snapshots for the following configurations...
The command
echo 'alias usb:v0BDApF179d*dc*dsc*dp*icFFiscFFipFFin* rtl8188fu' | sudo tee /etc/modprobe.d/r8188eu-blacklist.conf
doesn't seem to do much.
Installation still fails.
Your on kernel 5.15 so you have to backlist the rl8188eu driver. You can do that with this command
echo 'alias usb:v0BDApF179d*dc*dsc*dp*icFFiscFFipFFin* rtl8188fu' | sudo tee /etc/modprobe.d/r8188eu-blacklist.conf
The code was taken from the same repo the aur package was made from
https://github.com/kelebek333/rtl8188fu

How to solve this build error on Linux when building libsodium

I'm trying to build libsodium-sys dependency in an Azure Docker VM which is based on debian.
Have spend a couple of hours trying to fix this build error, but can't figure out what's going on.
I fixed a couple of build errors by installing missing dependencies as the Azure Docker VM seems very vanilla. Executed commands are below the error.
error: failed to run custom build command for `libsodium-sys v0.2.6 (https://github.com/cjdelisle/sodiumoxide?rev=76dc0e6e587b8c8a4bb193ebba9f8ae8f090b81b#76dc0e6e)`
Caused by:
process didn't exit successfully: `/home/packetcrypt_rs/target/release/build/libsodium-sys-169018138a0de36b/build-script-build` (exit code: 101)
checking for working alloca.h... yes
checking for alloca... yes
...
Making check in builds
--- stderr
/bin/bash: line 20: cd: builds: No such file or directory
make: *** [Makefile:516: check-recursive] Error 1
thread 'main' panicked at '
Failed to build libsodium using "make" "check" "-j4"
', /root/.cargo/git/checkouts/sodiumoxide-9b8c3ad42446e2d9/76dc0e6/libsodium-sys/build.rs:281:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
root#2d0a725cde47:/home/packetcrypt_rs#
Build.rs file it's talking about: https://github.com/sodiumoxide/sodiumoxide/blob/master/libsodium-sys/build.rs
Executed commands:
apt get-update
apt-get install pkg-config
apt install apt-utils
apt install file
apt install gcc git
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
apt install make
apt install build-essential gcc-multilib -y
rustup target add armv7-unknown-linux-gnueabihf
git clone https://github.com/cjdelisle/packetcrypt_rs
cd packetcrypt_rs
~/.cargo/bin/cargo build --release
The cause seems related to the issue explained here: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/1379#note_280986944
For reasons unbeknownst to me, these are the commands I needed to execute to fix it:
rm ~/.bashrc
rm ~/.profile

I can't get Docker installed on Debian 8 Jessie

I'm trying to get Docker installed on a machine with Debian 8 (Jessie), but I always seem to run into errors no matter what I try.
Using these instructions: https://docs.docker.com/install/linux/docker-ce/debian
Checking the kernal:
uname -r
3.16.0-4-686-pae
The fateful moment:
sudo apt-get install docker-ce
Setting up docker-ce (18.06.1~ce~3-0~debian) …
Installing new version of config file /etc/bash_completion.d/docker …
Job for docker.service failed. See ‘systemctl status docker.service’ and ‘journalctl -xn’ for details.
invoke-rc.d: initscript docker, action “start” failed.
dpkg: error processing package docker-ce (–configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.19-18+deb8u10) …
Errors were encountered while processing:
docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)
I also tried installing directly from a package: https://download.docker.com/linux/debian/dists/jessie/pool/stable/amd64/
(Selecting version 17.03.2)
And after installing the dependencies, things still don't work:
sudo dpkg --install docker-ce_17.03.2_ce-0_debian-jessie_amd64.deb
(Reading database ... 169325 files and directories currently installed.)
Preparing to unpack docker-ce_17.03.2_ce-0_debian-jessie_amd64.deb ...
Unpacking docker-ce (17.03.2~ce-0~debian-jessie) over (17.03.2~ce-0~debian-jessie) ...
Setting up docker-ce (17.03.2~ce-0~debian-jessie) ...
Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript docker, action "start" failed.
dpkg: error processing package docker-ce (--install):
subprocess installed post-installation script returned error exit status 1
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for systemd (215-17+deb8u7) ...
Errors were encountered while processing:
docker-ce
I also looked at this article: http://www.boynux.com/docker-jessie/
But I didn't even get past the first step:
curl https://get.docker.com | sh
Either your platform is not easily detectable or is not supported by this
installer script.
Please visit the following URL for more detailed installation instructions:
https://docs.docker.com/engine/installation/
Between every one of these attempts I did a
sudo apt-get remove docker docker-engine docker.io docker-ce
sudo apt-get update
docker-ce isn't available for i686
see OS requirements
Docker CE is supported on both x86_64 (or amd64) and armhf architectures for Jessie and Stretch.

asm/socket.h: No such file or directory cross compiling Dart for Raspberry pi

I'm cross-compiling the Dart runtime using the instruction here.
I've installed all the dependencies as specified. I've also cloned the git repository with the necessary tool chain.
I'm running the runtime compilation with this command:
./tools/build.py -m release -a arm --toolchain=../tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf runtime
The compilation starts with no problem then it stops with this error:
LINK(target) out/ReleaseXARM/libdart_dependency_helper.target
CXX(host) out/ReleaseXARM/obj.host/libdart_lib_withcore/runtime/vm/bootstrap.o
In file included from /usr/include/sys/socket.h:38:0,
from /usr/include/netinet/in.h:23,
from /usr/include/arpa/inet.h:22,
from runtime/platform/globals.h:56,
from runtime/platform/assert.h:16,
from runtime/vm/allocation.h:8,
from runtime/vm/bootstrap.h:9,
from runtime/vm/bootstrap.cc:5:
/usr/include/bits/socket.h:345:24: fatal error: asm/socket.h: No such file or directory
#include <asm/socket.h>
^
compilation terminated.
CXX(host) out/ReleaseXARM/obj.host/libdart_lib_withcore/gen/async_gen.o
In file included from /usr/include/sys/socket.h:38:0,
from /usr/include/netinet/in.h:23,
from /usr/include/arpa/inet.h:22,
from runtime/platform/globals.h:56,
from runtime/platform/assert.h:16,
from runtime/vm/allocation.h:8,
from runtime/vm/bootstrap.h:9,
from out/ReleaseXARM/obj/gen/async_gen.cc:5:
/usr/include/bits/socket.h:345:24: fatal error: asm/socket.h: No such file or directory
#include <asm/socket.h>
^
compilation terminated.
runtime/libdart_lib_withcore.host.mk:978: recipe for target 'out/ReleaseXARM/obj.host/libdart_lib_withcore/runtime/vm/bootstrap.o' failed
make: *** [out/ReleaseXARM/obj.host/libdart_lib_withcore/runtime/vm/bootstrap.o] Error 1
make: *** Waiting for unfinished jobs....
runtime/libdart_lib_withcore.host.mk:986: recipe for target 'out/ReleaseXARM/obj.host/libdart_lib_withcore/gen/async_gen.o' failed
make: *** [out/ReleaseXARM/obj.host/libdart_lib_withcore/gen/async_gen.o] Error 1
BUILD FAILED
Am I missing any dependency or package?
I hit the same problem. On my ubuntu 14.04 system /usr/include/asm didn't exist. It was called asm-generic instead. I sym-linked it and the build was able to continue.
cd /usr/include
sudo ln -s asm-generic/ asm
The build was able to continue after that.
This is probably because you're trying to build an application without some of the include paths correctly set, for example using a 32-bit gcc on a 64-bit platform.
To resolve:
sudo apt-get install gcc-multilib
I'm not sure why this happens, but sometimes /usr/include/asm gets deleted. My teammates who looked at their Ubuntu x86-64 workstations found that the asm symlink was:
0 lrwxrwxrwx 1 root root 20 May 22 2013 /usr/include/asm -> x86_64-linux-gnu/asm
And the command to recreate it is:
$ cd /usr/include
$ sudo ln -s x86_64-linux-gnu/asm asm
The files in /usr/include/asm-generic are sometimes, but not always, equivalent to the files in the x86-64 specific directory; so it's difficult to recommend symlinking it as a workaround.

Resources