Semi-aleatoire segfaults when returning to snapshots

I have a set of ESX 4.0.0 boxes where I am under some highly automated processes that require me to return frequently to snapshot. After beating my head against the wall for awhile on the fact that every third day or more, dies of VMware in such a way that I have to restart so that I can connect to my guests of the VIX Perl API, I decided to solve the problem by automating a daily reboot of those systems. Now, I ran into a snag even one really, really basic piece of code--my script to return to travellers in the snapshot is segfaulting (throwing a SIGSEGV) to semi random intervals, using the Perl API and the C API.

The code for the C version of my script (I moved so that it is easier to debug this kind of thing in c) is as simple as it gets, largely copied from the sample file snapshot.c for the API version 1.8.1 (which is what I am running):

#include <stdio.h>
#include <strings.h>
#include <vmware-vix/vix.h>

#define CONNTYPE VIX_SERVICEPROVIDER_VMWARE_VI_SERVER
#define HOSTPORT 0
#define USERNAME "root"
#define PASSWORD "yourefunnyifyouthinkimpostingithere"
#define VMPOWEROPTIONS VIX_VMPOWEROP_NORMAL

int main(int argc, char **argv) {
        VixError err;
        char *vmxPath;
        char *hostname;
        VixHandle hostHandle = VIX_INVALID_HANDLE;
        VixHandle jobHandle = VIX_INVALID_HANDLE;
        VixHandle vmHandle = VIX_INVALID_HANDLE;
        VixHandle snapshotHandle = VIX_INVALID_HANDLE;
        int numSnapshots;
        int firstHost = 0;
        int lastHost = 0;
        int x;
        char vmName[45];

        if (argc > 1) {
                hostname = argv[1];
        }
        if (argc > 2) {
                firstHost = atoi(argv[2]);
        }
        if (argc > 3) {
                lastHost = atoi(argv[3]);
        }

        if (firstHost == 0) {
                firstHost = 2;
        }
        if (lastHost == 0) {
                lastHost = 30;
        }

        jobHandle = VixHost_Connect(VIX_API_VERSION,
                                        CONNTYPE,
                                        hostname,
                                        HOSTPORT,
                                        USERNAME,
                                        PASSWORD,
                                        0,
                                        VIX_INVALID_HANDLE,
                                        NULL,
                                        NULL);
        err = VixJob_Wait(jobHandle,                                 VIX_PROPERTY_JOB_RESULT_HANDLE,
                                &hostHandle,
                                VIX_PROPERTY_NONE);
        if (VIX_FAILED(err)) {
                dieGracefully(jobHandle, vmHandle, snapshotHandle, hostHandle);
        }
        Vix_ReleaseHandle(jobHandle);

        printf("Successfully connected to host %s\n", hostname);

        for (x = firstHost; x <= lastHost; x++) {
                bzero(vmName, 45);
                sprintf(vmName, "[Storage1] Virus Clone %d/Virus Clone %d.vmx", x, x);
                jobHandle = VixVM_Open(hostHandle,
                                        vmName,
                                        NULL,
                                        NULL);
                err = VixJob_Wait(jobHandle,
                                        VIX_PROPERTY_JOB_RESULT_HANDLE,
                                        &vmHandle,
                                        VIX_PROPERTY_NONE);
                if (VIX_FAILED(err)) {
                        dieGracefully(jobHandle, vmHandle, snapshotHandle, hostHandle);
                }
                Vix_ReleaseHandle(jobHandle);
                printf("Connected to VM %d\n", x);

                err = VixVM_GetRootSnapshot(vmHandle, 0, &snapshotHandle);
                if (VIX_FAILED(err)) {
                        dieGracefully(jobHandle, vmHandle, snapshotHandle, hostHandle);
                }

                jobHandle = VixVM_RevertToSnapshot(vmHandle,
                                                        snapshotHandle,
                                                        VMPOWEROPTIONS,
                                                        VIX_INVALID_HANDLE,
                                                        NULL,
                                                        NULL);

                err = VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);
                if (VIX_FAILED(err)) {
                        dieGracefully(jobHandle, vmHandle, snapshotHandle, hostHandle);
                }
                printf("Reverted VM %d to snapshot\n", x);
        }

        return 0;
}

int dieGracefully(VixHandle j, VixHandle v, VixHandle s, VixHandle h) {
        Vix_ReleaseHandle(j);
        Vix_ReleaseHandle(v);
        Vix_ReleaseHandle(s);
        VixHost_Disconnect(h);

        return -1;
}

My Makefile is just too basic; the only real difference of the sample, is that I am a pthreads link manually in my binary, so the GDB can debug correctly:

WRAPPER = -lvixAllProducts -ldl
SERVER11 = /usr/lib/vmware-vix/server-1/64bit/libvix.so
WORKST60 = /usr/lib/vmware-vix/ws-3/64bit/libvix.so
SERVER20 = /usr/lib/vmware-vix/VIServer-2.0.0/64bit/libvix.so
WORKST65 = /usr/lib/vmware-vix/Workstation-6.5.0/64bit/libvix.so
WRAPORNOT = $(WRAPPER)
VIXH = -I/usr/include/vmware-vix

all: eventPump startup

eventPump: eventPump.c
        gcc $(VIXH) eventPump.c -o eventPump -lpthread $(WRAPORNOT)

startup: startup.c
        gcc $(VIXH) startup.c -o startup -lpthread $(WRAPORNOT)

clean:
        rm -f eventPump startup

I use this script on a 64 bit Ubuntu 9.10 system, gcc 4.4.1 Installing enough vanilla.

When I ran my script in GDB, after venerating the first invited several successfully, I got the following:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5193084 in ?? () from /usr/lib/vmware-vix/VSphere-4.0/64bit/libgvmomi.so.0
(gdb) bt
#0  0x00007ffff5193084 in ?? () from /usr/lib/vmware-vix/VSphere-4.0/64bit/libgvmomi.so.0
#1  0x00007ffff5193f94 in ?? () from /usr/lib/vmware-vix/VSphere-4.0/64bit/libgvmomi.so.0
#2  0x00007ffff52fd5eb in ?? () from /usr/lib/vmware-vix/VSphere-4.0/64bit/libgvmomi.so.0
#3  0x00007ffff5e3b282 in g_object_get_valist () from /usr/lib/vmware-vix/VSphere-4.0/64bit/libgobject-2.0.so.0
#4  0x00007ffff5e3b57a in g_object_get () from /usr/lib/vmware-vix/VSphere-4.0/64bit/libgobject-2.0.so.0
#5  0x00007ffff48fd353 in ?? () from /usr/lib/vmware-vix/VSphere-4.0/64bit/libvix.so
#6  0x00007ffff48d4cee in VixVM_GetRootSnapshot () from /usr/lib/vmware-vix/VSphere-4.0/64bit/libvix.so
#7  0x0000000000400ca1 in main ()

I am at a total loss here - this should be something incredibly basic, simple, and it is apparently not. Anyone has an idea why something so simple would break?

What Vix do you use?

Track suggests its a ugly race dealing with updates of the snapshot - related make a snapshot operation, while the snapshot tree is being filled could hit freed memory.  Its possible that your code might be tripping over it.   This is fixed in the current version of the 1.10 beta

(http://www.vmware.com/support/developer/vix-api/)

You could also do a DIY quick test with a sleep() before and after snapshot operations.

Tags: VMware

Similar Questions

  • my computer broke down and when return to the setting factory. is the same where I can get my old picture when rear, files, etc etc?

    my computer broke down and when return to the setting factory. is the same where I can get my old picture when rear, files, etc etc?

    Hello

    Recuva worked for posters that have been in your same situation here

    a clean install wipes the hard drive clean of everything

    You cannot undo what you've done

    If you have lost data, you can try this

    http://www.Piriform.com/Recuva

    Read also:

    Since we don't know exactly how you reinstalled it seek a windows.old folder

    How to restore your personal files after you perform a custom Windows Vista or Windows 7 installation

    http://support.Microsoft.com/kb/932912

    or even return to a previous operating system by using the information in file window.old at the link below

    http://support.Microsoft.com/kb/933168

    If the above does not work:

    Try the data recovery experts

    but they are very expensive

  • The USB keyboard lights can not be clarified when return to the system of stand-by

    The LED may light not on, when return to stand-by on Vista32/Vista64 system.

    Steps to follow:

    1. plug the USB keyboard on USB port of the system, make sure that the LED (NumLock, caplock and stop scroll) are States
    2. make the system in stand by
    3. press a button for the system to be back
    4 check the lights (shift caps lock, NumLock, scroll), the lights are off State - has failed. At that time, the caps lock Numlock/function/sroll lock are still usable and normal.

    5. If you click on one of the main (Caps Lock NumLock, locking Sroll), the LEDs will be renewed normally.

    Note1: The question to not happen on Windows XP and Windows 7. The windows vista USB CATC, send a reset signal and do not send lighting LEDs commond once again, but W7/XP don ' have the reset signal.

    Note 2: The question may reduplicate on some keyboards, for example, MS Reclusa Gamiing keyboard (using the Hub IC of Cypress).

    Note3: And we can encounter the problem on the back of hibernation, the LEDs be clarified on, end user must click these buttons to wake up the LEDs.

    You know the rootcase, if it is MS vista limitaion?

    Hi Bluekang,

    Thank you for your message.

    What is the make and model of your computer? Desktop or laptop machine?

    When Stand By resumeing, power settings can sometimes affect the State of the device as it back to normal.

    I recommend that you check your Power Options > Adanced settings > USB suspend setting > disable

    Chris
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • An error occurred when taking a snapshot: failure to suspend the VM.

    Hello

    I use vCenter 5.5 with vSphere WEB GUI to take a snapshot of a RHEL 5.4 32 basic VM on a 5.5 ESXi.  When I choose the "suspend the comments file system" instead of the "memory of the virtual machine snapshot", the creation of the Snapshot failed 90% with "an error occurred when taking a snapshot: failure to suspend the virtual machine.

    I have no problem using the 'snapshot of the virtual machine memory' option to create the snapshot.

    Your help is appreciated

    Ren Wong

    It is a bug in kernel in RHEL 5.4.  Thanks to all who helped.

    https://Bugzilla.redhat.com/show_bug.cgi?id=539328

  • data loss after return to snapshot?

    What is the best approach to resolve problems of this kind: Let's say I have a VM mail server.

    1. I intend to upgrade the mail server, I take snapshot to have something to come back to disaster.

    2. place at the mail server level.

    3. I let it work for a while to ensure that there is no problem with the upgrade... e-mail server receives e-mails.

    4. If everything works fine, I remove the snapshot.

    What happens if I want to go back to the snapshot? Meanwhile, the mail server received emails, so if I go back to the snapshot I lose those emails. Of course, I can't lose emails.

    Thank you for your suggestions

    What happens if I want to go back to the snapshot? Meanwhile, the mail server received emails, so if I go back to the snapshot I lose those emails. Of course, I can't lose emails.

    Yes, you lose your mail.

    If you have the more virtual disk, you can consider using anti-capitalist disc to not put pressure on the selected disk.

    Or you can make a backup of your Inbox mailbox before returning the snapshot, and then you restore the data.

    André

  • Exchange 2010 freeze when delete a snapshot

    Hi, I have a problem when I have my backup or reproduce an Exchange Server 2010. When I do the backup or work, when jobs are finishes and to remove the snapshot from the Exchange 2010 freeze and do not respond (ping fail) and after 5 minutes, and then return the network. It's a problem because all perspectives do not work in that 5 minutes. I do the backup and replicaction with Veeam. Veeam forum told me that I have to upgrade my ESX 4.1 because the consolidation of snapshots are more clickly. I make a bet to level but maybe in a month or two and I would like to know if it is possible to solve this error in ESX 4.0.

    I have the active VSS and the squiescence and do the job with the vStorage API in network mode.

    Thank you very much!

    I did this experiment, it is a testing environment and found that move the test in 4.1 host has resolved the problem as well.

    If you have found this helpful at all prices please points using the correct or useful!  Thank you!

  • Google search results on Mac OSX - disappeared when returning to page

    Yosemite running on a MacBook Air. When I search with Google (my default), the results appear normally. However, once I click on an ad, go ahead and then return the results of the search, the search results page is empty. Refreshing works OK, but why would this happen? It is these - last month - but also consistent and what happens with Firefox (vs Chrome or Safari).

    Does anyone else have this problem?

    Maybe you have increased your zoom level on the results page recently? I suspect that because there is an old problem with going back to the search results page and blank might as well have it, and it seems to occur only when you use a zoom level high on Google with 'instant prediction results' (the default setting). When to return to this page, Firefox glitches when you restore the cache in memory page, in fact, you can see the results for a fraction of a second before it empty out.

    Assuming you like your zoom level and enjoy using the instant prediction results, then the solution is to disable the part of the Firefox cached in memory by changing a setting under the covers.

    (1) in a new tab, type or paste Subject: config in the address bar and press return / enter. Click on the button promising to be careful.

    (2) in the search above the list box, type or paste sess and make a pause so that the list is filtered

    (3) double-click the preference browser.sessionhistory.max_total_viewers and change the value from-1 to 0 (that's a zero).

    (Please change not all other parameters similar to 0-sounding or you can disable the ability of Firefox to save/restore your tabs and windows open).

    Then reload the page of Google results and the test. Who will fix this for you?

  • Firefox comes back to the top of the page when returning from a url why

    Hello

    When you use a search engine like google and by selecting a web site, when I use the left arrow to return to the results of my search for the web page is at the top of the list of the sites found not where I was down for.

    A slight but pain can it be set to return to the initial position of the page?

    Thank you

    Arnak

    Why not open each search result in a new tab and close each tab when you are done with it, instead of going forward and back in the same tab? The original search page will not need to reload each time you return.

  • Restart the computer when returning from hibernation

    I'm a noob to PC, with a renovated 3440 of Dell with Windows 7 Professional. I have problems with my computer restart when he returned after hibernation. I looked on other posts, and it seems as if others have had the same trouble. Unfortunately, I don't know enough to understand the explanations.

    The error message I receive after reboot is as follows:

    Signature of the problem:
    Problem event name: BlueScreen
    OS version: 6.1.7601.2.1.0.256.48
    Locale ID: 1033

    More information about the problem:
    BCCode: 7A
    BCP1: FFFFF6FC50010370
    BCP2: FFFFFFFFC00000C0
    BCP3: 0000000011065880
    BCP4: FFFFF8A00206E000
    OS version: 6_1_7601
    Service Pack: 1_0
    Product: 256_1

    Files helping to describe the problem:
    C:\Windows\Minidump\051114-16099-01.dmp
    C:\Users\Tony\AppData\Local\Temp\WER-58266-0.SysData.XML

    Read our privacy statement online:
    http://go.Microsoft.com/fwlink/?LinkId=104288&clcid=0x0409

    If the online privacy statement is not available, please read our offline privacy statement:
    C:\Windows\system32\en-US\erofflps.txt

    --

    Help, please. Thank you!

    td3323

    Although not directly involved in accidents, the referenced third-party only processes are mcshield.exe and mctray.exe, both belonging to The Antivirus Mcafee and Trend micro tmlisten.exe.

    It seems that you have items of Trend micro remaining on your system and causing corruption and the issue of the conflict with Mcafee.

    Error_code: (NTSTATUS) 0xc00000c0 - this device does not exist.

    BUGCHECK_STR: 0x7a_c00000c0

    CUSTOMER_CRASH_COUNT: 1

    DEFAULT_BUCKET_ID: VISTA_DRIVER_FAULT

    Nom_processus: McTray.exe (Mcafee AV)

    CURRENT_IRQL: 0

    Error_code: (NTSTATUS) 0xc00000c0 - this device does not exist.

    BUGCHECK_STR: 0x7a_c00000c0

    CUSTOMER_CRASH_COUNT: 1

    DEFAULT_BUCKET_ID: VISTA_DRIVER_FAULT

    Nom_processus: TmListen.exe (trend micro)

    CURRENT_IRQL: 0

    Remove Mcafee completely, the remains of Trend micro cleaning and replace with Microsoft Security Essentials.

    McAfee uninstall utility

    http://service.McAfee.com/FAQDocument.aspx?ID=TS101331

    Uninstall Trend Micro program thanks to the Trend Micro Diagnostic Toolkit

    http://eSupport.trendmicro.com/solution/en-us/1037161.aspx

    Microsoft security essentials.

    http://Windows.Microsoft.com/en-us/Windows/Security-Essentials-download

    Run the Chkdsk command from an elevated command prompt window.

    CHKDSK c: /r

    You also can run the memory test (memtest86). Check the initial link predict how.

    Let us know the results of the tests.

  • How to display all the users on the Welcome screen when returning from screen saver

    In win7 when I return from the screen saver, the Welcome screen shows only the last user who was logged on and under that there is a button that says "change user". It's embarrassing for other users. In XP when you come back, screen saver, all user accounts would automatically appear on the Welcome screen. How can I get this to happen in win7?

    In addition, the only purpose to use the screensaver is to get the Welcome screen to appear on the next action. Is it possible to get just the upcoming welcome screen after a period of time even without first having the active screen saver?
    Thanks in advance.

    To first answer you last question: Yes, you can have the login screen appears without a screen saver.  Use the "nil" screen saver and you can still set a timeout of the logon screen.

    Regarding your first question, I do not think there is a way to do it.  There is a policy setting, you can configure it to decide if the last user appears, but I think that it only works on the areas:

    http://TechNet.Microsoft.com/en-us/library/cc938084.aspx

  • When returning to slides, Captivate skip content - why?

    We have a course which is structured as:

    • Demo
    • Practice
    • Menu (return to the demo, return to the practice, or go to the Quiz)
    • Quiz

    -When the user selects the item to return to the demo, that Captivate does not go down in them through all the slides, instead he finished the demo and skips past all the rest and goes for the Quiz. We can't understand why.

    I printed the advanced Interactions that you can see what is configured. Advanced interactions

    No idea why the return does not allow the user to start the practice and access the menu again before going to the quiz?  Is there a defined automatic variable when the user returns through the part of the demo? If Yes, what is this variable?

    Please, remove the score of these interactive objects and do not add them to the total score. Use the Advanced Interaction Panel when you select an object (most are click boxes) it will be selected in the slide and you'll be able to edit these properties in the reports section.

  • returning without snapshot

    Good all I hope someone can help me here.  I work on a few things and was having problems with an application that opens correctly. I decided to go back to a previous snapshot and I forgot to copy the files I had worked on.  Please tell me there is a way to return to my previous place without having a snapshot of this point.

    Without seeing the vmware.log , it is difficult to say which snapshot file belongs to which snapshot. However, since there are only three snapshots, I recommend you properly shut down the virtual, backup of files/folder of the VM (just to be safe) and then use 'File'-> «Virtual map of discs...» "to map each of the virtual of the snapshot files to find out if one of them contains the files that you are looking for.

    André

  • Workflow slow when you take snapshots

    I have a question about the connections of vCenter.

    Is there a limit on the maximum number of requests can be sent per second for an individual to vCenter connection?

    The reason why I ask is that we have a 'problem' with Orchestrator.

    We created a workflow check if it is possible to create a snapshot (enough storage, has no snapshot,...) and it works for 1-2 seconds.

    But when we begin to create Snapshot (default Orchestrator workflow), and while the snapshot is being created we run the same validate workflow (see above) then this runs workflows for 8 to 10 seconds (factor 4-5 slower)

    And we put the finger on the question of the "vim3WaitTaskEnd" in the instant of creation. If the vote is set to 2 seconds (by default), we have these problems. If we increase the terms of the poll to 300 seconds (to remove it), we have no more of these issues.

    While the snapshot is created, we run the same snapshot to validate, but as a different user, then she extends over only 1-2 seconds again.

    So there must be some sort of maximum number of orders per session/connection?


    Or y at - it a solution for this?

    The upgrade to version 5.5.1 fixes

  • When to delete snapshots in parent pool view image

    Hi all

    Some of our master images for our pools have a lot of photos and I want to clean them. The problem is, last time I deleted a snapshot on a master image that someone in the pool had disconnected from non-persistent desktop before I had time to recompose the pool and when that office is to refresh it failed (because the snapshot, I removed was in the path of snapshots to the snapshot pool was built out of). Not only he made the effect each Office update in this pool, the error stopped the View Composer vCenter Server server then NO more desktops in any pool could not be refreshed.

    So, my question is... What is the mechanism for deleting snapshots in a pool?

    Thank you

    You should not disable the pool.  Just disable commissioning of the pool.  In this way the opportunity to recompose do kick in while you do your work on the parent.  When you are finished, you can enable and then commissioning on the pool again.

  • Query regarding different refreshing data from the grid when returned from a workflow

    Hi Experts,

    JDEV version is: 11.1.1.5

    Our application uses dynamic tabs the user interface shell.

    Whenever the user connects, it is taken in A TAB.

    Since the TAB A, the user navigates to TAB B.

    TAB B has a GRID B(table with a few records).

    Column A on TAB B has a hyperlink which, once clicked on will open a stream of different tasks in a different tab.

    Click on the column of hyperlink for the different lines will open different tf (under certain conditions).

    By clicking on the hyperlink, that the method _launchActivity(String title, String taskflowId, boolean newTab) is used, which the TF open in a new tab.

    The user works on the TF (in a new tab) which opened on click of a hyperlink in the column is and click on SAVE.

    Click to save some operation and removeCurrentTab method is called which will close the current tab, and control passes to the first tab (TAB A).

    The problem:

    Once the user tries to click or to return to the TAB B the WHAT GRID B is never updated that we cannot get the descriptor to refresh the data in the grid.

    Any suggestions would be much appreciated.

    Thank you

    Jean Claude

    huh, I thought it was another library in question.

    In all cases, you can use contextual event (when you close the current tab).

    The second option is to navigate to the method executeQuery by code call activities:

    https://blogs.Oracle.com/jdevotnharvest/entry/how-to_navigate_in_bounded_task_flows

Maybe you are looking for