imshow crash (Patch #1896)


Added by Philippe FOUBERT almost 13 years ago. Updated almost 13 years ago.


Status:Cancelled Start date:2012-05-06
Priority:Normal Due date:
Assignee:Andrey Kamaev % Done:

0%

Category:build/install
Target version:2.4.1
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

I successfully built OpenCV 2.4 from svn trunk on Windows XP (32 bits, SP3) with MinGW (GCC 4.6.2) but when, for example, i launch the "drawing.exe" sample, i have a crash which seems to be due to the call to "imshow" function (when i put the calls to "imshow" into comments, i have no crash).

Notes:
  • The behavior seems to be the same with each sample executable which is using the "imshow" function.
  • I used dependancy walker: all required libraries are found.
  • To avoid having a build too different from yours, i let all default options (i only desactivated Cuda)
  • To be sure it was not due to my operating system, i did the same thing with OpenCV 2.3.1 (the version i currently use in my projects): no crash, "drawing.exe" and similar samples are working as expected.

Any idea? Is there something i did wrong?

Regards,
Philippe.


f07_appcompat.txt - Windows error report (34.3 kB) Philippe FOUBERT, 2012-05-06 06:55 pm

OpenCVCompilerOptions.cmake.patch - Patch to solve mingw32 SSE/SSE2 instabilities (513 Bytes) Philippe FOUBERT, 2012-05-08 04:53 pm


Related issues

related to Bug #583: mingw32 SSE/SSE2 instabilities Cancelled
related to Bug #1494: imshow crash on Windows 7 32bits Cancelled
related to Bug #1926: OpenCV2.4 lib complied by mingw not working Cancelled 2012-05-13
related to Bug #1668: crash using namedWindow Cancelled
duplicates Bug #1932: openCV 2.3.1 crashes with SSE/SSE2 and -O3 Done 2012-05-14

Associated revisions

Revision 07658aeb
Added by Andrey Kamaev almost 13 years ago

Fixed replacement of -O3 with -O2 for mingw compiler #1896

Revision 26fb7603
Added by Andrey Kamaev almost 13 years ago

Fixed typo #1896

History

Updated by Philippe FOUBERT almost 13 years ago

Sorry, i forgot cv::getBuildInformation():

General configuration for OpenCV 2.4.0 =====================================
Version control: svn:8315M

Platform:
Host: Windows 5.1 x86
CMake: 2.8.8
CMake generator: MinGW Makefiles
CMake build tool: c:/mingw32/bin/mingw32-make.exe
Configuration: Release

C/C++:
Built as dynamic libs?: YES
C++ Compiler: C:/MinGW32/bin/g++.exe (ver 4.6.2)
C++ flags (Release): -Wall -march=i686 -fomit-frame-pointer -msse -msse2 -mfpmath=sse -ffunction-sections -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -Wall -march=i686 -fomit-frame-pointer -msse -msse2 -mfpmath=sse -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -ggdb3
C Compiler: C:/MinGW32/bin/gcc.exe
C flags (Release): -Wall -march=i686 -fomit-frame-pointer -msse -msse2 -mfpmath=sse -ffunction-sections -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -Wall -march=i686 -fomit-frame-pointer -msse -msse2 -mfpmath=sse -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -ggdb3
Linker flags (Release):
Linker flags (Debug):

OpenCV modules:
To be built: calib3d contrib core features2d flann gpu highgui imgproc legacy ml nonfree objdetect photo stitching ts video videostab
Disabled by user: -
Disabled by dependency: -
Unavailable: androidcamera java python

GUI:
Win32 UI: YES
OpenGL support: NO

Media I/O:
ZLib: build (ver 1.2.6)
JPEG: build (ver 62)
PNG: build (ver 1.5.9)
TIFF: build (ver 42)
JPEG 2000: build (ver 1.900.1)
OpenEXR: NO
OpenNI: NO
OpenNI PrimeSensor Modules: NO
XIMEA: NO

Video I/O: DirectShow
FFMPEG: YES (prebuilt binaries)
codec: YES (ver 53.61.100)
format: YES (ver 53.32.100)
util: YES (ver 51.35.100)
swscale: YES (ver 2.1.100)
gentoo-style: YES

Other third-party libraries:
Use IPP: NO
Use TBB: NO
Use Cuda: NO
Use Eigen: NO
Use Clp: NO

Python:
Interpreter: C:/Python25/python.exe (ver 2.5.1)

Documentation:
Build Documentation: NO
Sphinx: NO
PdfLaTeX compiler: NO

Tests and samples:
Tests: YES
Performance tests: YES
Examples: YES

Install path: C:/Projets/workspace_opensource/opencv_build/install

cvconfig.h is in: C:/Projets/workspace_opensource/opencv_build
-----------------------------------------------------------------

Updated by Philippe FOUBERT almost 13 years ago

It took me some time but i have been able to solve the problem by modifying "OpenCVCompilerOptions.cmake" (cf. the attached patch).
It was a correction i had already done in my local adaptation of OpenCV 2.3.1 that's why it worked with 2.3.1 and not with 2.4.0...

I think it can also solve the ticket Ticket #583 (mingw32 SSE/SSE2 instabilities)

It could be usefull to include this patch into the trunk as soon as possible.

Regards,
Philippe.

  • File OpenCVCompilerOptions.cmake.patch added

Updated by Andrey Kamaev almost 13 years ago

  • Tracker changed from Bug to Patch
  • Target version set to 2.4.1
  • Category changed from highgui-images to build/install
  • Assignee changed from Alexander Reshetnikov to Andrey Kamaev

Updated by Matthew Gingold almost 13 years ago

Thanks for this information. I tried to compile both 2.3.1 and 2.4.0 in Release with SSE/SSE2 and CMAKE_CXX_FLAGS_RELEASE set to -O2 but both failed to work (eg., calls to cvThreshold cause SIGSEGV).

I needed to use -O1 when compiling both 2.3.1 and 2.4.0 to resolve these crashes.

Updated by Andrey Kamaev almost 13 years ago

Thanks for the report and patch!

I've committed the fix for this problem (not exactly yours but it does the same) to the OpenCv trunk.

Mattew, can you create a new bug report for your case? Please specify the exact mingw and OS versions used. It also might be helpful if you have download link for your build of mingw.

  • Status changed from Open to Done

Updated by Philippe FOUBERT almost 13 years ago

I have successfully tested your adaptation on my computer.

Philippe.

Updated by Matthew Gingold almost 13 years ago

Hi Andrey & Philippe

Today I tested more extensively and made a bug report as requested: http://code.opencv.org/issues/1932 hopefully it will be possible to find a way to compile openCV with a more full optimisation under mingw32. I am wondering if there is perhaps some specific optimizations we should try turning on/off to find out which one is responsible for causing these crashes?

Updated by Andrey Kamaev almost 13 years ago

The fix from this issue was overridden by the fix for #1932. Please, verify that OpenCV trunk r8373 does not crash.

  • Status changed from Done to Cancelled

Updated by Philippe FOUBERT almost 13 years ago

Very smart job! Your answer is much more satisfying than mine since we have an explanation. I have tested it successfully with r8385:

opencv_version.exe -b:

General configuration for OpenCV 2.4.0 =====================================
Version control: svn:8385

Platform:
Host: Windows 5.1 x86
CMake: 2.8.8
CMake generator: MinGW Makefiles
CMake build tool: c:/mingw32/bin/mingw32-make.exe
Configuration: Release

C/C++:
Built as dynamic libs?: NO
C++ Compiler: C:/MinGW32/bin/g++.exe (ver 4.6.2)
C++ flags (Release): -fPIC -mstackrealign -Wall -march=i686 -fomit-frame-pointer -msse -msse2 -mfpmath=sse -ffunction-sections -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -fPIC -mstackrealign -Wall -march=i686 -fomit-frame-pointer -msse -msse2 -mfpmath=sse -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -ggdb3
C Compiler: C:/MinGW32/bin/gcc.exe
C flags (Release): -fPIC -mstackrealign -Wall -march=i686 -fomit-frame-pointer -msse -msse2 -mfpmath=sse -ffunction-sections -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -fPIC -mstackrealign -Wall -march=i686 -fomit-frame-pointer -msse -msse2 -mfpmath=sse -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -ggdb3
Linker flags (Release):
Linker flags (Debug):

OpenCV modules:
To be built: calib3d contrib core features2d flann gpu highgui imgproc legacy ml nonfree objdetect photo stitching ts video videostab
Disabled by user: world
Disabled by dependency: -
Unavailable: androidcamera java python

GUI:
Win32 UI: YES
OpenGL support: NO

Media I/O:
ZLib: build (ver 1.2.6)
JPEG: build (ver 62)
PNG: build (ver 1.5.9)
TIFF: build (ver 42)
JPEG 2000: build (ver 1.900.1)
OpenEXR: NO
OpenNI: NO
OpenNI PrimeSensor Modules: NO
XIMEA: NO

Video I/O: DirectShow
FFMPEG: YES (prebuilt binaries)
codec: YES (ver 53.61.100)
format: YES (ver 53.32.100)
util: YES (ver 51.35.100)
swscale: YES (ver 2.1.100)
gentoo-style: YES

Other third-party libraries:
Use IPP: 7.0 [7.0.205]
at: C:/Program Files/Intel/Composer XE/ipp
Use TBB: YES (ver 4.0 interface 6004)
Use Cuda: NO
Use Eigen: YES (ver 3.0.5)
Use Clp: NO

Python:
Interpreter: C:/Python25/python.exe (ver 2.5.1)

Documentation:
Build Documentation: NO
Sphinx: NO
PdfLaTeX compiler: NO

Tests and samples:
Tests: YES
Performance tests: YES
Examples: YES

Install path: C:/Projets/workspace_opensource/opencv_trunk_build/install

cvconfig.h is in: C:/Projets/workspace_opensource/opencv_trunk_build
-----------------------------------------------------------------

Also available in: Atom PDF