FS#11014 - Uvesafb stopped working in 2.6.26 because of v86_klibc segfault

Attached to Project: Arch Linux
Opened by Xavier (shining) - Sunday, 27 July 2008, 09:39 GMT
Last edited by Roman Kyrylych (Romashka) - Monday, 26 January 2009, 11:14 GMT
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To Thomas Bächler (brain0)
Architecture All
Severity Low
Priority Normal
Reported Version None
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 6
Private No

Details

Description:
The uvesafb module fails to initialize at boot because v86_kblic fails to start. It always segfault.

$ /sbin/v86d_klibc
$ dmesg | grep v86d
v86d_klibc[4236]: segfault at 8049ffc ip 08049a04 sp bfa5c800 error 7 in v86d_klibc[8048000+2000]

Package versions :
v86d 0.1.5.2-1
kernel26 2.6.26-2
klibc 1.5-6

I also tried the latest v86d 0.1.6, but it did not help.

Steps to reproduce:
1) Upgrade to testing packages
2) Follow the instructions to enable uvesafb/v86d :
http://wiki.archlinux.org/index.php/Uvesafb#V86d

Workaround and questions :
The v86d package provides 2 binaries : a v86d one using shared lib, and a static v86d_klibc.
Only v86d_klibc segfaults, v86d works fine.
But the /lib/initcpio/install/v86d file specifies both :
add_binary "/sbin/v86d_klibc" "/sbin/v86d"
I removed the klibc one :
add_binary "/sbin/v86d"
And regenerated the initcpio image, and now, everything works perfectly, I can't notice any drawbacks.

So what is the point of that v86d_klibc static bin?
This task depends upon

Closed by  Roman Kyrylych (Romashka)
Monday, 26 January 2009, 11:14 GMT
Reason for closing:  Fixed
Comment by Samed Beyribey (ras0ir) - Friday, 15 August 2008, 19:52 GMT
I can confirm same issue.
I've replaced add_binary "/sbin/v86d_klibc" "/sbin/v86d" with add_binary "/sbin/v86d" and it works fine now.
v86d_klibc segfaults.
Comment by Nicolas Doualot (slubman) - Thursday, 21 August 2008, 09:30 GMT
The workaround solve the problem on 3 comps here (1 x86_64 and 2 i686).
Comment by Thomas Bächler (brain0) - Thursday, 21 August 2008, 10:04 GMT
That workaround is stupid, it will enlarge your initramfs considerably. You _must_ upgrade to 0.1.5.2 from extra.

But upgrading is not enough, you _must_ also generate a new initramfs image (mkinitcpio -p kernel26) after the update. Unfortunately, pacman will update v86d after kernel26 has been updated, so this is not done automatically during update. The old version of v86d_klibc (<0.1.5.2) will segfault, however the new version will not segfault.

Again, adding v86d instead of v86d_klibc is a bad idea and will give you a much bigger initramfs image.
Comment by Nicolas Doualot (slubman) - Thursday, 21 August 2008, 11:00 GMT
I have the v86d from extra, I have generated a new initramfs, and the default config segfault, but replacing the add_binary line, result in a bigger image, but this time, v86d doesn't segfault

To be exact, what I've done:

pacman -S v86d
mkinitcpio -p kernel26
reboot
... v86d segfault

after this reboot
replaced add_binary "/sbin/v86d_klibc" "/sbin/v86d" with add_binary "/sbin/v86d"
mkinitcpio -p kernel26
reboot
... v86d doesn't segfault.
Comment by Thomas Bächler (brain0) - Thursday, 21 August 2008, 11:12 GMT
That is very weird. I had a segfault problem with older versions only, the 0.1.5.2 package works fine here and never segfaults. What architecture is it that you use?
Comment by Nicolas Doualot (slubman) - Thursday, 21 August 2008, 11:18 GMT
I try this on a i686 box.
Comment by Thomas Bächler (brain0) - Thursday, 21 August 2008, 11:24 GMT
I only tested this in x86_64 so far, are there any positive reports for i686?
Comment by Xavier (shining) - Thursday, 21 August 2008, 11:53 GMT
Oh I see, I misunderstood what add_binary did.
I thought add_binary "/sbin/v86d_klibc" "/sbin/v86d" added both v86d_klibc and v86d, while in fact it installs v86d_klibc as v86d.
When the real v86d bin is added, it also has to pull libc and some other libs which indeed cause a huge size (from 0.5M to 1.3M)
It didn't make sense to install both anyway... But that should explain my confusion in the bug report, sorry for that.

Anyway, there is apparently a problem with v86d and klibc on 686.
Comment by Nicolas Doualot (slubman) - Friday, 22 August 2008, 08:56 GMT
I try this on a i686 box.
Comment by Lee.MaRS (leemars) - Wednesday, 27 August 2008, 18:30 GMT
I tried this on an i686 box tonight and had same problem.

Package versions :
v86d 0.1.5.2-1
kernel26 2.6.26-3
klibc 1.5-6
Comment by Marc Twain (TB2) - Sunday, 07 September 2008, 21:15 GMT
citing from here:
http://linux.derkeiler.com/Mailing-Lists/Kernel/2008-05/msg00136.html

"Looked at this a bit more..
v86d emulator seems to be hardcoding
mem_bios as 0x0a0000 - 0x10ffef

And mmaping the whole address and may be doing read write in that range
during the emulation.
But, as per e820 0x100000 onwards is usable memory and may be getting
used by kernel. So, surely there is some conflict here.

I am not sure whether it is the BIOS that is giving wrong E820 info or
is it the v86d emulator making assumption about this address wrongly.
One workaround is to make upto 0x10ffef as reserved and make kernel not
use it. But, we should really know why this problem is happening in the
first place, before going the workaround route.

Thanks,
Venki"
Comment by Thomas Bächler (brain0) - Sunday, 14 September 2008, 22:58 GMT
The reason for the crash seems to be an asm bug in klibc! We could either patch one line of code or update to klibc 1.5.12, which is not a version marked as "Stable" by the klibc team. I'll look at it and report back here.
Comment by Thomas Bächler (brain0) - Thursday, 18 September 2008, 16:49 GMT
There are new packages in testing. Please read the instructions here: http://archlinux.org/pipermail/arch-dev-public/2008-September/008126.html and report if v86d works again.
Comment by Lee.MaRS (leemars) - Friday, 19 September 2008, 09:23 GMT
It works on my i686 box.
Comment by Nicolas Doualot (slubman) - Sunday, 21 September 2008, 08:23 GMT
I can also confirm it works fine on my i686 boxes now.
Comment by Samed Beyribey (ras0ir) - Sunday, 21 September 2008, 14:42 GMT
It works on my i686.
Comment by Zygfryd Homonto (zyghom) - Friday, 31 October 2008, 18:29 GMT
  • Field changed: Percent Complete (100% → 0%)
in 2.6.27 second file segfaults:
sudo /sbin/v86d
Segmentation fault
Comment by Thomas Bächler (brain0) - Monday, 03 November 2008, 12:14 GMT
I don't think calling /sbin/v86d directly is supposed to work at all.
Comment by Swift Geek (swiftgeek) - Monday, 19 January 2009, 00:34 GMT
add v86d hook after udev or farther
Comment by Thomas Bächler (brain0) - Monday, 19 January 2009, 10:50 GMT
1) v86d should work directly after the "base" hook, before udev
2) the latest v86d from extra fixes another weird segfault bug, should work better now.

Loading...