Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emerge in VirtualBox fails randomly, but memory is good
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
litan
n00b
n00b


Joined: 13 Aug 2012
Posts: 51

PostPosted: Tue Sep 10, 2013 7:41 pm    Post subject: emerge in VirtualBox fails randomly, but memory is good Reply with quote

I'm trying to install Gentoo as VirtualBox guest on a 32bit host.
I keep getting this message when emerging packages like sys-devel/bc, vixie-cron, or various dependencies of vim:
Code:
* ../../sandbox-2.6/libsandbox/memory.c:free():59: failure (Invalid argument): * sandbox memory corruption with free(0x..bla): Invalid argument)


It pops up here and there in the emerge output of at least the prepare and install and post-install phases and possibly others.
Sometimes merges complete despite these messages, sometimes they fail, and the error message of emerge changes,
but most often I get:
Quote:
"The ebuild phase '%s' has exited
unexpectedly. This type of behavior
is known to be triggered
by things such as failed variable
assignments (bug #190128) or bad substitution
errors (bug #200313). Normally, before exiting, bash should
have displayed an error message above. If bash did not
produce an error message above, it's possible
that the ebuild has called `exit` when it
should have called `die` instead. This behavior may also
be triggered by a corrupt bash binary or a hardware
problem such as memory or cpu malfunction. If the problem is not
reproducible or it appears to occur randomly, then it is likely
to be triggered by a hardware problem.
If you suspect a hardware problem then you should
try some basic hardware diagnostics such as memtest.
Please do not report this as a bug unless it is consistently reproducible and you are sure that your bash binary and hardware are functioning properly."

I did a memtest86 on the guest and one on the host, which both passed without error.
When I try to emerge the packages many times, they eventually succeed and I managed to
complete a full installation, but the resulting system had some weird behaviour like my dhcp client
spontaneously refusing to work, my hostname dissappearing or my root login no longer working.
Most packages fail to emerge.
I also had to do a manual 'make modules' and 'make bzImage' when building the kernel,
because a simple make did not produce those.

I installed Debian as a guest on the same host and this VM works fine.
Also, when doing the Gentoo installation from a Xubuntu liveCD, instead of the current Gentoo minimal installation CD, the same happens.
I tried a round with -march=corei7 and another with -march=i686 (the host has a Core i3), and also tried mixing them up within one system
(don't know if thats a good idea).

After a successfull Installation with a Kernel configured according to this guide:
http://gentoo-en.vfose.ru/wiki/Virtualbox_Guest#Configuring_the_Kernel
I had the subjective impression that emerge was quite more stable than it was when working on the Gentoo install CD,
that is, I was able to install more packages in a row without error (at least until the system failed completely,
because root login was impossible)

Can you recommend a program for CPU diagnostic?
How can I investigate this?
What could be the cause?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13867

PostPosted: Tue Sep 10, 2013 10:18 pm    Post subject: Reply with quote

Random failures usually implicate either CPU or memory problems. You ruled out memory, so the likely culprit is CPU overheating. What is the system idle temperature? How hot is it right when an emerge fails?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7094
Location: Saint Amant, Acadiana

PostPosted: Tue Sep 10, 2013 10:48 pm    Post subject: Reply with quote

I still vote for RAM, I've seen memtest running for long time with no errors while the RAM was bad and couldn't stand compiling. I'd try and remove one module at the time and see if the problem goes away.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
litan
n00b
n00b


Joined: 13 Aug 2012
Posts: 51

PostPosted: Wed Sep 11, 2013 6:28 pm    Post subject: Reply with quote

Thanks for your replies!

The idle temperature is 41 C.

I tested with a vim-installation (about 20 dependencies) after some time idle.
The first run had the sandbox corruption message I quoted above already after a few seconds with a CPU temperature of 56 C and emerge terminated with an error shortly after without installing a single package.
I waited until the CPU cooled down to idle temperature and started emerge again, with the sandbox corruption message again after a few seconds and the CPU temperature at 59 C. Again, emerge terminated shortly after with an error, no package installed.

The third run was interesting. I got the first sandbox corruption after 1:40 and emerge happily installed more and more packages.
When installing gpm I got something like: "fatal error: gmp.h file not found" or something many times, but fatal errors apparently are not
the same as they were in the old days and emerge installed this package too.
The next sandbox corruption message popped up after 13 minutes and 25 seconds, emerge terminated with error shortly afterwards,
but 12 packages were already installed. One package in the middle of the process produced a big fat emerge error, but it scrolled away before I was able to see what it was.

The CPU temperature in the third run rose continually from 59 C to 66 C.
This is not a high temperature for this machine. The VM has only one CPU core assigned and I used MAKEOPTS="-j2".
I used this notebook with CPU temperatures of 80 C and higher without anything failing (i.e. on the host with Xubuntu as OS)
Back to top
View user's profile Send private message
litan
n00b
n00b


Joined: 13 Aug 2012
Posts: 51

PostPosted: Fri Sep 13, 2013 9:27 am    Post subject: Reply with quote

I'm trying to write a little program that tests memory and logs the CPU temperature at the time of failures in order to investigate the problem.
I want to run it on the host as well as on the guest but I can't figure out how to configure my kernel for lm_sensors to work with the emulated hardware of VirtualBox 4.1.12.
I use the default PIIX3 chipset for the guest.
/proc/acpi/ does not contain a thermal_zone directory despite having
Code:
CONFIG_ACPI_TERMAL=y

in my kernel config.
It's the same for the experimental ICH9 chipset.

/usr/sbin/sensors-detect detects no sensors.
I also configured
Code:
CONFIG_I2C_CHARDEV=y

because the ebuild of lm_sensors said so.
Is there another way to read the CPU temperature than lm_sensors?

As you may have noticed, I have almost no idea about kernel configuration.

Btw: Should this be a separate thread?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13867

PostPosted: Sat Sep 14, 2013 12:47 am    Post subject: Reply with quote

As far as I know, no hypervisor implements support for emulating hardware faults when the virtual CPU is virtually overheated. Monitoring the temperature of your real CPU should be sufficient.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum