microsoft / opencv

Open Source Computer Vision Library
opencv.org
Apache License 2.0
144 stars 92 forks source link

VS2015 x64 calib3d crash #36

Open EvgenyAgafonchikov opened 9 years ago

EvgenyAgafonchikov commented 9 years ago

Repro steps (Windows 10 Preview):

  1. Install VS2015 CTP6 from there
  2. Install Windows 10 SDK from there
  3. Clone https://github.com/Microsoft/CMake.git
  4. Checkout feature/Win10 branch
  5. Build CMake for Windows
  6. Clone https://github.com/MSOpenTech/opencv.git
  7. Checkout test-vs2015 branch
  8. Create "bin" directory and cd to it
  9. Run command Path\To\New CMake\bin\Release\cmake.exe -G "Visual Studio 14 2015 Win64" -DCMAKE_SYSTEM_NAME:String=WindowsStore -DCMAKE_SYSTEM_VERSION:String="10.0" -DCMAKE_VS_EFFECTIVE_PLATFORMS:String=x64 -DCMAKE_INSTALL_PREFIX:PATH=C:\Users\ocv_install ..
  10. Open solution, change configuration to Release and build it
  11. Start opencv_test_calib3d

Expected: Full test pass Actual: Crash in the fisheye.jacobians test

Reproduced for VS2015 CTP6 x64 solution only. Pass for VS2015 CTP6 x86, VS2013 x64, VS2013 x86

Pass for VS2015 x64 with this patch:

diff --git a/modules/core/src/rand.cpp b/modules/core/src/rand.cpp
index bd1d80c..39dcc02 100644
--- a/modules/core/src/rand.cpp
+++ b/modules/core/src/rand.cpp
@@ -634,8 +634,7 @@ void RNG::fill( InputOutputArray _mat, int disttype,
         }

         if( n1 < cn )
-            for( j = n1*esz; j < cn*esz; j++ )
-                mean[j] = mean[j - n1*esz];
+            mean = mean + n1 * esz;

         if( _param2.isContinuous() && _param2.type() == ptype )
             stddev = _param2.ptr();
@@ -647,8 +646,7 @@ void RNG::fill( InputOutputArray _mat, int disttype,
         }

         if( n1 < cn )
-            for( j = n1*esz; j < cn*esz; j++ )
-                stddev[j] = stddev[j - n1*esz];
+            stddev = stddev + n1 * esz;

         stdmtx = _param2.rows == cn && _param2.cols == cn;
         scaleFunc = randnScaleTab[depth];
EvgenyAgafonchikov commented 9 years ago

Still reproing on VS2015RC; Possible VS2015(CTP6|RC) issue. Need to be re-checked after VS2015 official release and fixed if required