I've ran into an issue for my own project, and after trying to reproduce that issue I found it also happens with the imageBasics sample project.
When I run (running it from Visual Studio 10; MRPT.sln -> right click the sample project -> Debug -> Start new instance) this in Debug configuration, I get the following message:
"Windows has triggered a breakpoint in imageBasics.exe.
This may be due to a corruption of the heap, which indicates a bug in imageBasics.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while imageBasics.exe has focus.
The output window may have more diagnostic information."
The button "Break" and "Continue" are allowed to be pressed, but the "Ignore" is not.
When I just click Continue and keep press "Ignore" and "Continue" in the subsequent messages I get (grand total of about 9 messages, possibly 3 per image window Opened), I end up with the program actually in (what seems) working order. I get three image windows (win1, win2 and win3) with each an image loaded. When I close win3, the program terminates as it's supposed to do.
When I check the Debug Output log, I see to following:
* Messages related to loading all kinds of .dll files.
* Log messages about "HEAP[imageBasics.exe]: Invalid address specified to RtlValidateHeap( 02480000, 04590048 )", with text of the above described breakpoint message. There are 6 of these messages in total, with 3 unique RtlValidateHeap addresses (again, possibly related to the 3 image windows).
* A message about "The thread 'Win32 Thread' (0x2174) has exited with code 0 (0x0)."
* A message about a detected memory leak, followed by an 'object dump'
* The final message being "The program '[8488] imageBasics.exe: Native' has exited with code 0 (0x0)."
I've attached the full debug log in this thread, as I didn't want to flood this thread with a wall of text.
When running the Release configuration in the same way, I get pretty much the same story although no message about a memory leak.
I've also attached the full debug log in this thread for the Release version.
I've also tried running them using Command Prompt. Running the debug version gives me an Visual Studio 'Debug Assertion Failed' message box, while running the Release version gives me messages in the terminal that state that timeouts have happened while waiting for window creation:
"
Image loaded in 3.145ms
[WxSubsystem::createOneInstanceMainThread] Timeout waiting wxApplication to start up!
[CBaseGUIWindow:ctor] Timeout waiting window creation.
[CBaseGUIWindow:ctor] Timeout waiting window creation.
[CDisplayWindow::setPos] Window closed! win1
[CDisplayWindow::setPos] Window closed! win2
[CDisplayWindow::setPos] Window closed! win3
Press any key on 'win3' to exit
jpeg file save in 1.044
"
I've absolutely no clue what to make of this, but it seems to be related to CDisplayWindow, because that is also where I seem to have problems with in my own project. I have no issues with wxWidgets as I can run image related samples without any problems.
I'm building from an SVN checkout from 8-3-2011, and I'm very sure I didn't use the F12 button ;)
Thanks in advance,
Xilconic
| Attachment | Size |
|---|---|
| 82.31 KB | |
| 9.71 KB |
I've been trying to get a fix
I've been trying to get a fix on what seems to be the cause of the above, but thus far I haven't found it. What I did found, was more problems. I've tried a workaround because I couldn't use the CDisplayWindow class by using the 3D version instead using OpenGL. While it does compile and runs, I get all kinds of different strange problems. I haven't written the various errors down yet, but they seem to happen when things are being written to the viewports of the OpenGL 3D windows (I just take a look at the kinect-3d-view app and used that as basis) en when switching between windows (I've got 1 window for RGB data and 1 for depth data; grabbed from a Kinect at real time. Just basic polling procedure at the moment).
As I haven't heard anything on this subject, I begin to wonder if this might be a bug in the toolkit maybe?
Bumping this post up, as I'm
Bumping this post up, as I'm still having issues while trying to run the following samples (might be other too, but these I've tested):
imageBasics
imageConvolutionFFT
imageCorrelation
(for Debug configuration, Windows 7, using OpenCV 2.2 now, using todays SVN check-out)
Running these from cmd gave me the following:
"Mircrosoft Visual C++ Debug Library
Debug Assertion Failed!
Program: ...PT_OPENCV2_2_TIMING\samples\imageBasics\Debug\imageBasics.exe
File: f:\dd\vctools\crt_bld\self_x86\crt\src\dgbheap.c
Line: 1317
Expression: _CrtIsValidHeapPointer(pUserData)
For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)"
With timing info, when you abort the program:
Image loaded in 8.578ms
Press any key on 'win4' to exit
--------------------------- MRPT CTimeLogger report --------------------------
FUNCTION #CALLS MIN.T MEAN.T MAX.T
------------------------------------------------------------------------------
mrpt::gui::CBaseGUIWindow::createWxWindow 4 14.7ms 23.5ms 34.3ms
mrpt::gui::CDisplayWindow::showImage 4 230.4us 966.4us 1.7ms
mrpt::gui::WxSubsystem::wxMainThread 1 0.0ps 0.0ps 0.0ps
mrpt::synch::CSemaphore::CSemaphore 10 5.6us 11.0us 24.1us
mrpt::synch::CSemaphore::release 6 10.8us 15.4us 16.9us
mrpt::synch::CSemaphore::waitForSignal 6 5.7ms 15.6ms 26.6ms
mrpt::system::detail::createThreadImpl 1 5.9ms 5.9ms 5.9ms
mrpt::utils::CCanvas::drawImage 1 2.5 s 2.5 s 2.5 s
mrpt::utils::CCanvas::ellipseGaussian 2 267.4us 501.1us 734.9us
mrpt::utils::CImage::CImage 6 17.4us 70.8us 245.8us
mrpt::utils::CImage::changeSize 3 5.6us 13.5us 25.1us
mrpt::utils::CImage::loadFromFile 1 8.5ms 8.5ms 8.5ms
mrpt::utils::CImage::operator () 76800 2.1us 3.4us 55.1ms
mrpt::utils::CImage::operator = 3 9.2us 78.5us 187.3us
mrpt::utils::CImage::setFromIplImage 52 4.1us 12.4us 23.1us
mrpt::utils::CImage::setPixel 76800 2.1us 2.6us 1.2ms
mrpt::utils::CImage::~CImage 2 7.2us 7.7us 8.2us
mrpt::utils::CObservable::publishEvent 1 9.8us 9.8us 9.8us
---------------------- End of MRPT CTimeLogger report ------------------------
Still hoping for any insights on how to deal with this issues. Any advice, anyone??
Cheers,
xilconic
No, no idea on this problem.
No, no idea on this problem.
I'll try to reproduce it in the next days...
JL
Hi Xilconic, I had time to
Hi Xilconic,
I had time to make some tests with MSVC10, and at first I also had the same error than you.
This kind of errors always make me suspect on DLLs, and my hunch was right: it was a problem of having the DLLs of wxWidgets, OpenCV & MRPT built with different versions of MSVC.
After recompiling all projects with the same compiler everything works again as normal ;-)
JL
Ah, that does indeed make
Ah, that does indeed make sense, as I've built wxWidgets using MSCV 2008 (version 9), while doing the rest with version 10. Thanks a million! That would indeed explain why I at first didn't had any problems, because at first I installed wxWidgets with version 10 of MSVC but later on I noticed that the people of wxWidgets recommend something different which implied using version 9.
xilconic
EDIT: Confirmed this is the cause of the problem. Marked the thread as [SOLVED]
Great!
Great!