VMware {code} Community
pknut
Contributor
Contributor

Intermittent crashes the Vix API

We had been experiencing intermittent crashes the Vix API. We recently switched to launching vmrun.exe in a subprocess instead so the Vix API crashes would not kill our application. We have found that vmrun.exe also crashes intermittently. It displays a fatal error popup and hangs. It is very inconvenient since we are trying to control VM operations automatically and unattended. The crashes occur most often when we're reverting to snapshots or starting VMs. The crashes are more frequent when we launch multiple instances of vmrun.exe on the same computer at the same time, each to control a different VM.

The popup looks like this:

10476_10476.png

Here is the full problem signature:

Problem signature:

Problem Event Name: APPCRASH

Application Name: vmrun.exe

Application Version: 1.10.1.12915

Application Timestamp: 4c1310f0

Fault Module Name: glib-2.0.dll

Fault Module Version: 2.16.4.0

Fault Module Timestamp: 48801db1

Exception Code: c0000005

Exception Offset: 0005a870

OS Version: 6.1.7600.2.0.0.274.10

Locale ID: 1033

Additional Information 1: 0a9e

Additional Information 2: 0a9e372d3b4ad19135b953a78882e789

Additional Information 3: 0a9e

Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Tags (3)
0 Kudos
11 Replies
dblock
Enthusiast
Enthusiast

Every time I've seen this, I found a bug in the software. VixCOM is very unforgiving. You need to close all unclosed handles when you're done with them. I recommend you use a library, everything that's IDisposable needs to be disposed via a using pattern and you won't see a crash.

0 Kudos
oz53719
Contributor
Contributor

http://I work with pknut. He posted the problem description for me.

We switched from calling the Vix API to launching vmrun.exe precisely to eliminate the possibility that a bug in our code is causing the crashes. Our application no longer references VixCOM. It performs all VM operations by launching vmrun.exe. The posted popup and problem signature are of vmrun.exe, not an application that we wrote. This particular crash was produced by a simple batch file that invokes vmrun.exe to perform 'reverttosnapshot' and 'start' operations in a loop.

0 Kudos
dblock
Enthusiast
Enthusiast

I figured that Smiley Wink I bet that vmrun is having the same types of issues since a lot of the stuff is still going through the COM layer and gets pooled. If you went back to using the C# / COM interface and disposed things you'd probably be better off.

0 Kudos
admin
Immortal
Immortal

Is there any way you could upload the script your are using that results in the crash?

Also, which version of VIX are you using, and what version of which VMware product are you using it with?

0 Kudos
admin
Immortal
Immortal

Actual, vmrun does not use the COM library, since we wrote it directly on top of the C API (works on both Windows and Linux and actually vmrun was written before VixCOM).

So, it should have fewer of those issues you describe, since it has only uses normal reference counting, not reference counting on top of garbage collection.

0 Kudos
oz53719
Contributor
Contributor

We're getting the crashes in this environment:

Windows XP Professional SP 3

VMware VIX 1.10.1.12915

vCenter Server 4.1.0 Build 258902

ESXi 4.0.0,261974

I run the batch file in a Command Prompt with the VMX path as an argument. The crashes may be more frequent when I run three copies to control three different VMs simultaneously, but we get crashes even if we only run one copy.

@echo off

:loop

echo revertToSnapshot...

"c:\program files\vmware\vmware vix\vmrun.exe" -T esx -h https:// start %1 gui

echo returns %ERRORLEVEL%

goto :loop

0 Kudos
MeenaAK
Contributor
Contributor

Hi,

Did you get any solution for this problem? I am facing the same issue with powershell, whenever I am trying to execute Invoke-VMScript command. The issue is not consistent.

Thanks,

Meena

0 Kudos
oz53719
Contributor
Contributor

We never got a solution. We work around it by running vmrun.exe repeatedly until it succeeds, constantly monitoring it for hangs and program failure popup dialogs (in which case we kill the process). I am not working on that project any more, so I have not checked lately whether newer versions of the Vix API or vmrun.exe behave better...but I am not optimistic.

0 Kudos
glenlarson
Contributor
Contributor

This happens in our environment as well and we ended up with the same workaround.  I upgraded to VMWare 10 recently and found the popup message changed a little, causing our workaround of closing the popup and retrying no longer functional.  Very annoying, inconsistent, and problematic due to instability.  We are now updating to catch and close the new popup ("VMWare Workstation unrecoverable error: (VMZ) Revert to snapshot # failed. A log file is available in ....").

0 Kudos
c4milo
Contributor
Contributor



I believe the lesson here is to stop using VIX for interfacing with vSphere, and instead, use the vSphere API. 

0 Kudos
c4milo
Contributor
Contributor



Ah nevermind what I just said. I noticed you were using ESXi 4

0 Kudos