This bugzilla service is closed. All entries have been migrated to
Bug 1311 - Segfault on Scalar * (Matrix * Vector)
Summary: Segfault on Scalar * (Matrix * Vector)
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - vectorization (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Highest Crash
Assignee: Nobody
: 1321 (view as bug list)
Depends on:
Blocks: 3.3
  Show dependency treegraph
Reported: 2016-09-25 19:41 UTC by Gilles Daviet
Modified: 2019-12-04 16:20 UTC (History)
5 users (show)

Backtrace (11.13 KB, text/plain)
2016-09-25 19:41 UTC, Gilles Daviet
no flags Details

Description Gilles Daviet 2016-09-25 19:41:17 UTC
Created attachment 739 [details]

I might be doing something wrong, but since this used to work 
without any issue, here is a minimal example segfaulting on 3.3-rc1.

> cat 

#include <Eigen/Core>

int main() {
	Eigen::Matrix< double, 3, 2 > block ;
	block.setOnes() ;

	Eigen::Vector2d rhs = Eigen::Vector2d::Zero() ;

	Eigen::Vector3d res = 1. * ( block * rhs )  ;

	return 0 ;

> g++-5 -I eigen-33r1/ -o test && ./test 
Segmentation fault
> g++-5 -I eigen-33b2 -o test && ./test 

Happens with recent versions of gcc and clang
> g++-6 -I eigen-33r1/ -o test && ./test 
Segmentation fault
> clang++ -I eigen-33r1/ -o test && ./test 
Segmentation fault

..but can disappear once optimizations are enabled
> clang++ -O3 -I eigen-eigen-e35a38ad89fe/ -o test && ./test

Regression seems to have been introduced in commit  e35a38a

> g++-5 -I eigen-eigen-e35a38ad89fe/ -o test && ./test 
Segmentation fault
> g++-5 -I eigen-eigen-0b62bc896f80/ -o test && ./test 

Reverting this patch on 3.3-rc1 fixed the issue on my side.
Comment 1 Christoph Hertzberg 2016-09-26 11:11:33 UTC
I can confirm this. I assume it is on all platforms that support vectorization.
And you indeed found the offending commit.
Comment 2 Gael Guennebaud 2016-09-26 21:56:22 UTC
Thank you for finding this issue. Fixed:

(the "offending" commit was only revealing a shortcoming elsewhere).
Comment 3 Gael Guennebaud 2016-10-12 14:54:14 UTC
*** Bug 1321 has been marked as a duplicate of this bug. ***
Comment 4 Nobody 2019-12-04 16:20:52 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance:

Note You need to log in before you can comment on or make changes to this bug.