How do I create a fault-tolerant DLL call from LV?

I've created an .exe from a VI that calls a DLL, when that DLL crashes,
it crashes the whole application.  This DLL is too complicated to
completely debug and it, in turn calls DLLs I have no control
over.  It crashes approximately once every 100,000 iterations.
How do I make a DLL call fault-tolerent?
Attachments:
crash.gif ‏19 KB

I might not have been very clear in my answer - this isn't a feature that CAN be added to LabVIEW...the DLL threw an unhandled exception across a DLL interface - which pretty much means a system exception (code shouldn't be throwing language exceptions across DLL boundaries as they are language specific). This means that something went very wrong with the code and there is a good chance that the process space has been corrupted. And from my own debugging experience, if it's only crashing 1 time out of 100,000, that doesn't mean it isn't corrupting memory or otherwise causing problems...it was just the time it was caught.
Considering this, the Call Library Node already is fault tolerant - we catch the exception and report it to the user. You have a valid position that we should simply return this as an error. It's also a valid position that it would be a road paved with good intentions. All you need to do is remember what life was like in Windows 3.1 - where one process could silently corrupt another - to realize the amount of untraceable errors that could occur. Yes, the error out value should be handled by the user, but when an application of 100's or 1000's of VIs crashes seemingly at random because someone didn't, you can see the problem.
I will say I like the idea of a separate memory space. It is unfortunate that Windows only offers that through creating a separate process, but it is a neat idea. I worked in the VXI/VME world for a while, which does have multiple address spaces.
BTW - using signal handlers to catch exceptions is unfortunately not a 100% solution...signals are a partial port of a Unix concept in Windows. You would be best to use SEH around the call (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccelng/htm/key_s-z_4.asp). If the DLL is already a C++ DLL, then you can use the global catch of C++ instead
int err = 0;
try {
} catch(...) {
   err = -1;
Again, you still are at risk of a corrupted process, but this allows you to avoid our handling of it.
Having spent years writing and (god help me) debugging device drivers, I love this topic. If you want to talk more about it and various options, feel free to shoot me an email at [email protected].
Brian Tyler
http://detritus.blogs.com/lycangeek

Similar Messages

  • How do I create a single image using PSE12 from multiple originals where each original is still separate?

    How do I create a single image using PSE12 from multiple originals in which the originals are still separate (i.e. side by side or arranged in a square)? I could do this in PSE2, but can't find how to get PSE12 to do it.
    Grecophile55

    In PSE2 there was a single photo-merge. I browsed all my images and I could then click and drag each to its new position before saving. There doesn’t seem to be a similar facility in PSE12.

  • How can I create a master PDX that pulls from multiple other PDXs?

    I process aviation maintenance manuals, with the individual manuals having their own PDX. How can I create a master PDX that pulls from the individual PDXs?
    I have access to myriad versions of Windows and Acrobat so there's that...

    I’ve got 100s of manuals each with their own PDX. I’ve been asked to create a master PDX that in effect combines all of the individual PDXs into a single (cross-manufacturer, cross-fleet, cross-manual-type) searchable PDX that can be easily updated.

  • Dll call from java using Jbuilder?

    Please?
    Does anyone know how I do dll calls from java (jubuilder).
    I have tried but did not manage to get it wright???
    / thanks carlos

    Research JNI (java native interface)

  • I am using a Application in c dll calling from jni jar by java applet in firefox version 19.0 , the problem is click event message box will not working correct

    I am using a Application in c dll calling from jni jar by java applet in firefox version 19.0 , the problem is button click event message box or popup window will not working correctly. Please any one suggest me the steps to overcome this not responding or slowness in the responding problem of Button click event.

    Hello,
    In Firefox 23, as part of an effort to simplify the Firefox options set and protect users from unintentially damaging their Firefox, the option to disable JavaScript was removed from the Firefox Options window.
    However, the option to disable JavaScript was not removed from Firefox entirely. You can still access it from about:config or by installing an add-on.
    '''about:config'''
    # In the address bar, type "about:config" (with no quotes), and press Enter.
    # Click "I'll be careful, I promise"
    # In the search bar, search for "javascript.enabled" (with no quotes).
    # Right click the result named "javascript.enabled" and click "Toggle". JavaScript is now disabled.
    To Re-enable JavaScript, repeat these steps.
    '''Add-ons'''
    You can alternatively install an add-on that lets you disable JavaScript, such as
    *[https://addons.mozilla.org/firefox/addon/noscript/ No-Script] (to disable JavaScript on a per page basis, as required)
    *[https://addons.mozilla.org/firefox/addon/quickjava/ QuickJava] (to easily disable and enable JavaScript, automatic loading of images, and other content)
    Thank you and I hope this helps!

  • How much does it cost me to receive calls from lan...

    Should I purchase an online number, how much does it cost to receive incoming calls from landlines or mobile to my Skype online number?
    Solved!
    Go to Solution.

    Hello,
    It costs nothing to receive a call to your Skype #. As it is simply a regular landline # the caller pays whatever his/her carrier charges to call that #.
    TIME ZONE - US EASTERN. LOCATION - PHILADELPHIA, PA, USA.
    I recommend that you always run the latest Skype version: Windows & Mac
    If my advice helped to fix your issue please mark it as a solution to help others.
    Please note that I generally don't respond to unsolicited Private Messages. Thank you.

  • How can I turn off the phone saying "Call from" #/name when getting incoming call.

    How can I turn off the phone saying "Call from" #/name when getting incoming call before the ring tone starts?  I have a LG accolade

    I recommend checking your  prompts and alerts to turn this feature off. This may be you "Call Connect" or "Readout" alerts. Listed below are steps to update this feature. 
    With the flip open, press the Voice Command Key (on the left side of the phone).The Voice Commands feature has several settings which allow you to customize how you want to use it. Access Voice Commands, then press the Right Soft Key[Settings]. Your choices are below:
    -Confirm Choices--- Automatic/Always Confirm/ Never Confirm
    -Sensitivity--- Control the sensitivity as More Sensitive/ Automatic/Less Sensitive
    -Adapt Voice ---If the phone often asks you to repeat voice command,train the phone to recognize your voice patterns.Train Words/ Train Digits
    Prompts ---Mode/ Audio Playback/Timeout
    * For Mode, set Prompts/ Readout+ Alerts/ Readout/ Tones Only.
    * For Audio Playback, set Speakerphone or Earpiece.
    * For Timeout, set 5 seconds or 10seconds.

  • How can i measure BAPI runtime which has called from JAVA

    Hi abapers
    how can i get run time for BAPI called from JAVA through JCO.
    i know that i can use SE30 from ABAP by executing from SAP.
    may be ST05 useful for me i did it but when display trace
    i am getting big list by seeing this list i am not able to find the runtime for that BAPI.
    please any one can explain
    reagdrs
    ramesh

    Hi Ramesh,
       Irrespective of whether the call is from an external system or within sap, the bapi will be executed in R/3 only.
    So, you can safely measure the runtime using se30 only.
    If it is taking more time when called from JCo , then you can be sure that the problem is not with SAP and is actually due to the JCo connectivity with R/3.
    Regards,
    Ravi

  • How make DNS for real fault tolerance?

    Hi,
    Is there any change to make DNS-server fault tolerance for clients (member servers and applications)
    Scenario:
    Primary and Secodary DNS (not AD-integrated)
    If we like to move or rebuild crashed DNS-server from old to new host, there will came service brake for one DNS-server (new server is up and running some time before DNS have been configured (you can ping it and icmp response)), 
    DNS-client is happy for that thus there is no DNS-service or zones and not use secondary DNS-server cause server answer with ICMP and criticals softwares stop working. Is there any change for DNS real fault tolerance?
    I have understood this feature is same in Windows world and non-Windows world

    Hi,
    According to your description, my understanding is that there will came service brake for one DNS server when moving or rebuilding crashed DNS-server from old to new host.
    There are 2 DNS servers: primary and secondary DNS server, both are not AD-Integrated.
    DNS design specifications recommend that at least 2 DNS servers be used to host each zone. For standard primary-type zones, a secondary server is required to add and configure the zone to appear to other DNS servers in the network. This design may provide
    a basic level of fault tolerance for resolving names. Once primary DNS server crashes, secondary DNS server is ready only and can’t process update requests, so we need to manually change the secondary server to primary, and then try to repair the crashed one
    or add another DNS server.
    Comparatively, AD-Integrated primary zones, secondary servers are supported but not required for this purpose. For example, two DNS servers running on domain controllers can be redundant primary servers for a zone, providing the same benefits of adding a
    secondary server while including additional advantages.
    Depending on your need, and choose a better one.
    Best Regards,
    Eve Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How can I create a array with all files from a directory

    How can I create a array of files or varchar with all files from a directory?

    I thought the example could be improved upon. I've posted a solution on my blog that doesn't require writing the directory list to a table. It simply returns it as a nested table of files as a SQL datatype. You can find it here:
    http://maclochlainn.wordpress.com/2008/06/05/how-you-can-read-an-external-directory-list-from-sql/

  • How can I create a function of sound volue from time using AudioQueueBufferRef??

    I have a question how can I analyze class AudioQueueBufferRef, for creating a function of sound volue from time?? Here is what I get . there is AudioQueueBufferRef fillBuf = audioQueueBuffer[fillBufferIndex]; volume height is 2000 elements from SInt16* coreAudioBuffer = (SInt16*)fillBuf->mAudioData. so function looks like H(t*i)=coreAudioBuffer[i] where t = 1/sampleRate = 1/22050 but here is a problem. my program gets sound and uses a class AudioStreamer for this. AudioStreamer has 3000 lines when I play music from Free Internet Radio - SHOUTcast Radio - Thousands of Free Online Radio Stations. internet radio - my problem is as follows either I dont know where 85 % of sound information is or I dont know how I can analyze class AudioQueueBufferRef
    Here is the code where I analyze Buffer.
    {@synchronized(self)
    if ([self isFinishing] || stream == 0)
    return;
    inuse[fillBufferIndex] = true; // set in use flag
    buffersUsed++;
    // enqueue buffer
    AudioQueueBufferRef fillBuf = audioQueueBuffer[fillBufferIndex];
    fillBuf->mAudioDataByteSize = bytesFilled;
    // ======>in this place I analyze Buffer
    if (packetsFilled)
    err = AudioQueueEnqueueBuffer(audioQueue, fillBuf, packetsFilled, packetDescs);
    else
    err = AudioQueueEnqueueBuffer(audioQueue, fillBuf, 0, NULL);
    when bitRate = 24 buffer has the following options int size=(fillBuf->mAudioDataByteSize) == 2000 double sampleRate=asbd.mSampleRate == 22050 numberOfChannels = asbd.mChannelsPerFrame == 1 it turns out that duration of play buffer float bufferTime =(size/numberOfChannels)/sampleRate == 0.1 number of buffers per second float numBuffersInOneSeconds == 1,5 duration of play all buffers per one second numBuffersInOneSeconds * time == 0.15 so it is 15 % of all information
    as a result If buffer comes at 0.0 seconds he lasts up to 0.1 seconds.farther in my function there is no volume. second buffer comes in 0.7 seconds and lasts up to 0.8 seconds. but in reality the sound doesnt breaks. Maybe I'm doing something wrong .please tell me.
    just for comparison
    when bitRate = 32 buffer has the following options int size=(fillBuf->mAudioDataByteSize) == 2000 double sampleRate=asbd.mSampleRate == 22050 numberOfChannels = asbd.mChannelsPerFrame == 1 it turns out that duration of play buffer float bufferTime =(size/numberOfChannels)/sampleRate == 0.1 number of buffers per second float numBuffersInOneSeconds == 2 duration of play all buffers per one second numBuffersInOneSeconds * time == 0.2 so it is 20 % of all information
    when bitRate = 32 buffer has the following options int size=(fillBuf->mAudioDataByteSize) == 1660 double sampleRate=asbd.mSampleRate == 44100 numberOfChannels = asbd.mChannelsPerFrame == 2 it turns out that duration of play buffer float bufferTime =(size/numberOfChannels)/sampleRate == 0.02 number of buffers per second float numBuffersInOneSeconds == 10 duration of play all buffers per one second numBuffersInOneSeconds * time == 0.2 so it is 20 % of all information

    You cannot write custom commands for expressions.
    That being said, there are a couple of options:
    Create a subsequence with a single step. Use a parameter of the sequence as "function parameter".
    Create a custom step type including a substep module which implements the function. Add an edit substep to enable the user of the steptype to gracefully change the parameter.
    Store the variable parameter in a local/file global variable and modify the value in each step. This will, at least, keep the "function" the same for every step.
    Norbert

  • How do you create or change excel spreadsheet downloaded from windows

    how do you create or change excel spreadsheet on macbook pro?

    Hi meadcm,
    You would need to have Excel installed on your Mac....
    You can get Office for Mac, which has Excel as a part of the package from Microsoft:
    http://www.microsoft.com/mac/buy
    Cheers,
    GB

  • How do I create a transparent watermark for video from a white background logo in AI CC?

    If I have a .PNG logo with a white background, how do I create a transparent watermark to use in video and photo content using Illustrator CC? Whenever I import the logo, it opens a new window without a transparent background. Thank you!

    It's fairly easy if you know Ai. (Image trace is okay, but I'd recommend making your own (the right way), then use any Adobe pro video app to composite on your video, no need to export, just use the .Ai file)
    But an easier way might be to use the .png by itself if it carries an alpha channel.
    After Effects, PremierePro, and possibly AME will let you do this.
    QT7 will also allow you to do it.
    You could create a logo in Draw, then send it to Illustrator or Photoshop (it carries an alpha channel - bonus!)

  • How do I create a slide show in iPhoto from an iCloud photo stream

    ow do I create a slide show in iPhoto from an iCloud photo stream?

    Do you mean from a Shared Stream or My Photo Stream?
    In iPhoto on your iPhone, iPad you create slideshow projects by selecting photos and then sharing them as a new slideshow. http://help.apple.com/iphoto/iphone/2.0/?handbuch#blnkbc26e276
    You can publish your slideshow in iCloud:  http://support.apple.com/kb/PH2333
    In iPhoto on your Mac you can make an instant slideshow by selecting the photos in the photo stream and pressing the slideshow button, see: http://support.apple.com/kb/PH2333

  • How can we encourage Apple to develop blocking calls from specific numbers?

    Looking through posts on here, I see that neither AT&T nor the iPhone itself permits an iPhone owner to block calls from one or more specific numbers.
    For some reason, although I've had my mobile number for years, I've recently started to receive daily calls from one specific number, an ignorant person who calls at all times of the day and night, barely apologizing for yet again dialing incorrectly. Very annoying.
    Yes, I know I could change my number, but literally hundreds of people have used this number for years, and I'm truly loathe to start over.
    In reading posts here and on AT&T, I gather this is not an uncommon problem. I assume that even if AT&T is unwilling to institute call blocking, this is a problem Apple could solve with iPhone software. What's the best way to encourage Apple to include this in a future iPhone software update?
    In advance, thanks for your guidance.

    This would be something ATT would have to do since they provide the actual phone service.
    In the meantime, you could create a ringtone of "silence" and assign it to that person's number. This way you wouldn't be disturbed when the person calls until you can work out a solution with ATT.

Maybe you are looking for

  • Help with Canon iR2016 printer please...

    I use the Canon iR2016 monochrome laser printer in my office, as I need the large A3 format for sheet music purposes. Alas for Mountain Lion, the Canon website says There is no driver for the OS Version you selected. The driver may be included in you

  • Difference between Oracle Enetrprise Manager 10.1.2. and 10.1.3

    We have J2EE application deployed on Oracle Application Server 10.1.2. For setting up and deploying application we use Enterprise manager. We are intending to upgrade onto version 10.1.3. At the beginning we tried new Enterprise manager. We are unple

  • My i pad just fell and my screen shattered in one corner am afraid what do I do?

    Need help I pad screen shattered in one corner

  • Interface OSPF cost issue

    Image link (the image above looks distorted in the post preview):  http://fodder.s3.amazonaws.com/ospf-cost-diagram.jpg In the test network shown in the diagram I have the following issue that I can't seem to figure out: Without any modification to o

  • Photoshop XMP geotagging corruption

    How do I keep Mac Photoshop CS3 from corrupting the geotagging data in the images it processes?  My workflow consists of using Nikon Capture NX2 to generate TIFFs or JPEGs and then I do touch-ups on them in Photoshop.  However, Photoshop gets the tim