Release image object causes break points

Hello,

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;
}

Hi @esma

what exactly do you mean with :

Ive just copied your code and can debug it as expected.

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.

Hi @esma

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.

Thanks.

Hello Chris,

If I run the code with a debugger, either in Release or in Debug mode, at the step
ReleaseObject a pop up window opens grafik.
If I click on continue it goes on normally and ok becomes true again and pImage nullptr (as expected, it was released).

Hi @esma

two things might help us further:

  1. 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).
  2. If you press “Break” instead of “Continue”, what does the call stack look like?

Hi illusive,

For point 1.:

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.

For point 2.:

 	ntdll.dll!00007ff8e6d31612()	Unknown
 	ntdll.dll!00007ff8e6c3f24b()	Unknown
 	ntdll.dll!00007ff8e6c4061c()	Unknown
 	ntdll.dll!00007ff8e6d30658()	Unknown
 	ntdll.dll!00007ff8e6c3e57b()	Unknown
 	ntdll.dll!00007ff8e6c4061c()	Unknown
 	ucrtbase.dll!00007ff8e3d6d92b()	Unknown
 	GenICam.vin!00007ff8a1922690()	Unknown
 	GenICam.vin!00007ff8a18f504d()	Unknown
 	GenICam.vin!00007ff8a1964bc3()	Unknown
 	GenICam.vin!00007ff8a1963d54()	Unknown
 	GenICam.vin!00007ff8a18f40a7()	Unknown
 	GenICam.vin!00007ff8a194f075()	Unknown
 	GenICam.vin!00007ff8a193dc64()	Unknown
 	CVBase_v1_2.dll!00007ff8a21acd6d()	Unknown
 	CVBase_v1_2.dll!00007ff8a21acd99()	Unknown
 	CVBase_v1_2.dll!00007ff8a21ad83b()	Unknown
 	CVCImg.dll!00007ff8a23b3e09()	Unknown
>	TestCVBLight.exe!wmain(int argc, wchar_t * * argv) Line 22	C++
 	[External Code]

That’s more complicated than I would have expected. Two more questions:

  1. What happens if you omit the SetTimeout call prior to ReleaseObject?
  2. 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:

Hello,

  1. Without SetTimeout I am still getting the break point while “ReleaseObject”.
  2. I sent yesterday an E-Mail to support@stemmer-imaging.de with a link to get the dump file.

:+1:
thanks @esma! We’ll get back to you asap!

Hi,

as far as I know an update to CVB 13.01 solved the issue.

Could it be that pImage should be initialized=