Memory corruption in test sparse_product_2
Submitted by Benoit Steiner
Assigned to Nobody
Link to original bugzilla bug (#745)
Version: 3.2
Description
When compiled on Ubuntu with gcc 4.8 and SSE3 enabled, the test fails sometimes for seed 1392677379. Valgrind identified a memory corruption which probably explains the flakiness:
valgrind ./sparse_product_2 s1392677379
==28557== Memcheck, a memory error detector
==28557== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==28557== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==28557== Command: ./sparse_product_2 s1392677379
==28557==
Initializing random number generator with seed 1392677379
Repeating each test 10 times
==28557== Invalid write of size 8
==28557== at 0x425FBF: Eigen::internal::AmbiVector<std::complex<double>, int>::coeffRef(int) (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x4185CE: _ZN5Eigen8internalL39sparse_sparse_product_with_pruning_implINS_12SparseMatrixISt7complexIdELi1EiEES5_S5_EEvRKT_RKT0_RT1_RKNSC_10RealScalarE.constprop.1799 (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x4503C2: void sparse_product<Eigen::SparseMatrix<std::complex<double>, 1, int> >() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x419EF2: test_sparse_product() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x41419D: main (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== Address 0x6df4ea0 is 0 bytes after a block of size 160 alloc'd
==28557== at 0x4C2AC27: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==28557== by 0x41842A: _ZN5Eigen8internalL39sparse_sparse_product_with_pruning_implINS_12SparseMatrixISt7complexIdELi1EiEES5_S5_EEvRKT_RKT0_RT1_RKNSC_10RealScalarE.constprop.1799 (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x4503C2: void sparse_product<Eigen::SparseMatrix<std::complex<double>, 1, int> >() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x419EF2: test_sparse_product() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x41419D: main (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557==
==28557== Invalid read of size 8
==28557== at 0x4185E3: _ZN5Eigen8internalL39sparse_sparse_product_with_pruning_implINS_12SparseMatrixISt7complexIdELi1EiEES5_S5_EEvRKT_RKT0_RT1_RKNSC_10RealScalarE.constprop.1799 (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x4503C2: void sparse_product<Eigen::SparseMatrix<std::complex<double>, 1, int> >() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x419EF2: test_sparse_product() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x41419D: main (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== Address 0x6df4ea0 is 0 bytes after a block of size 160 alloc'd
==28557== at 0x4C2AC27: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==28557== by 0x41842A: _ZN5Eigen8internalL39sparse_sparse_product_with_pruning_implINS_12SparseMatrixISt7complexIdELi1EiEES5_S5_EEvRKT_RKT0_RT1_RKNSC_10RealScalarE.constprop.1799 (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x4503C2: void sparse_product<Eigen::SparseMatrix<std::complex<double>, 1, int> >() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x419EF2: test_sparse_product() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x41419D: main (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557==
==28557== Invalid write of size 8
==28557== at 0x4185E8: _ZN5Eigen8internalL39sparse_sparse_product_with_pruning_implINS_12SparseMatrixISt7complexIdELi1EiEES5_S5_EEvRKT_RKT0_RT1_RKNSC_10RealScalarE.constprop.1799 (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x4503C2: void sparse_product<Eigen::SparseMatrix<std::complex<double>, 1, int> >() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x419EF2: test_sparse_product() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x41419D: main (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== Address 0x6df4ea0 is 0 bytes after a block of size 160 alloc'd
==28557== at 0x4C2AC27: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==28557== by 0x41842A: _ZN5Eigen8internalL39sparse_sparse_product_with_pruning_implINS_12SparseMatrixISt7complexIdELi1EiEES5_S5_EEvRKT_RKT0_RT1_RKNSC_10RealScalarE.constprop.1799 (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x4503C2: void sparse_product<Eigen::SparseMatrix<std::complex<double>, 1, int> >() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x419EF2: test_sparse_product() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x41419D: main (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557==
==28557== Invalid read of size 8
==28557== at 0x4186B7: _ZN5Eigen8internalL39sparse_sparse_product_with_pruning_implINS_12SparseMatrixISt7complexIdELi1EiEES5_S5_EEvRKT_RKT0_RT1_RKNSC_10RealScalarE.constprop.1799 (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x4503C2: void sparse_product<Eigen::SparseMatrix<std::complex<double>, 1, int> >() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x419EF2: test_sparse_product() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x41419D: main (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== Address 0x6df4ea0 is 0 bytes after a block of size 160 alloc'd
==28557== at 0x4C2AC27: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==28557== by 0x41842A: _ZN5Eigen8internalL39sparse_sparse_product_with_pruning_implINS_12SparseMatrixISt7complexIdELi1EiEES5_S5_EEvRKT_RKT0_RT1_RKNSC_10RealScalarE.constprop.1799 (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x4503C2: void sparse_product<Eigen::SparseMatrix<std::complex<double>, 1, int> >() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x419EF2: test_sparse_product() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x41419D: main (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557==
==28557== Invalid read of size 8
==28557== at 0x418776: _ZN5Eigen8internalL39sparse_sparse_product_with_pruning_implINS_12SparseMatrixISt7complexIdELi1EiEES5_S5_EEvRKT_RKT0_RT1_RKNSC_10RealScalarE.constprop.1799 (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x4503C2: void sparse_product<Eigen::SparseMatrix<std::complex<double>, 1, int> >() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x419EF2: test_sparse_product() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x41419D: main (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== Address 0x6df4ea0 is 0 bytes after a block of size 160 alloc'd
==28557== at 0x4C2AC27: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==28557== by 0x41842A: _ZN5Eigen8internalL39sparse_sparse_product_with_pruning_implINS_12SparseMatrixISt7complexIdELi1EiEES5_S5_EEvRKT_RKT0_RT1_RKNSC_10RealScalarE.constprop.1799 (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x4503C2: void sparse_product<Eigen::SparseMatrix<std::complex<double>, 1, int> >() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x419EF2: test_sparse_product() (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557== by 0x41419D: main (in /usr/local/google/home/bsteiner/EigenLatest/build/test/sparse_product_2)
==28557==
==28557==
==28557== HEAP SUMMARY:
==28557== in use at exit: 0 bytes in 0 blocks
==28557== total heap usage: 17,127 allocs, 17,127 frees, 116,342,441 bytes allocated
==28557==
==28557== All heap blocks were freed -- no leaks are possible
==28557==
==28557== For counts of detected and suppressed errors, rerun with: -v
==28557== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 2 from 2)