cristicbz/scid — Issue #69: eval() with symmetric matrix product crashes at runtime
Author: cristicbz
Created: 2011-11-23 22:38:57+00:00
State: open

For the following code:

```
import scid.matvec;
void main() {
auto w = SymmetricMatrix!double([[1.,2.,3.,4],[1.,2.,3.,4],[1.,2.,3.,4],[1.,2.,3.,4]]);
eval(w*w);
}

```

On gdc the message is:

```
core.exception.AssertError@/cis/home/dsimcha/apps/gdc/include/d2/4.6.1/std/typecons.d(2487): Assertion failure
```

With dmd it's:

```
core.exception.AssertError@/cis/home/dsimcha/customd/scid/internal/assertmessages.d(123): Dimension mismatch in matrix assignment: lhsDims = (0, 0), rhsDims = (4, 4)
----------------
./test(_d_assert_msg+0x1f) [0x5d6227]
./test(const(void function(ulong, ulong)) scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix.MatrixChecks!().checkAssignDims_+0xec) [0x5af5a0]
./test(void scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix.resize(ulong, ulong, void*)+0x52) [0x5ae7ca]
./test(void scid.ops.fallback.__T21fallbackMatrixProductVE4scid3ops4eval9Transpose0VE4scid3ops4eval9Transpose0TS4scid6matrix355__T11BasicMatrixTS4scid7storage9packedmat295__T13PackedStorageTS4scid7storage9symmetric225__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z21SymmetricArrayAdapterZ13PackedStorageZ11BasicMatrixTS4scid6matrix355__T11BasicMatrixTS4scid7storage9packedmat295__T13PackedStorageTS4scid7storage9symmetric225__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z21SymmetricArrayAdapterZ13PackedStorageZ11BasicMatrixTdTS4scid6matrix355__T11BasicMatrixTS4scid7storage9packedmat295__T13PackedStorageTS4scid7storage9symmetric225__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z21SymmetricArrayAdapterZ13PackedStorageZ11BasicMatrixZ.fallbackMatrixProduct(double, ref scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix, ref scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix, double, ref scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix)+0x85) [0x5cfe51]
./test(void scid.ops.eval.__T17evalMatrixProductVE4scid3ops4eval9Transpose0VE4scid3ops4eval9Transpose0TdTdTS4scid6matrix355__T11BasicMatrixTS4scid7storage9packedmat295__T13PackedStorageTS4scid7storage9symmetric225__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z21SymmetricArrayAdapterZ13PackedStorageZ11BasicMatrixTS4scid6matrix355__T11BasicMatrixTS4scid7storage9packedmat295__T13PackedStorageTS4scid7storage9symmetric225__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z21SymmetricArrayAdapterZ13PackedStorageZ11BasicMatrixTS4scid6matrix355__T11BasicMatrixTS4scid7storage9packedmat295__T13PackedStorageTS4scid7storage9symmetric225__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z21SymmetricArrayAdapterZ13PackedStorageZ11BasicMatrixZ.evalMatrixProduct(double, ref scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix, ref scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix, double, ref scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix)+0x105) [0x5cfd79]
./test(void scid.ops.eval.__T8evalCopyVE4scid3ops4eval9Transpose0TS4scid3ops10expression795__T10ExpressionVAyaa1_2aTS4scid6matrix355__T11BasicMatrixTS4scid7storage9packedmat295__T13PackedStorageTS4scid7storage9symmetric225__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z21SymmetricArrayAdapterZ13PackedStorageZ11BasicMatrixTS4scid6matrix355__T11BasicMatrixTS4scid7storage9packedmat295__T13PackedStorageTS4scid7storage9symmetric225__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z21SymmetricArrayAdapterZ13PackedStorageZ11BasicMatrixZ10ExpressionTS4scid6matrix355__T11BasicMatrixTS4scid7storage9packedmat295__T13PackedStorageTS4scid7storage9symmetric225__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z21SymmetricArrayAdapterZ13PackedStorageZ11BasicMatrixZ.evalCopy(ref scid.ops.expression.Expression!("*", scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix, scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix).Expression, ref scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix)+0x40) [0x5cfc20]
./test(scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix scid.ops.eval.eval!(scid.ops.expression.Expression!("*", scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix, scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix).Expression).eval(scid.ops.expression.Expression!("*", scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix, scid.matrix.BasicMatrix!(scid.storage.packedmat.PackedStorage!(scid.storage.symmetric.__T21SymmetricArrayAdapterTS3std8typecons108__T10RefCountedTS4scid7storage8cowarray15__T8CowArrayTdZ8CowArrayVE3std8typecons24RefCountedAutoInitialize1Z10RefCountedVE4scid6matrix14MatrixTriangle0VE4scid6matrix12StorageOrder1Z.SymmetricArrayAdapter).PackedStorage).BasicMatrix).Expression)+0x30) [0x5cfba0]
./test(_Dmain+0x1ea) [0x596f26]
./test(extern (C) int rt.dmain2.main(int, char**).void runMain()+0x17) [0x5d6833]
./test(extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void delegate())+0x2a) [0x5d63da]
./test(extern (C) int rt.dmain2.main(int, char**).void runAll()+0x42) [0x5d6886]
./test(extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void delegate())+0x2a) [0x5d63da]
./test(main+0xd3) [0x5d636b]
/lib/libc.so.6(__libc_start_main+0xfd) [0x7f2631b06c4d]
----------------
```