Remap() 16-byte Alignment Issue (Bug #1396)
Description
Steps to reproduce on Windows 7 with hardware equivalent of a Macbook6,1 (2.26GHz Intel Core 2 Duo P7550, 4GB RAM):
1. Fresh Install of Windows 7 x64
2. Install QtSDK 1.1.3 (Comes with MinGW 4.4, GCC 4.4.0 and ld 2.19.1)
3. Install OpenCV from SVN checkout 6769. In CMake: Select Release Mode. Check ENABLE_SSE, ENABLE_SSE2, ENABLE_SSE3, ENABLE_SSSE3, ENABLE_SSE41 and WITH_QT. Uncheck USE_OMIT_FRAME_POINTER. Change RELEASE CXX- and C-FLAGS to -O3 -ggdb3.
4. Run opencv_test_imgproc. Expected result: Crash while calling remap().
The following fix is a proof-of-concept solution that solves the problem on my machine, but is not appropriate for inclusion in the official source code:
Replace line 68
1static short CV_DECL_ALIGNED(16) BilinearTab_iC4INTER_TAB_SIZE2r2r8;
with
1typedef struct{
2 unsigned char dummy_padr8;
3 short BilinearTab_iC4INTER_TAB_SIZE2r2r8;
4} BiLinearTab_iC4_ALIGNED;
5static CV_DECL_ALIGNED(16) BiLinearTab_iC4_ALIGNED BiLinearALIGNED;
6#define BilinearTab_iC4 BiLinearALIGNED.BilinearTab_iC4
Associated revisions
possible fix for #1396
Merge pull request #1396 from melody-rain:2.4_perf_bgfg_cpp
History
Updated by Ignasi Rius over 13 years ago
Same issue here (crash) but when calling cv::undistort(...). It seems that is crashing when it internally calls the remap function.
I uploaded a simple test code to reproduce it. My platform is identical at yours: Windows 7 x64, mingw from Qt SDK 1.1.3. OpenCV 2.3.1 compiled with similar options (except WITH_QT).
Interestingly, this doesn't happen on a Linux installation of OpenCV 2.3.1.
Updated by Alexander Shishkov almost 13 years ago
- Target version deleted ()
- Description changed from <pre> <pre> Steps to reproduce on Windows 7 with hardware equiv... to Steps to reproduce on Windows 7 with hardware equivalent of a Macbook6,1 (2.2... More
Updated by Alexander Shishkov almost 13 years ago
- Description changed from Steps to reproduce on Windows 7 with hardware equivalent of a Macbook6,1 (2.2... to Steps to reproduce on Windows 7 with hardware equivalent of a Macbook6,1 (2.2... More
Updated by Alexander Shishkov almost 13 years ago
- Assignee deleted (
Vadim Pisarevsky)
Updated by Marina Kolpakova almost 13 years ago
- Assignee set to Marina Kolpakova
Updated by Vadim Pisarevsky almost 13 years ago
the bug is probably solve in SVN trunk, r7757 - do not have MinGW to test it, but it should work fine now.
- Status changed from Open to Done
- Assignee changed from Marina Kolpakova to Vadim Pisarevsky
Updated by Alexander Shishkov almost 13 years ago
- Target version set to 2.4.0