Re: [eigen] integer types - something's odd... |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] integer types - something's odd...
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Tue, 8 Jun 2010 09:50:27 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=LnP47+Nc/nLviCPNTkoar4YZaolSNjZ6ITVFGAWGdV4=; b=RWvI81NoLyx+U3aR3mOKYkLt5SDoRAnshgGeuEYwNMVzJH30Xr7VPmhdjYEwlurdvP pGOlAYIcqSSxp2tMh5b33mzMQsX3+2K+ZxQvZiuPKiXPsxtCcNUYtbDwWzuaXWQtdjSz +hlLaYFNy9mUMWF/laFB31ctNq9ol/5mLlyoI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=JDMo1AKsMUxXb3gQEa5UcTQZFefWDwbSI/ez78VCvSD52FWCTW6j/ioUnOkgUiVjtF vKzwSgENoaOVov0zaZOmYbGoyL1VEPmhQ8kBMjexhtBMCuTF62s6c7XMvW2omDpMzKIA F+Q02UNgAEAS0paIiCDcO2ZpktUNnnoX/5WUM=
On Tue, Jun 8, 2010 at 3:59 AM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
> But it's true that it's ugly, so, feel free to fix that. For example
> by isolating the tests that would emit warnings with unsigned types
> into separate functions...
>
>> and then I tried to
>> run it in debug mode and I got an unaligned memory assertion on
>>
>> m3 = m2; m3 *= s1;
>> VERIFY_IS_EQUAL(m3, s1*m2);
>>
>> while calling
>>
>> CALL_SUBTEST_1( integer_types(Matrix<unsigned long, 3, 4>()) );
>>
>> I tried to reproduce this in a separate program but failed. Does
>> anybody have an idea?
>
> can you paste a backtrace from that assert?
I attached the back-trace.
> Does the assert persist if you replace unsigned long by signed long?
Yes, it does persists.
Furthermore, changing lines 111-112 to
m3 = m2; m3 *= s1;
VERIFY_IS_EQUAL(m3, (s1*m2).eval());
fixes the issue too.
Also, changing lines 370-371 in the main.cpp to
template<typename T, typename U>
bool test_is_equal(const T& actual, const U& expected)
solves the issue and I think that is the real fix. Passing aligned
types by value destroys the alignment.
- Hauke
msvcr100d.dll!_CxxThrowException(void * pExceptionObject=0x00d1f4c7, const _s__ThrowInfo * pThrowInfo=0x01050740) Line 157 C++
integer_types_1.exe!Eigen::ei_matrix_array<unsigned long,12,0,16>::ei_matrix_array<unsigned long,12,0,16>() Line 67 + 0xef bytes C++
integer_types_1.exe!Eigen::ei_matrix_storage<unsigned long,12,3,4,0>::ei_matrix_storage<unsigned long,12,3,4,0>(int __formal=12, int __formal=12, int __formal=12) Line 100 + 0x16 bytes C++
integer_types_1.exe!Eigen::DenseStorageBase<Eigen::Matrix<unsigned long,3,4,0,3,4> >::DenseStorageBase<Eigen::Matrix<unsigned long,3,4,0,3,4> >(int size=12, int rows=3, int cols=4) Line 341 C++
integer_types_1.exe!Eigen::Matrix<unsigned long,3,4,0,3,4>::Matrix<unsigned long,3,4,0,3,4>(const Eigen::Matrix<unsigned long,3,4,0,3,4> & other=[3,4](...,...)) Line 291 C++
integer_types_1.exe!integer_types<Eigen::Matrix<unsigned long,3,4,0,3,4> >(const Eigen::Matrix<unsigned long,3,4,0,3,4> & m=[...,...) Line 112 + 0x2a bytes C++
integer_types_1.exe!test_integer_types() Line 126 + 0x3f bytes C++
integer_types_1.exe!main(int argc=1, char * * argv=0x00245000) Line 530 C++
integer_types_1.exe!__tmainCRTStartup() Line 555 + 0x19 bytes C
integer_types_1.exe!mainCRTStartup() Line 371 C