08-12-2015 09:12 AM
Hi,
The CVI2015 IDE sometimes hangs on exit. I'm still trying to figure out when.
Meanwhile I can give you the event data that's recorded by the event log:
0000: 43 00 72 00 6F 00 73 00 C.r.o.s. 0008: 73 00 2D 00 74 00 68 00 s.-.t.h. 0010: 72 00 65 00 61 00 64 00 r.e.a.d. 0018: 00 00 00 00 ....
Maybe this is of help.
Solved! Go to Solution.
08-12-2015 10:52 AM
Hi, CVI-User
Can you provide the entire event log entry? We will need more context for the data here.
Are you able to cause this hang by following a specific series of actions before closing LabWindows/CVI?
Thanks,
08-25-2015 08:03 AM
So, after some experimenting a hang is caused by the source code browser not being able to cope with:
#include <windows.h> static HINSTANCE DLLHandle; static BOOL (__stdcall *F_Ptr)(BOOL on); static int LoadDLLIfNeeded(void) { F_Ptr = (BOOL (__stdcall *)(BOOL on)) GetProcAddress(DLLHandle, "F")); goto FunctionNotFoundError; return 0; FunctionNotFoundError: return -1; }
The IDE hangs on exit as soon as you add a file with this code to a project.
08-25-2015 09:47 AM
Hello CVI-User!
I managed to reproduce the bug and identify the cause of this hang. It seems the LabWindows/CVI 2015 ADE hangs while trying to generate browsing information for the call to GetProcAddress. The main problem is the construct containing the function pointer cast.
Fortunately, there's an easy workaround for this issue: use typedef wrappers when casting function call results to function pointers. In your case:
typedef BOOL (__stdcall *FunctionType)(BOOL on);
static FunctionType F_Ptr;
static int LoadDLLIfNeeded(void)
{
F_Ptr = (FunctionType)GetProcAddress(DLLHandle, "F");
...
This workaround not only prevents CVI from hanging, but also ensures a good practice for writing cleaner and easier to maintain code.
Meanwhile, CAR #543277 has been filed, to ensure this bug will be considered for fixing in an upcoming release of LabWindows/CVI.
I hope this helps!
Best regards!
- Johannes
08-25-2015 10:13 AM
Thanks alot, Johannes!
This seems to resolve all the hangs I had.
08-23-2016 02:37 AM - last edited on 11-18-2024 11:18 AM by Content Cleaner
Hi CVI-User!
The issue described by CAR #543277 has been addressed by the LabWindows/CVI 2015 SP1. Other information on bug fixes for this update can be found at: https://www.ni.com/en/support/documentation/bugs/16/labwindows--cvi--2015-sp1-bug-fixes.html
Thanks,
- Johannes