OpenCv 4.53, VS 2017, Win10, C++
All of a sudden in Debug mode I am getting this exception with cv:::waitkey
Exception thrown at 0x7904BC81 (opencv_highgui453d.dll) in MDI_VSDPV.exe: 0xC0000005: Access violation reading location 0x00000008. occurred
I have rebuilt the VS solution. Closed and Started VS, Rebooted the computer.
Has anyone ever run into this?
Ed
It says opencv_highgui453d.pdb not found. I’ll have to check this out. Sorry about that.
The pdb file is where it is supposed to be and where it always was along with all of the other pdb file… I give up…I have no idea but for now I cannot debug.
Any help would be appreciated.
Ed
Check if all you lib in linking process are in debug mode
example all opencv libs are with suffix d
/OUT:"G:\Lib\build\opencv\bin\Debug\example_cpp_bgfg_segm.exe" /MANIFEST /NXCOMPAT /PDB:"G:/Lib/build/opencv/bin/Debug/example_cpp_bgfg_segm.pdb" /DYNAMICBASE "..\..\3rdparty\lib\Debug\ippiwd.lib" "..\..\3rdparty\ippicv\ippicv_win\icv\lib\intel64\ippicvmt.lib" "..\..\lib\Debug\opencv_gapi455d.lib" "..\..\lib\Debug\opencv_stitching455d.lib" "..\..\lib\Debug\opencv_alphamat455d.lib" "..\..\lib\Debug\opencv_aruco455d.lib" "..\..\lib\Debug\opencv_barcode455d.lib" "..\..\lib\Debug\opencv_bgsegm455d.lib" "..\..\lib\Debug\opencv_bioinspired455d.lib" "..\..\lib\Debug\opencv_ccalib455d.lib" "..\..\lib\Debug\opencv_dnn_objdetect455d.lib" "..\..\lib\Debug\opencv_dnn_superres455d.lib" "..\..\lib\Debug\opencv_dpm455d.lib" "..\..\lib\Debug\opencv_face455d.lib" "..\..\lib\Debug\opencv_fuzzy455d.lib" "..\..\lib\Debug\opencv_hfs455d.lib" "..\..\lib\Debug\opencv_img_hash455d.lib" "..\..\lib\Debug\opencv_intensity_transform455d.lib" "..\..\lib\Debug\opencv_line_descriptor455d.lib" "..\..\lib\Debug\opencv_mcc455d.lib" "..\..\lib\Debug\opencv_quality455d.lib" "..\..\lib\Debug\opencv_rapid455d.lib" "..\..\lib\Debug\opencv_reg455d.lib" "..\..\lib\Debug\opencv_saliency455d.lib" "..\..\lib\Debug\opencv_sfm455d.lib" "..\..\lib\Debug\opencv_stereo455d.lib" "..\..\lib\Debug\opencv_structured_light455d.lib" "..\..\lib\Debug\opencv_superres455d.lib" "..\..\lib\Debug\opencv_surface_matching455d.lib" "..\..\lib\Debug\opencv_tracking455d.lib" "..\..\lib\Debug\opencv_videostab455d.lib" "..\..\lib\Debug\opencv_viz455d.lib" "..\..\lib\Debug\opencv_wechat_qrcode455d.lib" "..\..\lib\Debug\opencv_xfeatures2d455d.lib" "..\..\lib\Debug\opencv_xobjdetect455d.lib" "..\..\lib\Debug\opencv_xphoto455d.lib" "..\..\lib\Debug\opencv_shape455d.lib" "..\..\lib\Debug\opencv_highgui455d.lib" "..\..\lib\Debug\opencv_datasets455d.lib" "..\..\lib\Debug\opencv_plot455d.lib" "..\..\lib\Debug\opencv_text455d.lib" "..\..\lib\Debug\opencv_ml455d.lib" "..\..\lib\Debug\opencv_phase_unwrapping455d.lib" "..\..\lib\Debug\opencv_optflow455d.lib" "..\..\lib\Debug\opencv_ximgproc455d.lib" "..\..\lib\Debug\opencv_videoio455d.lib" "..\..\lib\Debug\opencv_video455d.lib" "..\..\lib\Debug\opencv_imgcodecs455d.lib" "..\..\lib\Debug\opencv_objdetect455d.lib" "..\..\lib\Debug\opencv_calib3d455d.lib" "..\..\lib\Debug\opencv_features2d455d.lib" "..\..\lib\Debug\opencv_flann455d.lib" "..\..\lib\Debug\opencv_dnn455d.lib" "..\..\lib\Debug\opencv_photo455d.lib" "..\..\lib\Debug\opencv_imgproc455d.lib" "..\..\lib\Debug\opencv_core455d.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "comdlg32.lib" "advapi32.lib" /IMPLIB:"G:/Lib/build/opencv/bin/Debug/example_cpp_bgfg_segm.lib" /DEBUG /MACHINE:X64 /INCREMENTAL /PGD:"G:\Lib\build\opencv\bin\Debug\example_cpp_bgfg_segm.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"example_cpp_bgfg_segm.dir\Debug\example_cpp_bgfg_segm.exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /TLBID:1
Laurent,
Thanks for this. It ended up being one of those misleading error messages. At one point I even re-ran the CMake and re-built the Debug solution to no avail. As I said, it happened all of a sudden and the waitKey that it was failing on was a waitKey that had been in the code for years.
As it turns out I had accidentally created a namedWindow in a function that was not part of the main thread. I fixed the problem by passing a memory variable to the main thread to have the namedWindow created there.
What gave me the hint was that I ran Debug to that point and realized that it ran past that waitKey for many cycles until I clicked on a button in which the namedWindow was created. The error message from VS was of no help whatsoever. As is the case sometimes.
Live and Learn…thanks again
Ed
2 Likes