vivier / qemu-m68k

Other
41 stars 7 forks source link

Unimplemented fmove from control 7 when running uic from qt5 #3

Closed glaubitz closed 7 years ago

glaubitz commented 8 years ago

With git 5e79823 from master-dev, trying to build razorqt in an up-to-date unstable m68k chroot, the build fails when trying to run qt5's user-interface compiler (uic):

cd /<>/obj-m68k-linux-gnu/razorqt-panel/plugin-cpuload && /usr/lib/m68k-linux-gnu/qt4/bin/uic -o /<>/obj-m68k-linux-gnu/razorqt-panel/plugin-cpuload/ui_razorcpuloadconfiguration.h /<>/razorqt-panel/plugin-cpuload/razorcpuloadconfiguration.ui qemu: fatal: Unimplemented: fmove from control 7 qemu: uncaught target signal 11 (Segmentation fault) - core dumped Segmentation fault

Attaching the build log.

The underlying issue has been discussed in a previous private discussion with Michael Karcher:

Le 12/12/2015 16:53, Michael Karcher a écrit :

On 12.12.2015 13:08, Laurent Vivier wrote:

Le 12/12/2015 09:56, John Paul Adrian Glaubitz a écrit :

qt4-x11 [2]:

make[3]: Entering directory '/«BUILDDIR»/qt4-x11-4.8.7+dfsg/src/gui' [...] /«BUILDDIR»/qt4-x11-4.8.7+dfsg/bin/uic dialogs/qpagesetupwidget.ui -o .uic/release-shared/ui_qpagesetupwidget.h qemu: fatal: Unimplemented: fmove from control 7 qemu: uncaught target signal 11 (Segmentation fault) - core dumped Can I have the instruction opcode ?

Valid control register values are only 1, 2, 4, so I assume this instruction is not decoded correctly. It seems that it actually is a bit mask, and 7 means "all of them". Have a look at the gdb output:

(sid-m68k-sbuild)/tmp/qt4-x11-4.8.7+dfsg/src/gui# gdb ../../bin/uic qemu_uic_20151212-154524_27519.core GNU gdb (Debian 7.10-1) 7.10 [...] Core was generated by `../../bin/uic dialogs/qpagesetupwidget.ui -o .uic/release-shared/ui_qpagesetupw'. Program terminated with signal SIGSEGV, Segmentation fault.

0 __GI___feholdexcept (envp=0xf6ffe230) at ../sysdeps/m68k/fpu/feholdexcpt.c:24

24 ../sysdeps/m68k/fpu/feholdexcpt.c: No such file or directory. (gdb) x/5i $pc => 0xf663ab94 <__GI___feholdexcept>: linkw %fp,#0 0xf663ab98 <GIfeholdexcept+4>: moveal %fp@(8),%a0 0xf663ab9c <GIfeholdexcept+8>: fmoveml %fpiar/%fpsr/%fpcr,%a0@ 0xf663aba0 <GIfeholdexcept+12>: moveq #-8,%d0 0xf663aba2 <GIfeholdexcept+14>: notb %d0 (gdb) x/2hx $pc + 8 0xf663ab9c <__GI___feholdexcept+8>: 0xf210 0xbc00 (gdb)

Again, you're right

The documentation says "Moves the contents of a floating-point system control register", not "some"...

razorqt_0.5.2-4_m68k-20160111-1722.build.zip

glaubitz commented 8 years ago

Hi Laurent!

Are there any news on this particular issue? Would be great to have fmove7 implemented so we can build qt on m68k again :).

Adrian

vivier commented 8 years ago

Hi Adrian,

OK, I'm going to have a look at this one :)

I've rebased 680x0-master-dev on latest master that have a lot of improvements for the signal managing in linux-user. Have a try (netlink has also been integrated, revert the involved patches if you have some issues).

glaubitz commented 8 years ago

netlink is still broken, unfortunately:

(sid-m68k-sbuild)root@ikarus:/# apt update && apt -y dist-upgrade && apt-get -y autoremove && apt-get -y autoclean 0% [Working]Unknown target IFA type: 24707 Unknown target IFA type: 24705 Reading package lists... Done E: Method http has died unexpectedly! E: Sub-process http received a segmentation fault. (sid-m68k-sbuild)root@ikarus:/#

glaubitz commented 8 years ago

And simply reverting the three netlink patches doesn't work either :(.

glaubitz commented 8 years ago

Ok, turns out I just had to revert some additional commits to get rid of the netlink stuff.

I have been able to build a new version of qemu-m68k-static now and it has, indeed, improved. Several packages like mariadb-10.0 now build fine without the build process hanging and performance seems to have improved, too.

There are is still an important issue when running xsltproc which is also just dying sometimes, but I'll create a new ticket for that.

glaubitz commented 8 years ago

qt4-x11 now builds fine on m68k [1], I therefore consider this issue resolved!

Great job!

[1] https://buildd.debian.org/status/fetch.php?pkg=qt4-x11&arch=m68k&ver=4%3A4.8.7%2Bdfsg-8&stamp=1466848726

glaubitz commented 8 years ago

Very odd, for some reason this issue was still triggered in one case again [1], despite the update:

[ 96%] Generating ui_lensdialogbase.h cd /«BUILDDIR»/scribus-1.4.6+dfsg/obj-m68k-linux-gnu/scribus/plugins/tools/lenseffects && /usr/lib/m68k-linux-gnu/qt4/bin/uic -o /«BUILDDIR»/scribus-1.4.6+dfsg/obj-m68k-linux-gnu/scribus/plugins/tools/lenseffects/ui_lensdialogbase.h /«BUILDDIR»/scribus-1.4.6+dfsg/scribus/plugins/tools/lenseffects/lensdialogbase.ui qemu: fatal: Unimplemented: fmove from control 7 qemu: uncaught target signal 11 (Segmentation fault) - core dumped Segmentation fault

[1] https://buildd.debian.org/status/fetch.php?pkg=scribus&arch=m68k&ver=1.4.6%2Bdfsg-3&stamp=1467039030

Please keep this issue open some more time.

vivier commented 8 years ago

What I have fixed is the instruction:

0xf663ab9c <__GI___feholdexcept+8>: fmoveml %fpiar/%fpsr/%fpcr,%a0@

which is in fact not a "fmove from control 7".

Is possible to have the coredump to check what is the opcode/instruction that triggers the error?

vivier commented 8 years ago

You should not have this issue as the error message has been removed by the patch:

- cpu_abort(NULL, "Unimplemented: fmove from control %d",

Check you binary, please.

glaubitz commented 8 years ago

Yeah, that's what I thought, too. It worked with qt4-x11, so I will just reschedule the scribus package.

glaubitz commented 8 years ago

Ok, I missed to update one qemu-m68k-static binary on the buildd in question, the versions in the chroot were up-to-date, but not the one in the host system on vs93 (the hostname of the buildd).

scribus built fine on another buildd: https://buildd.debian.org/status/fetch.php?pkg=scribus&arch=m68k&ver=1.4.6%2Bdfsg-3&stamp=1467140229

So this was just a false alarm :).