This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Trying to track down a segfault

Tags: None
(comma "," separated)
Ian Mackenzie
Registered Member
Posts
15
Karma
0

Trying to track down a segfault

Tue Aug 21, 2012 2:12 am
I've been trying to track down a frustrating segfault which seems to be triggered within Eigen code, called from the following function:
Code: Select all
MatrixXI* rmulXdI(const MatrixXd& self, const Interval& argument) {
    return new MatrixXI(argument * self.cast<Interval>());
}

(The function is used for a Python binding for part of Eigen, if you're wondering). I'm guessing the bug is fairly sensitive to how the compiler chooses to align the code in memory, since I only get it using GCC 4.7 (other versions of GCC seem OK, as well as MSVC and Clang). I also get similar segfaults in a couple other places, but they go away when compiling in debug mode - this particular instance was the only one that seemed to persist in release/debug. I'm using Eigen 3.1.1. The Interval class is pretty simple (an range between two numbers, represented as two doubles) and allows implicit construction from a double; if it matters, here are the Eigen templates that I have specialized for it: EDIT: MatrixXI is, as you might have guessed, a typedef for Matrix<Interval, Dynamic, Dynamic>.
Code: Select all
namespace Eigen
{   
    namespace internal
    {
        template <class ScalarType, bool is_integer_>
        struct significant_decimals_default_impl;

        template <>
        struct significant_decimals_default_impl<opensolid::Interval, false>
        {
            static inline int run();
        };
       
        template <class ScalarType>
        struct is_arithmetic;
       
        template <>
        struct is_arithmetic<opensolid::Interval>
        {
            static const bool value = true;
        };
    }
   
    template <class Type>
    struct NumTraits;
   
    template <>
    struct NumTraits<opensolid::Interval>
    {
        typedef opensolid::Interval Real;
        typedef opensolid::Interval NonInteger;
        typedef opensolid::Interval Nested;
       
        static const int IsComplex = 0;
        static const int IsInteger = 0;
        static const int ReadCost = 2;
        static const int AddCost = 2;
        static const int MulCost = 10;
        static const int IsSigned = 1;
        static const int RequireInitialization = 0;
       
        static opensolid::Interval epsilon();
        static opensolid::Interval dummy_precision();
        static opensolid::Interval lowest();
        static opensolid::Interval highest(); 
    };
}

I've also attached the stack trace from the debugger below, and the output when running the code through Valgrind, if that helps. Any thoughts?

Stack trace:
Code: Select all
#0 Eigen::internal::cast_impl<double, opensolid::Interval>::run() at /home/ian/OpenSolid/build/gcc/debug/external/src/Eigen/Eigen/src/Core/MathFunctions.h:394
#1 Eigen::internal::cast<double, opensolid::Interval>() at /home/ian/OpenSolid/build/gcc/debug/external/src/Eigen/Eigen/src/Core/MathFunctions.h:403
#2 Eigen::internal::scalar_cast_op<double, opensolid::Interval>::operator()() at /home/ian/OpenSolid/build/gcc/debug/external/src/Eigen/Eigen/src/Core/Functors.h:342
#3 Eigen::CwiseUnaryOpImpl<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const, Eigen::Dense>::coeff() at /home/ian/OpenSolid/build/gcc/debug/external/src/Eigen/Eigen/src/Core/CwiseUnaryOp.h:113
#4 Eigen::CwiseUnaryOpImpl<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const, Eigen::Dense>::coeff() at /home/ian/OpenSolid/build/gcc/debug/external/src/Eigen/Eigen/src/Core/CwiseUnaryOp.h:113
#5 Eigen::DenseCoeffsBase<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>, 1>::copyCoeff<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> >() at /home/ian/OpenSolid/build/gcc/debug/external/src/Eigen/Eigen/src/Core/DenseCoeffsBase.h:494
#6 Eigen::internal::assign_impl<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const>, 1, 0, 0>::run() at /home/ian/OpenSolid/build/gcc/debug/external/src/Eigen/Eigen/src/Core/Assign.h:303
#7 Eigen::DenseBase<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1> >::lazyAssign<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> >() at /home/ian/OpenSolid/build/gcc/debug/external/src/Eigen/Eigen/src/Core/Assign.h:498
#8 Eigen::PlainObjectBase<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1> >::lazyAssign<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> >() at /home/ian/OpenSolid/build/gcc/debug/external/src/Eigen/Eigen/src/Core/PlainObjectBase.h:392
#9 Eigen::internal::assign_selector<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const>, false, false>::run() at /home/ian/OpenSolid/build/gcc/debug/external/src/Eigen/Eigen/src/Core/Assign.h:521
#10 Eigen::PlainObjectBase<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1> >::_set_noalias<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> >() at /home/ian/OpenSolid/build/gcc/debug/external/src/Eigen/Eigen/src/Core/PlainObjectBase.h:598
#11 Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>::Matrix<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> >() at /home/ian/OpenSolid/build/gcc/debug/external/src/Eigen/Eigen/src/Core/Matrix.h:280
#12 opensolid::rmulXdI() at /home/ian/OpenSolid/source/python/opensolid/detail/bindMatrix.cpp:796

Valgrind output:
Code: Select all
==2684== Memcheck, a memory error detector
==2684== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==2684== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==2684== Command: ./bin/PythonTests
==2684==
==2684== Invalid read of size 8
==2684==    at 0x60A0022: Eigen::internal::cast_impl<double, opensolid::Interval>::run(double const&) (MathFunctions.h:395)
==2684==    by 0x609401E: opensolid::Interval Eigen::internal::cast<double, opensolid::Interval>(double const&) (MathFunctions.h:404)
==2684==    by 0x6086336: Eigen::internal::scalar_cast_op<double, opensolid::Interval>::operator()(double const&) const (Functors.h:343)
==2684==    by 0x60CC68B: Eigen::CwiseUnaryOpImpl<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const, Eigen::Dense>::coeff(long) const (CwiseUnaryOp.h:114)
==2684==    by 0x60C238B: Eigen::CwiseUnaryOpImpl<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const, Eigen::Dense>::coeff(long) const (CwiseUnaryOp.h:114)
==2684==    by 0x60B7F0B: void Eigen::DenseCoeffsBase<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>, 1>::copyCoeff<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> >(long, Eigen::DenseBase<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> > const&) (DenseCoeffsBase.h:495)
==2684==    by 0x60AE0B9: Eigen::internal::assign_impl<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const>, 1, 0, 0>::run(Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>&, Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> const&) (Assign.h:304)
==2684==    by 0x60A1BBD: Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>& Eigen::DenseBase<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1> >::lazyAssign<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> >(Eigen::DenseBase<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> > const&) (Assign.h:499)
==2684==    by 0x6095006: Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>& Eigen::PlainObjectBase<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1> >::lazyAssign<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> >(Eigen::DenseBase<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> > const&) (PlainObjectBase.h:393)
==2684==    by 0x6087CDD: Eigen::internal::assign_selector<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const>, false, false>::run(Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>&, Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> const&) (Assign.h:522)
==2684==    by 0x607A1F0: Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>& Eigen::PlainObjectBase<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1> >::_set_noalias<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> >(Eigen::DenseBase<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> > const&) (PlainObjectBase.h:599)
==2684==    by 0x606D9EC: Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>::Matrix<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> >(Eigen::MatrixBase<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> > const&) (Matrix.h:281)
==2684==  Address 0x574ffd is not stack'd, malloc'd or (recently) free'd
==2684==
==2684==
==2684== Process terminating with default action of signal 11 (SIGSEGV)
==2684==  Access not within mapped region at address 0x575000
==2684==    at 0x60A0022: Eigen::internal::cast_impl<double, opensolid::Interval>::run(double const&) (MathFunctions.h:395)
==2684==    by 0x609401E: opensolid::Interval Eigen::internal::cast<double, opensolid::Interval>(double const&) (MathFunctions.h:404)
==2684==    by 0x6086336: Eigen::internal::scalar_cast_op<double, opensolid::Interval>::operator()(double const&) const (Functors.h:343)
==2684==    by 0x60CC68B: Eigen::CwiseUnaryOpImpl<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const, Eigen::Dense>::coeff(long) const (CwiseUnaryOp.h:114)
==2684==    by 0x60C238B: Eigen::CwiseUnaryOpImpl<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const, Eigen::Dense>::coeff(long) const (CwiseUnaryOp.h:114)
==2684==    by 0x60B7F0B: void Eigen::DenseCoeffsBase<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>, 1>::copyCoeff<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> >(long, Eigen::DenseBase<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> > const&) (DenseCoeffsBase.h:495)
==2684==    by 0x60AE0B9: Eigen::internal::assign_impl<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const>, 1, 0, 0>::run(Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>&, Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> const&) (Assign.h:304)
==2684==    by 0x60A1BBD: Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>& Eigen::DenseBase<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1> >::lazyAssign<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> >(Eigen::DenseBase<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> > const&) (Assign.h:499)
==2684==    by 0x6095006: Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>& Eigen::PlainObjectBase<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1> >::lazyAssign<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> >(Eigen::DenseBase<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> > const&) (PlainObjectBase.h:393)
==2684==    by 0x6087CDD: Eigen::internal::assign_selector<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const>, false, false>::run(Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>&, Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> const&) (Assign.h:522)
==2684==    by 0x607A1F0: Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>& Eigen::PlainObjectBase<Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1> >::_set_noalias<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> >(Eigen::DenseBase<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> > const&) (PlainObjectBase.h:599)
==2684==    by 0x606D9EC: Eigen::Matrix<opensolid::Interval, -1, -1, 0, -1, -1>::Matrix<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> >(Eigen::MatrixBase<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<opensolid::Interval>, Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<double, opensolid::Interval>, Eigen::Matrix<double, -1, -1, 0, -1, -1> const> const> > const&) (Matrix.h:281)
==2684==  If you believe this happened as a result of a stack
==2684==  overflow in your program's main thread (unlikely but
==2684==  possible), you can try to increase the size of the
==2684==  main thread stack using the --main-stacksize= flag.
==2684==  The main thread stack size used in this run was 8388608.
==2684==
==2684== HEAP SUMMARY:
==2684==     in use at exit: 91,139,832 bytes in 21,409 blocks
==2684==   total heap usage: 70,631 allocs, 49,222 frees, 101,454,791 bytes allocated
==2684==
==2684== LEAK SUMMARY:
==2684==    definitely lost: 24 bytes in 1 blocks
==2684==    indirectly lost: 0 bytes in 0 blocks
==2684==      possibly lost: 918,553 bytes in 6,834 blocks
==2684==    still reachable: 90,221,255 bytes in 14,574 blocks
==2684==         suppressed: 0 bytes in 0 blocks
==2684== Rerun with --leak-check=full to see details of leaked memory
==2684==
==2684== For counts of detected and suppressed errors, rerun with: -v
==2684== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 2 from 2)
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Trying to track down a segfault

Mon Aug 27, 2012 9:39 am
hi, the issue seems to be in our default cast implementation which is performing a static_cast, in your case:

return static_cast<Interval>(x);

where x is a double. What if your specialize for your type as follow:
Code: Select all
namespace Eigen { namespace internal {
template<typename OldType>
struct cast_impl<OldType,Interval>
{
  static inline Interval run(const OldType& x)
  {
    return Interval(x);
  }
};
}
}
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Trying to track down a segfault

Mon Aug 27, 2012 11:13 am
hm, sorry the previous suggestion won't change anything. I think the problem is on the matrix passed to the rmulXdI function which seems invalid as reported by valgrind:

Address 0x574ffd is not stack'd, malloc'd or (recently) free'd
Ian Mackenzie
Registered Member
Posts
15
Karma
0

Re: Trying to track down a segfault

Mon Aug 27, 2012 11:24 am
ggael wrote:hm, sorry the previous suggestion won't change anything. I think the problem is on the matrix passed to the rmulXdI function which seems invalid as reported by valgrind:

Address 0x574ffd is not stack'd, malloc'd or (recently) free'd


Hmm, OK, I'll check that matrix to see if it's suspect somehow. And yes, I noticed the static_cast and wasn't sure about it but all the C++ documentation I read said that it should be fine (i.e., it'll call conversion constructors if necessary). Thanks for taking the time to look into it - I'll let you know what I find...


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]