Page 1 of 2

[Fixed] Restore of saved session fails

Posted: 17. Jun 2015, 11:22
by BasMevissen
Hi,

When I try to restore a saved VM session, it fails. I see the following error in the logs:

00:00:14.540393 HGSMI[VBVA]: host heap allocation failed 25 bytes

The restore seems to complete, but just before unpausing the VM, it turns black and does not respond to any command. The complete log is attached.

It only happens with my Windows 7 guest that has the "normal" guest display driver installed. When I try to reproduce the issue with my scratch Windows 7 guest, it seems fine. I also have the suspicion that it (mainly?) happens when I switch between docked (with external monitors) and undocked use (with HiDPI display) between the save and restore. Unfortunately, that is hard to test in day to day use.

BTW. Is there a way to avoid that the .sav file is thrown away when the restore fails? It would be nice to be able to retry a restore in different conditions.

Re: Restore of saved session fails

Posted: 17. Jun 2015, 11:55
by loukingjr
BasMevissen wrote:Hi,

BTW. Is there a way to avoid that the .sav file is thrown away when the restore fails? It would be nice to be able to retry a restore in different conditions.
Not sure I understand your question. If you change the conditions, the saved state at the time you created it would no longer be valid. But to answer your question, you could just create a copy of the .sav file outside the VM's folder and restore it after the original is deleted.

Re: Restore of saved session fails

Posted: 17. Jun 2015, 14:34
by BasMevissen
With changed conditions, I mean other host network connections, different monitor setup and the like. So not the VBox guest settings. Saving a copy of the .sav seems logical. I hoped for some setting, but this should work as well.

BTW. It looks like only the display part is not functional. I can ping the guest and it responds to things like changing the network settings. The VBox remote display stays black unfortunately. With RDP, I get to the login prompt of the guest. But it times out for some reason after logging in successfully...

Re: Restore of saved session fails

Posted: 18. Jun 2015, 00:17
by noteirak
BasMevissen wrote:With changed conditions, I mean other host network connections, different monitor setup and the like
This is enough for a saved state to be restored. The saved state file is a dump of the RAM, CPU state, etc. So if you have different monitor setup, that's enough to trigger some error there.
It also seems to match with your display issues. I wouldn't recommend this way of using VirtualBox.

Re: Restore of saved session fails

Posted: 18. Jun 2015, 11:34
by BasMevissen
Yes, I can confirm it seems related. I tried to restore to different screens (monitors). However, it was no issue with VBox 4.x. The screen would just flicker and resize itself shortly after resume. So I still consider it a bug.

Re: Restore of saved session fails

Posted: 23. Jun 2015, 15:51
by sunlover
Can't reproduce this here. Please attach 2 VBox.log files: one where you save the VM, and the other where you restore the VM and it fails. Thanks.

Re: Restore of saved session fails

Posted: 23. Jun 2015, 16:53
by BasMevissen
Please find attached a reproducable failure to restore a Fedora 21 (X86_64) session. It almost completes and then says "Aborted" in the GUI.
This happens every time without any change in monitor or network. Just start, save and restore on the same screen.

Hope you can determine the cause from these logs.

Important to note is that a Windows 7 image with WDDM driver installed seems to be rock solid over save and restore. Even if I start and save on external non-hidpi monitor and then restore on the hidpi notebook screen with the external monitors disabled.

I'll follow up with some tries with a Windows 7 image I mostly use. It uses the basic driver.

Host is Dell Precision M4800 with Fedora 22 X86_64 latest updates (including testing) and nVidia binary driver 346.72 from rpmfusion.org's akmod package.

(and thanks that you are willing to look into this issue)

Re: Restore of saved session fails

Posted: 24. Jun 2015, 09:27
by sunlover
Thanks, please also attach log files for the Windows guest where you saw the "00:00:14.540393 HGSMI[VBVA]: host heap allocation failed 25 bytes" message.

Fedora is a different problem. From your description it looks like a crash of the VM process.

Re: Restore of saved session fails

Posted: 24. Jun 2015, 13:09
by BasMevissen
Hi,

Please find the logs attached. It is from my Windows 7 guest with basic video driver. The logs are:

01 VBox-work-saved-session.log - Started from external display and saved (OK)
02 VBox-work-restored-saved-session.log - Restored to external display and saved again (OK)
03 VBox-work-restored-failed-session.log - Restored on hidpi notebook panel -> black screen in guest with host heap allocation failure (FAILURE)
11 VBox-work-hidpi-saved-session.log - Started from hidpi panel and saved (OK)
12 VBox-work-hidpi-restored-saved-session.log - Restored on hidpi panal and saved again (OK)
13 VBox-work-hidpi-restored-failed-session.log - Restored on external display -> black screen in guest with host heap allocation failure (FAILURE)

Hope this helps to find the cause of the issue.

Re: Restore of saved session fails

Posted: 25. Jun 2015, 12:23
by BasMevissen
It looks like screen switches go wrong with this guest. I added a log to viewtopic.php?f=15&t=67977&p=325939#p325939 where a logout in Windows 7 gave the same error.

Re: Restore of saved session fails

Posted: 26. Jun 2015, 18:03
by sunlover
Thanks for the logs. Finally reproduced this here. Happens only if "2D Acceleration" is enabled in the VM settings.

Please try to uncheck "Enable 2D Video Acceleration" in "Display" settings for the VM and test if it works for you.

Re: Restore of saved session fails

Posted: 26. Jun 2015, 21:44
by BasMevissen
That did the trick. I tried on RC2. It fails with 2D enabled and correctly restores with 2D accel disabled. I tested with a clean Win 7 image with the basic driver installed. Before restoring, I switch the screen resulution of my notebook panel (no external monitor connected atm).

Thanks for figuring out. Is this something that can be fixed for the release?

As a side node: the image I used had previously the WDDM driver installed from RC1. When I upgraded it to RC2 and choose the basic driver, it hung with a black screen as well. I'm not 100% sure that it was also the heap error. Now the image is fine and I do not intent to change it as the WDDM beta is not suitable for day to day office work.

Thanks again and obviously I'm more than willing to test potential fixes. I'll keep a scratch guest image for that purpose.

Re: Restore of saved session fails

Posted: 29. Jun 2015, 15:13
by sunlover
Found the bug and fixed it. Of course the fix will be included in the release. Thanks for helping with this.

Re: Restore of saved session fails

Posted: 29. Jun 2015, 15:26
by BasMevissen
Great. I'm happy to test it when it gets released.

Re: Restore of saved session fails

Posted: 29. Jun 2015, 15:37
by frank
Here is a test build containing the fix. Could you confirm that this fixes the problem for you? Thank you!