vivier / qemu-m68k

Other
40 stars 6 forks source link

aptitude crashes with 'qemu:handle_cpu_signal received signal outside vCPU context' #38

Closed glaubitz closed 3 years ago

glaubitz commented 5 years ago

Recent changes have introduced a regression when running aptitude on qemu-m68k, crashing with:

qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x6019a64f
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x601b393b

See https://buildd.debian.org/status/fetch.php?pkg=elinks&arch=m68k&ver=0.13%7E20190125-1&stamp=1549095796&raw=0 for a sample build log.

I initially thought this to be a regression in qemu because the problem just showed up recently but it also shows with older qemu versions which used to work fine in the past, so I assume something changed in aptitude which is now causing the problem.

Reproducer is simple after installing aptitude:

(sid-m68k-sbuild)root@nofan:/# aptitude -y --without-recommends -o Dpkg::Options::=--force-confold -o Aptitude::CmdLine::Ignore-Trust-Violations=false -o Aptitude::ProblemResolver::StepScore=100 -o Aptitude::ProblemResolver::SolutionCost="safety, priority, non-default-versions" -o Aptitude::ProblemResolver::Hints::KeepDummy="reject sbuild-build-depends-core-dummy :UNINST" -o Aptitude::ProblemResolver::Keep-All-Level=55000 -o Aptitude::ProblemResolver::Remove-Essential-Level=maximum install vim
Warning: Invalid locale (please review locale settings, this might lead to problems later):
  locale::facet::_S_create_c_locale name not valid
The following NEW packages will be installed:
  libgpm2{a} vim vim-common{a} vim-runtime{a} xxd{a} 
0 packages upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 7192 kB/7226 kB of archives. After unpacking 33.4 MB will be used.
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x6010900d
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x601221c9
Segmentation fault
(sid-m68k-sbuild)root@nofan:/#
glaubitz commented 5 years ago

Still reproduces with upstream git commit f34edbc760b0f689deddd175fc08732ecb46665f.

srd424 commented 4 years ago

This looks the same as https://bugs.launchpad.net/qemu/+bug/1594394, in which case I think it's fixed in qemu 5.0.0+?

glaubitz commented 4 years ago

I need to verify that. Thanks for the pointer.

srd424 commented 4 years ago

https://hub.docker.com/r/multiarch/ubuntu-core turned out to be a quick way of testing my use case .. I think they've got debian images as well!

glaubitz commented 4 years ago

No worries, I have more than enough possibilities for testing :). I'm one of the main maintainers behind Debian Ports.

iam-TJ commented 3 years ago

Was a fix for this found? I've just hit it on an amd64 Ubuntu 20.04 host with qemu-user-static 1:4.2-3ubuntu6.10 with an aarch64 chroot of debian trying to do a buster > sid upgrade:

mkdir debian-buster-aarch64
sudo debootstrap --arch=arm64 --foreign buster debian-buster-aarch64 http://deb.debian.org/debian
sudo cp -a /usr/bin/qemu-aarch64-static debian-buster-aarch64/usr/bin/
sudo chroot debian-buster-aarch64 debootstrap/debootstrap --second-stage
sudo chroot debian-buster-aarch64 apt install locales
sudo chroot debian-buster-aarch64 dpkg-reconfigure locales
sudo chroot debian-buster-aarch64 update-locale en_GB.UTF-8

sudo cp -a debian-buster-aarch64 debian-sid-aarch64
sudo sed -i 's/buster/sid/g' debian-sid-aarch64/etc/apt/sources.list
sudo chroot debian-sid-aarch64 apt update
sudo chroot debian-sid-aarch64 aptitude full-upgrade
...
Need to get 110 MB of archives. After unpacking 195 MB will be used.
Do you want to continue? [Y/n/?] y
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x6027796c
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x60001a4e
glaubitz commented 3 years ago

Yes, it's fixed on the latest versions of qemu (currently testing git master). Your version (4.2) is rather old which is why you are still seeing this bug.

I'm closing the bug here because upstream fixed the issue on git master.

iam-TJ commented 3 years ago

Thanks for that - do you know which commit fixed it? I can then get it cherry-picked into Ubuntu to fix the package in the long term support release.

glaubitz commented 3 years ago

Not sure, but I think it was this one: http://patchwork.ozlabs.org/project/qemu-devel/patch/1456850240-21096-1-git-send-email-peter.maydell@linaro.org/

In doubt, ask on the qemu-devel mailing list.

peeweep commented 3 years ago

@glaubitz Thank you! Confirmed this commit work on debian qemu-3.1+dfsg-1 .