Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

VS2010 crashes with BSOD when target Framework is changed

The problem I describe below appears to be Visual Studio 2010 related, but I post it here too as it is DAQmx related.

 

Relevant System parameters are: Intel Core2 Quad Q6600; MS Windows 7 Ultimate Edition (build 7600), 64-bit;  MS VS2010 10.0.30319.1 MTRel. The latest NI-DAQmx 9.2.2 is installed.

Other two computers where crash occurs in the same way are:  Dell Inspiron 9300, Windows 7-32 bit, DAQmx 9.1  and  Dell Precision 380 Windows 7-64bit, DAQxm 9.1.

 

I was trying to rebuild from scratch an application that uses analog input/output from a USB-6211.  I had a BSOD right at the beginning stage of writing the app, twice in a row. That evoked my curiosity and I started to minimize required operations to reproduce the crash.  Here are steps that reproducibly produce BSOD, the order of steps is important. 

 

1. Create new C# Windows Forms project [I use: CrashDemo]. By default, the target framework is .NET Framework 4.0 Client. If it is not, it needs to be set on the top of the dialog so.

2. Drag a  toolbar to the Form and create a button on it.

3. Open code of Form1 and add  “using NationalInstruments.DAQmx;”

4. Change Project type from .NET 4.0 Framework Client into .NET Framework 3.5.  Warning dialog answer should be “Yes”, I am sure…   Project closes and reopens automatically.

5. Delete Microsoft.CSharp reference as it is the only one with an exclamation mark.

6. Add two references: National Instruments Common, version 8.9.35.302;  and   National Instruments DAQmx, version 9.2.35.32

        The code at this point is:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using NationalInstruments.DAQmx;

 

namespace CrashDemo

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

    }

}

 

7. Compile.            

Usually the result is three Error messages:

Error     1:         Source file 'C:\TR\CrashDemo\Form1.Designer.cs' could not be opened ('Unspecified error ')            CrashDemo  

Error     2:         Source file 'C:\TR\CrashDemo\Program.cs' could not be opened ('Unspecified error ')          CrashDemo 

Error     3:         The name 'InitializeComponent' does not exist in the current context    C:\TR\CrashDemo\Form1.cs      21   13   CrashDemo  

 

Indeed, there are no such files anymore in the solution folder; there are three files total, of them two files are new: "f9df51a8-178e-4090-a550-7f138b44e85a" and "pimmInternalFloatingSharedHeap"  in addition to "Form1.resx".  All other files are gone.

If there were any above errors, any next operation in GUI, adding/deleting a reference or opening a new C# project or closing the GUI will crash the system.

At first message ”vshost32-clr.exe has stopped working” appears.  3 options are given.  Selecting any one of them results in a BSOD.   Widows Service Exception BSOD references NIPALK.SYS (DAQmx package).  System then proceeds to restart on its own.

 

Crucial operations for crash appear to be (i.e. crash does not take place without these two conditions) 

1. to include at least one control to the form

2. include “using NationalInstruments.DAQmx” statement before the Framework target type is changed. 

3. to include DAQmx reference

 

All relevant parts (DAQ subsystem, .NET 3.5 subsystem) work, that is  if the crash recipe is avoided, then this and other programs compile (or do not) and run normally, USB 6211 collects data and so forth

  

Who's bug ?????

 

Tonu

0 Kudos
Message 1 of 70
(8,257 Views)

This post was edited on 2/17/2011 for the benefit of new viewers of this thread.


Please reference the following KnowledgeBase article for an update that fixes this issue:
KnowledgeBase 5IFBKBQ7: Visual Studio Projects Referencing National Instruments Drivers May Cause Bl...

 

-----------------------------------------------------------------------------------------------------------------------------------------------

 

Dear Tonu,

 

First of all, I would like to ask why are you trying to change the target framework. I tried to reproduce this problem in my computer without success. It is quite interesting that you are getting a BSOD by doing this. The NIPALK.SYS is related to the NI PAL software. NI-PAL is the Platform Abstraction Layer that gives a common interface for NI drivers to interact with the different buses and operating systems that NI supports. NI PAL should be installed whenever you install any NI drivers. I would suggest to try installing the latest version of NI DAQmx drivers.

Regards,
Efrain G.
National Instruments
Visit http://www.ni.com/gettingstarted/ for step-by-step help in setting up your system.
0 Kudos
Message 2 of 70
(8,226 Views)

Hi Tonu,

 

Thank you for posting such detailed instructions on how to reproduce the problem. With the information from your post, I was easily able to reproduce this crash.

 

I looked at the resulting kernel memory dump, and this seems to be crashing in the same place as BSOD with USB-6211. I'll let the developer who has been investigating that crash know about this thread.

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 3 of 70
(8,218 Views)

Dear Efrain,

At first, my Target framework was set to 4.0 Client by default (I did not need it to be 4.0).  I knew what two references I needed for DAQmx, but they did not pop up in the list; thus I concluded, that most probably DAQmx is supported only by frameworks 3.5 and 2.0. Not a big deal, I changed the framework. Kaboom!   My first crash was a capital one, not only did BSOD kick me out of an hour's worth of work, but also MS VS GUI itself got damaged so bad (side-by-side errors, devenv did not start) that I just reinstalled the whole studio.

Of course knowing in advance that 4.0 and DAQmx do not work together allows one to select proper framework while creating the project.  However, that the next crash happened exactly in the same way made me curious.  Curious, because BSOD was repeating itself, program was not run yet, DAQmx was presumably not accessed (or is the compiler accessing DAQmx subsystem?), and yet there was no error message, instead Visual Studio and its mother Windows 7 just collapse hand-in-hand.  I do not think that changing target framework is heresy.  IMO, anything I can do in GUI should not cause BSOD, but should rather inform me of my stupidity. 🙂

 

DAQmx drivers in the system where the crash first appeared were version 9.2.2;  do you have something more up-to-date already, I just downloaded them?

 

BTW, at least one NI person (Brad K) was able to reproduce the BSOD easily.  He thinks that BSOD may be related to USB-6211 BSOD.  However, crash occurs no matter is USB-6211 physically connected or not. In one of the computers, attached device list in the Explorer was completely empty and 6211 had never been present.  In my case, the exact order of steps was important.  And in all 3 computers I tried it, it worked like a jinx.

 

Tonu

0 Kudos
Message 4 of 70
(8,203 Views)

Hi Tonu,

 

I wanted to let you know that we have found that this is indeed a bug in our software. Our R&D department has already been notified and they are working on it. As far as a newer version of DAQmx drivers, you already have the latest.

 

Just for now, let's try to stay away from this bug by not changing the target framework. We really appreciate your feedback.

Regards,
Efrain G.
National Instruments
Visit http://www.ni.com/gettingstarted/ for step-by-step help in setting up your system.
Message 5 of 70
(8,153 Views)

I think, I have the same problem. I'm working on WinXP PRO SP 3 with the NI-DAQmx components Version 9.0.2.

 

I have converted my VS project from VS 2008 to VS 2010 (.NET Framework 3.5). I startet a debug in Visual Studio to debug the application (first try in VS 2010). The application seemed to work. Later I tried to restart Windows and got a BSOD. I restartet Windows than and try to start Visual Studio 2010. No way. My VS GUI got damaged, so I had to reinstall the whole VS- Application.

I have tried this three times. Oh my good. Every time i had to reinstall the VS- Application.

 

Is there a workaround on the problem or can you tell me when the problem will be solved?

 

TIA

Ralf

0 Kudos
Message 6 of 70
(8,081 Views)

Hey guys,

 

Is there anyway you can provide us with a crash dump log from your BSOD and upload it to our FTP server? This will help our investigation.

Regards,
Efrain G.
National Instruments
Visit http://www.ni.com/gettingstarted/ for step-by-step help in setting up your system.
0 Kudos
Message 7 of 70
(8,018 Views)

Efrain,

I uploaded 8 minidumps that I had as Tonus_Minidumps.zip onto your ftp server's /incoming directory.  Please let me know if you want something else rather.  For full kernel dumps I need to tweak my system and kill it again. No time for now for that right now, though.

Sincerely,

Tonu

0 Kudos
Message 8 of 70
(8,012 Views)

Hey Efrain,

 

I uploaded 5 minidumps in a zipfile called minidump_ni_bsod.zip on your ftp server's /incoming directory. I hope this will help you.

 

Regards,

Ralf

0 Kudos
Message 9 of 70
(7,994 Views)

Hi Ralf and Tonu

 

I really appreciate your time to help us find a solution for this problem. Our R&D department is actively working on this issue right now. Your crash dump logs are been investigated.

Regards,
Efrain G.
National Instruments
Visit http://www.ni.com/gettingstarted/ for step-by-step help in setting up your system.
0 Kudos
Message 10 of 70
(7,986 Views)