Author Topic: [i686] Virtualbox-guest-modules broken due glibc 2.17 update  (Read 1312 times)

0 Members and 1 Guest are viewing this topic.

Offline philmTopic starter

  • Core Team
  • *****
  • Posts: 5653
    • Manjaro Linux
  • Kernel: Maintainer - so all ;)
  • Desktop: XFCE
  • Branch: Unstable
  • GPU Card: Geforce GTX 650
  • GPU driver: non-free
  • Skill: Guru
Since our last Stable Merge we found out to late that glibc-2.17 update broke virtualbox-guest-modules. This is already reported at Archlinux Bug-Tracker.

The current and only solution is to use VESA driver if you run Manjaro i686 in a Virtualbox Machine. Either install it with Vesa-driver in live-mode F5-Menu or switch to vesa using mhwd:

Code: [Select]
sudo mhwd -r pci video-virtualbox
sudo mhwd -i pci video-vesa

x86_64-architecture seems fine for now.
« Last Edit: 04. April 2013, 14:13:15 by philm »

Offline philmTopic starter

  • Core Team
  • *****
  • Posts: 5653
    • Manjaro Linux
  • Kernel: Maintainer - so all ;)
  • Desktop: XFCE
  • Branch: Unstable
  • GPU Card: Geforce GTX 650
  • GPU driver: non-free
  • Skill: Guru
Re: [i686] Virtualbox-guest-modules broken due glibc 2.17 update
« Reply #1 on: 06. January 2013, 17:17:26 »
Followed packages created those issues:

Code: [Select]
glibc 2.17-1, binutils-2.23.1-2, gcc-4.7.2-3, and gcc-libs-4.7.2-3
Last working packages are:

Code: [Select]
glibc-2.16.0-5, binutils-2.23.1-1, gcc-4.7.2-2, gcc-libs-4.7.2-2
Followed push merged this bug to our stable repos.

Offline philmTopic starter

  • Core Team
  • *****
  • Posts: 5653
    • Manjaro Linux
  • Kernel: Maintainer - so all ;)
  • Desktop: XFCE
  • Branch: Unstable
  • GPU Card: Geforce GTX 650
  • GPU driver: non-free
  • Skill: Guru
Re: [i686] Virtualbox-guest-modules broken due glibc 2.17 update
« Reply #2 on: 06. January 2013, 20:07:44 »
Here we go for the toolchain bump which broke virtualbox-guest-modules on i686:

Code: [Select]
x86_64 Extra valgrind 3.8.1-2 A tool to help find memory-management problems in programs 2012-12-28
i686 Extra valgrind 3.8.1-2 A tool to help find memory-management problems in programs 2012-12-28
x86_64 Core gcc-objc 4.7.2-3 Objective-C front-end for GCC 2012-12-28
x86_64 Core gcc-ada 4.7.2-3 Ada front-end for GCC (GNAT) 2012-12-28
x86_64 Core cloog 0.18.0-1 Library that generates loops for scanning polyhedra 2012-12-28
x86_64 Core glibc 2.17-1 GNU C Library 2012-12-28
x86_64 Core gcc-go 4.7.2-3 Go front-end for GCC 2012-12-28
x86_64 Core gcc-fortran 4.7.2-3 Fortran front-end for GCC 2012-12-28
x86_64 Core gcc-libs 4.7.2-3 Runtime libraries shipped by GCC 2012-12-28
x86_64 Core linux-api-headers 3.7.1-1 Kernel headers sanitized for use in userspace 2012-12-28
x86_64 Core gcc 4.7.2-3 The GNU Compiler Collection - C and C++ frontends 2012-12-28
i686 Core gcc-objc 4.7.2-3 Objective-C front-end for GCC 2012-12-28
i686 Core gcc-ada 4.7.2-3 Ada front-end for GCC (GNAT) 2012-12-28
i686 Core cloog 0.18.0-1 Library that generates loops for scanning polyhedra 2012-12-28
i686 Core glibc 2.17-1 GNU C Library 2012-12-28
i686 Core gcc-go 4.7.2-3 Go front-end for GCC 2012-12-28
i686 Core gcc-fortran 4.7.2-3 Fortran front-end for GCC 2012-12-28
i686 Core gcc-libs 4.7.2-3 Runtime libraries shipped by GCC 2012-12-28
i686 Core linux-api-headers 3.7.1-1 Kernel headers sanitized for use in userspace 2012-12-28
i686 Core gcc 4.7.2-3 The GNU Compiler Collection - C and C++ frontends 2012-12-28
x86_64 Extra tcl 8.6.0-3 The Tcl scripting language 2012-12-28
i686 Extra tcl 8.6.0-3 The Tcl scripting language 2012-12-28

x86_64 seems fine ...

Now here is a working solution to get virtualbox-guest-modules working again:

* install Manjaro with VESA Mode if you haven't already
* add followed repo on top of all your other repos

Code: [Select]

    [vbtoolchain]
    Server=http://master.dl.sourceforge.net/project/manjarodev/packages/i686/


* downgrade your toolchain and install virtualbox-guest-modules

Code: [Select]
[manjaro@manjaro ~]$ sudo pacman -Syy
Warnung: database file for 'vbtoolchain' does not exist
:: Synchronisiere Paketdatenbanken...
 vbtoolchain                5,2 KiB  37,2K/s 00:00 [######################] 100%
 basis-testing             47,9 KiB   359K/s 00:00 [######################] 100%
 platform-testing          97,6 KiB   561K/s 00:00 [######################] 100%
 addon-testing             43,6 KiB   330K/s 00:00 [######################] 100%
 extra-testing           1415,2 KiB  1360K/s 00:01 [######################] 100%
 community-testing       1834,4 KiB   950K/s 00:02 [######################] 100%
[manjaro@manjaro ~]$ sudo pacman -Suu
:: Starting full system upgrade...
warning: gcc-libs: downgrading from version 4.7.2-3 to version 4.7.2-2
warning: glibc: downgrading from version 2.17-1 to version 2.16.0-5
warning: linux-api-headers: downgrading from version 3.7.1-1 to version 3.6.3-1
resolving dependencies...
looking for inter-conflicts...

Targets (4): gcc-libs-4.7.2-2  glibc-2.16.0-5  linux-api-headers-3.6.3-1
             mhwd-db-0.2.2.702-1

Total Download Size:    9.20 MiB
Total Installed Size:   41.90 MiB
Net Upgrade Size:       -0.31 MiB

Proceed with installation? [Y/n]
:: Retrieving packages from vbtoolchain...
 linux-api-headers-3...   616.3 KiB   430K/s 00:01 [######################] 100%
 glibc-2.16.0-5-i686        7.8 MiB   958K/s 00:08 [######################] 100%
 gcc-libs-4.7.2-2-i686    812.5 KiB  1024K/s 00:01 [######################] 100%
:: Retrieving packages from basis-testing...
 mhwd-db-0.2.2.702-1-any    5.2 KiB   115K/s 00:00 [######################] 100%
(4/4) checking package integrity                   [######################] 100%
(4/4) loading package files                        [######################] 100%
(4/4) checking for file conflicts                  [######################] 100%
(4/4) checking available disk space                [######################] 100%
(1/4) upgrading linux-api-headers                  [######################] 100%
(2/4) upgrading glibc                              [######################] 100%
warning: /etc/locale.gen installed as /etc/locale.gen.pacnew
Generating locales...
  de_DE.UTF-8... done
  de_DE.ISO-8859-1... done
  de_DE.ISO-8859-15@euro... done
  en_US.UTF-8... done
  en_US.ISO-8859-1... done
Generation complete.
(3/4) upgrading gcc-libs                           [######################] 100%
(4/4) upgrading mhwd-db                            [######################] 100%
[manjaro@manjaro ~]$ sudo mhwd -a pci free 0300
> Using config 'video-virtualbox' for device: 0000:00:02.0 (0300:80ee:beef) Display controller InnoTek Systemberatung GmbH VirtualBox Graphics Adapter
> Installing video-virtualbox...
:: Synchronizing package databases...
 vbtoolchain is up to date
 basis-testing is up to date
 platform-testing is up to date
 addon-testing is up to date
 extra-testing is up to date
 community-testing is up to date
resolving dependencies...
looking for inter-conflicts...

Targets (2): linux34-virtualbox-guest-modules-4.2.6-1  virtualbox-guest-utils-4.2.6-1

Total Download Size:    1.07 MiB
Total Installed Size:   6.55 MiB

Proceed with installation? [Y/n]
:: Retrieving packages from basis-testing...
downloading linux34-virtualbox-guest-modules-4.2.6-1-i686.pkg.tar.xz...
:: Retrieving packages from community-testing...
downloading virtualbox-guest-utils-4.2.6-1-i686.pkg.tar.xz...
checking package integrity...
loading package files...
checking for file conflicts...
checking available disk space...
installing linux34-virtualbox-guest-modules...
===> You may want to load vboxguest, vboxsf and vboxvideo
installing virtualbox-guest-utils...
Optional dependencies for virtualbox-guest-utils
    virtualbox-guest-dkms: Guest kernel source modules for non-stock kernels
libGl: '/usr/lib/libGL.so.mesa'
libglx: '/usr/lib/xorg/modules/extensions/libglx.xorg'
xorg configuration file: '/etc/X11/mhwd.d/virtualbox.conf'
> Successfully installed video-virtualbox
[manjaro@manjaro ~]$

* reboot your virtualbox machine

Offline philmTopic starter

  • Core Team
  • *****
  • Posts: 5653
    • Manjaro Linux
  • Kernel: Maintainer - so all ;)
  • Desktop: XFCE
  • Branch: Unstable
  • GPU Card: Geforce GTX 650
  • GPU driver: non-free
  • Skill: Guru
Re: [i686] Virtualbox-guest-modules broken due glibc 2.17 update
« Reply #3 on: 11. January 2013, 11:28:03 »
Here is an update to this issue.

A commit into glibc broke virtualbox-guest-modules. The part which creates vboxvideo to crash is followed part:

Code: [Select]
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -2858,23 +2858,10 @@ __libc_malloc(size_t bytes)
     return 0;
   victim = _int_malloc(ar_ptr, bytes);
   if(!victim) {
-    /* Maybe the failure is due to running out of mmapped areas. */
-    if(ar_ptr != &main_arena) {
-      (void)mutex_unlock(&ar_ptr->mutex);
-      ar_ptr = &main_arena;
-      (void)mutex_lock(&ar_ptr->mutex);
+    ar_ptr = arena_get_retry(ar_ptr, bytes);
+    if (__builtin_expect(ar_ptr != NULL, 1)) {
       victim = _int_malloc(ar_ptr, bytes);
       (void)mutex_unlock(&ar_ptr->mutex);
-    } else {
-      /* ... or sbrk() has failed and there is still a chance to mmap()
-        Grab ar_ptr->next prior to releasing its lock.  */
-      mstate prev = ar_ptr->next ? ar_ptr : 0;
-      (void)mutex_unlock(&ar_ptr->mutex);
-      ar_ptr = arena_get2(prev, bytes, ar_ptr);
-      if(ar_ptr) {
-       victim = _int_malloc(ar_ptr, bytes);
-       (void)mutex_unlock(&ar_ptr->mutex);
-      }
     }
   } else
     (void)mutex_unlock(&ar_ptr->mutex);

This got reverted by Allan McRae in followed package:

Code: [Select]
sudo pacman -U http://pkgbuild.com/~allan/glibc-2.17-1.4-i686.pkg.tar.xz
To quote Allan:
Quote from: Allan McRae
If that commit was broken, we be seeing issues all over the place... so leaving as a virtualbox issue.
This means all other apps and tools would have been broken by this. As x86_64 architecture is fine I'll look into the virtualbox vboxvideo source-code and try to find the section which migth be broken by this.

Offline philmTopic starter

  • Core Team
  • *****
  • Posts: 5653
    • Manjaro Linux
  • Kernel: Maintainer - so all ;)
  • Desktop: XFCE
  • Branch: Unstable
  • GPU Card: Geforce GTX 650
  • GPU driver: non-free
  • Skill: Guru
Re: [i686] Virtualbox-guest-modules broken due glibc 2.17 update
« Reply #4 on: 12. January 2013, 18:14:10 »
After talking to  I uploaded glibc-2.17-1.1 to Manjaro-Unstable. If my compile works it get moved to Manjaro-Testing. A new Manjaro Openbox testbuild for i686-only will get uploaded today to confirm my fix for vboxvideo.

Offline philmTopic starter

  • Core Team
  • *****
  • Posts: 5653
    • Manjaro Linux
  • Kernel: Maintainer - so all ;)
  • Desktop: XFCE
  • Branch: Unstable
  • GPU Card: Geforce GTX 650
  • GPU driver: non-free
  • Skill: Guru
Re: [i686] Virtualbox-guest-modules broken due glibc 2.17 update
« Reply #5 on: 14. January 2013, 13:31:10 »
For now we have glibc-2.17-1.1 in our i686 repos to temporary fix this issue. We are still working hard with Allan McRae and Siddhesh Poyarekar to solve this issue:

Quote from: Siddhesh Poyarekar
On Sat, Jan 12, 2013 at 09:08:07AM +0100, Philip Müller wrote:
> Would it be better to revert your whole patch or is it fine just to
> revert only the part Allan digged up?

Just that part should be fine.  If you're paranoid about the
possibility of having other problems that haven't been detected so
far, then revert the whole thing because it is not intended to have
any functional consequences.

> What further information or tests should I do to help you out,
> finding a proper solution with this rare issue.

A reduced reproducer program that demonstrates the problem would be
perfect.

Thanks,
Siddhesh

Quote from: Allan McRae
So...

    if (__builtin_expect(ar_ptr != NULL, 1)) {

that is called in both cases from arena_get_retry.  Originally it was
not called for this part:

if(ar_ptr != &main_arena) {

but looking at the returned pointer, it should never be NULL...   This
is why I concluded it may be virtualbox that has the issue.

Allan

Offline philmTopic starter

  • Core Team
  • *****
  • Posts: 5653
    • Manjaro Linux
  • Kernel: Maintainer - so all ;)
  • Desktop: XFCE
  • Branch: Unstable
  • GPU Card: Geforce GTX 650
  • GPU driver: non-free
  • Skill: Guru
Re: [i686] Virtualbox-guest-modules broken due glibc 2.17 update
« Reply #6 on: 15. January 2013, 03:26:25 »
Allan did another test which showed us that adding an extra check on a NULL pointer is not the issue here:
Quote from: Allan McRae
The
original change added an extra check on a NULL pointer as well as
refactoring the whole thing into a function.  The attached patch reverts
the refactoring but then adds the extra NULL check.  Given the package
produced using it worked, it is not the NULL check in itself that is the
issue.

I am almost completely convinced that this is not a glibc issue, but
rather virtualbox doing something weird with graphics driver.

Allan

Followed patch can be applied to glibc-2.17 until Oracle fixes vboxvideo driver in i686. Still, that driver is fine on x86_64!!!
Code: Bash
  1. --- glibc-2.17/malloc/malloc.c.orig     2012-12-25 04:02:13.000000000 +0100
  2. +++ glibc-2.17/malloc/malloc.c  2013-01-15 03:00:17.023162000 +0100
  3. @@ -2858,10 +2858,25 @@ __libc_malloc(size_t bytes)
  4.      return 0;
  5.    victim = _int_malloc(ar_ptr, bytes);
  6.    if(!victim) {
  7. -    ar_ptr = arena_get_retry(ar_ptr, bytes);
  8. -    if (__builtin_expect(ar_ptr != NULL, 1)) {
  9. -      victim = _int_malloc(ar_ptr, bytes);
  10. +    /* Maybe the failure is due to running out of mmapped areas. */
  11. +    if(ar_ptr != &main_arena) {
  12.        (void)mutex_unlock(&ar_ptr->mutex);
  13. +      ar_ptr = &main_arena;
  14. +      (void)mutex_lock(&ar_ptr->mutex);
  15. +      if (__builtin_expect(ar_ptr != NULL, 1)) {
  16. +        victim = _int_malloc(ar_ptr, bytes);
  17. +        (void)mutex_unlock(&ar_ptr->mutex);
  18. +      }
  19. +    } else {
  20. +      /* ... or sbrk() has failed and there is still a chance to mmap()
  21. +        Grab ar_ptr->next prior to releasing its lock.  */
  22. +      mstate prev = ar_ptr->next ? ar_ptr : 0;
  23. +      (void)mutex_unlock(&ar_ptr->mutex);
  24. +      ar_ptr = arena_get2(prev, bytes, ar_ptr);
  25. +      if(ar_ptr) {
  26. +       victim = _int_malloc(ar_ptr, bytes);
  27. +       (void)mutex_unlock(&ar_ptr->mutex);
  28. +      }
  29.      }
  30.    } else
  31.      (void)mutex_unlock(&ar_ptr->mutex);

Offline philmTopic starter

  • Core Team
  • *****
  • Posts: 5653
    • Manjaro Linux
  • Kernel: Maintainer - so all ;)
  • Desktop: XFCE
  • Branch: Unstable
  • GPU Card: Geforce GTX 650
  • GPU driver: non-free
  • Skill: Guru
Re: [i686] Virtualbox-guest-modules broken due glibc 2.17 update
« Reply #7 on: 24. January 2013, 22:56:45 »
I removed the patched glibc from basis-unstable and added a new xorg-server packages set. Please use sudo pacman -Syyuu to update and downgrade to the right packages in Manjaro-Unstable. We need your feedback on this one.