LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PrintPanel crash

Solved!
Go to solution

I am experiencing crashes of my application when it calls PrintPanel() or GetScaledPanelDisplayBitmap(). 

The crash occurs on Windows 7 Professional N 64 bit running on an AMD Athlon 64 3800+ with 8GB RAM.  The printer is networked.  The crash typically occurs on the second call to either function.  The first call works OK. 

 

cvirte is 9.1.0.428, I am learned of the patch and found that my version is already at 9.1.0.428. 

 

The crash occurs on a test machine, so we wipe the disk and do a clean install of Windows and then a clean install of the application. 

 

My development machine is Windows 7 Professional  64 bit on an Intel Q9400.  The program runs (prints etc.) OK on the development machine when run from the CVI IDE either in debug or release mode. 

 

I'm running CVI 2009 Version 9.1.0 (428).

 

With the next release of the application overdue, I'm at a loss as to what to try next.  Any suggestions will be much appreciated.

0 Kudos
Message 1 of 9
(4,091 Views)

We've done some additional testing on more machines and operating systems. 

 

1.. I installed the program on the development machine.  It crashes on the second call to the PrintPanel() function.  The exact same program runs OK when started from within the IDE in release mode (did not recompile since the build and install).  It also ran OK in debug mode in previous tests.

 

2.  Tested on an Intel Q8300 running Windows 7 home Premium.  Program crashes.

 

3.  Tested on AMD Athlon Dual core running XP, Runs OK.

 

4.  Tested on Intel Pentium M running XP, Runs OK. 

 

Maybe a Windows 7 related problem??

Has anyone else had success (or failure) with CVI 9.1.0.428 bitmap and PrintPanel functions on Windows 7?

 

 

 

0 Kudos
Message 2 of 9
(4,069 Views)

Hey CreviceDweller -

 

This is a bit of a surprise, as the 428 patch was well tested before it was released.  To verify that the crash is the same as what the 428 patch was intended to fix, do you think you could follow the steps here to generate a crash dump for me?  When you've got the .dmp file, you can post it to ftp://ftp.ni.com/incoming and I'll take a look asap.

 

NickB

National Instruments

0 Kudos
Message 3 of 9
(4,060 Views)

The crashdump and map file are on the ftp site in a zip file named CreviceDwellerCrashDump.zip

 

The map file was created on the development machine.  The crash dump is from the test machine and is actually from a build done yesterday but with no code changes. 

 

I tried to save the crash dump on the development machine, but this time it did not crash....weird!

 

0 Kudos
Message 4 of 9
(4,053 Views)

So - after examining the dump, the crash you're seeing appears to be entirely unrelated to the issue the 428 patch fixed.  The crash looks like something I should be able to reproduce, but I've been unable to so far with a simple test application.  Is there any chance you can post your code in a way I can build and run it to reproduc the crash?

 

The crash has to do with callback functions not being cleared out internally when they should be, resulting in code being called during the disposal of the temporary panels created for printing.  There's one thing I'm curious about after looking at the dump - does the panel you're printing have a callback function defined??  Also - it looks like the structure of you application is one parent panel that has one child panel that has 23 child panels.  Is this correct???

 

Thanks -

 

NickB

National Instruments

0 Kudos
Message 5 of 9
(4,039 Views)

Source code is on the ftp site.  File name is SEA8.zip.  The project is in the SEA8 folder named SEA8.  Other folders and files include support files you may need to build the project. 

 

Run the project, select "Simulated Mode" then start the simulator (top left panel, button near bottom).  Wait a few seconds to acquire useful data, then click the "Save" button at the top left of the parent panel (looks like the top left menu item), check all four boxes on the popup panel then click the "Save" button on the popup panel.

 

The structure is one parent panel with many child panels and several popups.  The project started eleven years ago with one parent and four child panels. 

 

Feel free to call me if you have questions or if I failed to include a required file.

 

 

 

0 Kudos
Message 6 of 9
(4,018 Views)

Thanks for the project - I've been able to reproduce the crash, and I'll be looking into it this morning.  I'll let you know as soon as I have more information.

 

NickB

National Instruments

0 Kudos
Message 7 of 9
(4,005 Views)
Solution
Accepted by topic author CreviceDweller

Ok - after debugging the crash I think we have enough information to help you work around the issue.  Basically, we are getting an error internally that isn't being handled properly, which leads to an inconsistent state in your program.  The root of the problem is that we are trying to set focus to a control on one of your panels that is inactive.  This causes the error that isn't being handled properly.

 

It is going to take some time for us to thoroughly debug and fix this issue, but I think that in the meantime there is a simple workaround that should work for you.  In the file SEA+.c, immediately before you call GetScaledPanelDisplayBitmap at ~line 11790, you should call SetActiveCtrl (analPnlHandle, ANAL_SELECTOR)  (The control you set as active isn't crucial, it just shouldn't be ANAL_RESTART).  I tried this on my own machine, and it seems to have completely resolved the issue.

 

Of course, we will eventually correctly fix this issue, it's just going to take some time.

 

Let me know if you have any questions, or if this does not resolve the issue for you -

 

NickB

National Instruments

Message 8 of 9
(4,001 Views)

Nick.

 

That is fantastic!  Thanks much for all your help.  I'll implement the workaround solution, and submit it to our test group.  I'll mark this as accepted with multiple kudos when they sign off.

 

 

0 Kudos
Message 9 of 9
(3,987 Views)