Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 683640 - app-emulation/qemu fails with "qemu: Unexpected FPU mode" on some (older?) binaries
Summary: app-emulation/qemu fails with "qemu: Unexpected FPU mode" on some (older?) bi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthias Maier
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2019-04-16 19:16 UTC by Daniel Santos
Modified: 2019-05-04 20:11 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix (0001-1825002-fix-mips-Unexpected-FPU-mode.patch,927 bytes, patch)
2019-04-17 14:22 UTC, Daniel Santos
Details | Diff
Add 3.1.0-r5 with patch (0001-app-emulation-qemu-3.1.0-fix-mips-FPU-mode-error.patch,26.11 KB, patch)
2019-04-17 14:58 UTC, Daniel Santos
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Santos 2019-04-16 19:16:43 UTC
This occurs attempting to run any gentoo-mips stage3 under amd64, but appears unrelated to amd64 arch.  I have filed upstream bug and attempted to fix it, but it goes into areas beyond my understanding (of ELF headers and structure).  https://bugs.launchpad.net/qemu/+bug/1825002

A partial work-around is to launch the foreign executable via the foreign ld loader, i.e.

chroot gentoo-mips32r2el /lib/ld-2.19.so /bin/bash -l

However, this does not recuse so anything bash attempts to execute without calling the loader will fail.

This appears to have been introduced by a patch series starting at 3f8e8ac3314c0fcbd19983a81f676ac60d0ca5c8 which was released in 3.1.0.  I *strongly* recommend and request re-adding 3.0.0 to the git repo and further suggest that at least one previous version be kept in the future to prevent people from becoming stranded with a new and broken version.

See Also
https://bugs.launchpad.net/qemu/+bug/1825002
https://stackoverflow.com/questions/55286909/qemu-fpu-mode-error-when-attempting-to-run-mips-binary
Comment 1 Daniel Santos 2019-04-17 14:22:13 UTC
Created attachment 573170 [details, diff]
fix

Sanitizes struct image_info interp_info and initializes default value for FPU mode so that when the ELF program header doesn't specify, we don't end up with whatever was on the stack.
Comment 2 Daniel Santos 2019-04-17 14:58:48 UTC
Created attachment 573172 [details, diff]
Add 3.1.0-r5 with patch

Here, this adds a new qemu revision with patch
Comment 3 Matthias Maier gentoo-dev 2019-04-17 16:07:55 UTC
(In reply to Daniel Santos from comment #2)
> Created attachment 573172 [details, diff] [details, diff]
> Add 3.1.0-r5 with patch
> 
> Here, this adds a new qemu revision with patch

Would you mind posting your patch on the qemu devel mailing list for some initial review?
Comment 4 Daniel Santos 2019-04-17 20:52:58 UTC
(In reply to Matthias Maier from comment #3)
> (In reply to Daniel Santos from comment #2)
> > Created attachment 573172 [details, diff] [details, diff] [details, diff]
> > Add 3.1.0-r5 with patch
> > 
> > Here, this adds a new qemu revision with patch
> 
> Would you mind posting your patch on the qemu devel mailing list for some
> initial review?

Thanks for your reply and done.  https://lists.nongnu.org/archive/html/qemu-devel/2019-04/msg02999.html
Comment 5 Daniel Santos 2019-04-24 07:44:27 UTC
(In reply to Matthias Maier from comment #3)
> Would you mind posting your patch on the qemu devel mailing list for some
> initial review?

The patch is has been reviewed and allegedly committed upstream, although I don't know where they do staging.  Also, qemu 4.0.0 is now released, which does not contain this patch.
Comment 6 Larry the Git Cow gentoo-dev 2019-04-29 06:48:51 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c83a1b469d6e8c77187bf69ad6b74509b3586de3

commit c83a1b469d6e8c77187bf69ad6b74509b3586de3
Author:     Matthias Maier <tamiko@gentoo.org>
AuthorDate: 2019-04-29 03:31:19 +0000
Commit:     Matthias Maier <tamiko@gentoo.org>
CommitDate: 2019-04-29 06:48:45 +0000

    app-emulation/qemu: version bump to 4.0.0
    
     - Version bump to 4.0.0 (bug #684274)
    
     - Apply mips fpu mode fix (bug #683640)
    
     - Bug #683458: Reenable stripping. Remove old CFLAGS workaround. Let's
       see how far this takes us.
    
    Bug: https://bugs.gentoo.org/683458
    Closes: https://bugs.gentoo.org/683640
    Closes: https://bugs.gentoo.org/684274
    Closes: https://github.com/gentoo/gentoo/pull/11719
    Package-Manager: Portage-2.3.64, Repoman-2.3.12
    Signed-off-by: Matthias Maier <tamiko@gentoo.org>

 app-emulation/qemu/Manifest                        |   1 +
 .../files/qemu-4.0.0-sanitize-interp_info.patch    |  32 +
 app-emulation/qemu/qemu-4.0.0.ebuild               | 799 +++++++++++++++++++++
 3 files changed, 832 insertions(+)
Comment 7 Daniel Santos 2019-05-04 20:11:44 UTC
Hi Matthias!

I was doing my bug wrangling and was about to ping this, but I guess I'm not watching my inbox closely enough. Thanks!