is there a reason that this code releases a break point?
I m am using CVB version 13.00.005 64 bit on Windows 10, visual studio 2013 and a geni nano M1920 camera.
int _tmain(int argc, _TCHAR* argv[])
{
std::vector<char> driverPath(256);
TranslateFileName("%CVB%\\Drivers\\GenICam.vin", &driverPath[0], driverPath.size());
std::string driver_path = &driverPath[0];
void* pImage;
cvbbool_t ok = LoadImageFile(driver_path.c_str(), pImage);
SetTimeout(pImage, 2000);
ok = ReleaseObject(pImage);
// At this step: "... .exe has trigerred a breakpoint".
// if continued ok is 1 and pImage nullpointer as expected.
return 0;
}
There should be a checkbox in the debug settings of Visual Studio in regard to null reference exeptions and if they should trigger a break point or not. One of you might have it set and one does not.
You could also check/uncheck “Just My Code” in Options > Debugging > General.
you code looks fine, so it seems you’ve found a bug. However I’ve no idea where it could hide in such a short program. Please let it crash again and create a dump. Then contact support@stemmer-imaging.de to send the dump to us.
If I run the code with a debugger, either in Release or in Debug mode, at the step ReleaseObject a pop up window opens .
If I click on continue it goes on normally and ok becomes true again and pImage nullptr (as expected, it was released).
What are the last few lines in the output window of Visual Studio (not the console window in which the program executes - the little dockable window that is by default below your source window while debugging).
If you press “Break” instead of “Continue”, what does the call stack look like?
First-chance exception at 0x00007FF8E311A388 in TestCVBLight.exe: Microsoft C++ exception: cvbGenApi::cvgenapi_error at memory location 0x00000032B798C610.
First-chance exception at 0x00007FF8E311A388 in TestCVBLight.exe: Microsoft C++ exception: cvbGenApi::cvgenapi_error at memory location 0x00000032B798E640.
The thread 0x1c40 has exited with code 0 (0x0).
The thread 0x15c0 has exited with code 0 (0x0).
The thread 0xfd0 has exited with code 0 (0x0).
The thread 0x26c8 has exited with code 0 (0x0).
First-chance exception at 0x00007FF8E311A388 in TestCVBLight.exe: Microsoft C++ exception: siIPCPipe::IPCException at memory location 0x00000032B80FED00.
First-chance exception at 0x00007FF8E311A388 in TestCVBLight.exe: Microsoft C++ exception: siIPCPipe::IPCException at memory location 0x00000032B81FF7A0.
The thread 0x18e0 has exited with code 0 (0x0).
The thread 0x2944 has exited with code 0 (0x0).
'TestCVBLight.exe' (Win32): Unloaded 'C:\Program Files\STEMMER IMAGING\Common Vision Blox\GenICam\bin\win64_x64\TLIs\GevFD.dll'
'TestCVBLight.exe' (Win32): Unloaded 'C:\Program Files\STEMMER IMAGING\Common Vision Blox\GenICam\bin\win64_x64\TLIs\GEVSD.dll'
The thread 0x1b44 has exited with code 0 (0x0).
'TestCVBLight.exe' (Win32): Unloaded 'C:\Program Files\STEMMER IMAGING\Common Vision Blox\GenICam\bin\win64_x64\TLIs\GEVTL.cti'
HEAP[TestCVBLight.exe]: HEAP: Free Heap block 0000019FD2B979C0 modified at 0000019FD2B97E38 after it was freed
TestCVBLight.exe has triggered a breakpoint.
That’s more complicated than I would have expected. Two more questions:
What happens if you omit the SetTimeout call prior to ReleaseObject?
Is there a chance to make a dump available to support@stemmer-imaging.de? To generate such a dump you’d need to bring the program to the state where the “TestCVB.exe has triggered a breakpoint” window pops up, then click “Break” and afterwards select “Save Dump As…” from the “Debug” menu: