highgui's namedWindow corrupts heap (Bug #2435)
Description
version from site and the latest version from git have both this bug
The IDE is VS 2012.
#include "stdafx.h" #include "vader.h" using namespace cv; int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPTSTR lpCmdLine, _In_ int nCmdShow) { UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); cv::String winName("cameraImage"); namedWindow(winName,CV_WINDOW_AUTOSIZE); /* 1 window name is not the same as in code, it contains of mojibake (крякозябры) (debug configuration, in release it in most cases looks right but the string which contains its name is constantly changing) 2 some of the following function calls causes crash */ cvWaitKey(0); Mat img=imread("darthvader.png"); double fps=30; int key=0; UINT delay=1000/fps; while (key = cvWaitKey(delay)){ imshow(winName,img); if (key == VK_ESCAPE) break; } cvDestroyAllWindows(); return 0; }
Associated revisions
Merge pull request #2435 from SpecLad:merge-2.4
History
Updated by Kazuki Matsuda over 12 years ago
Hi.
I have a 2 question.
1) Do you using self build library?
2) Are you care about difference of Debug/Release library"
When you build for Debug, you must link "opencv_yyyy243*d*.lib" and when you build for Release, you must link "opencv_yyy243.lib".
"d" is important. When you missing "d" or adding unnecessary "d", will invoke mojibake or application crash.
Updated by KOLANICH KOLANICH over 12 years ago
1) Yes.
http://pastebin.com/cvzyPew6
2) I link to Release library, but I also have troubles and crashes in Release mode.
Updated by Kazuki Matsuda over 12 years ago
OK.
But I cant reproduce the problem... Sorry.
Updated by KOLANICH KOLANICH over 12 years ago
Is my config wrong?
https://gist.github.com/d71d07c51d5cd6924432
Updated by Kirill Kornyakov over 12 years ago
You should detect which function causes the crash yourself. It is possible, that the bug in your application, not OpenCV.
- Priority changed from High to Low
- Description changed from @#include "stdafx.h" #include "vader.h" using namespace... to version from site and the latest version from git have both this bug The IDE... More
- Assignee changed from Vadim Pisarevsky to KOLANICH KOLANICH
Updated by Daniil Osokin over 12 years ago
Hi! If you have other version of VS, please, try to build libs with it and write, is the issue reproduced in this case.
Updated by Andrey Kamaev over 12 years ago
- Target version deleted (
2.4.3)
Updated by Maksim Shabunin over 9 years ago
Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4435