boostorg / boostorg/python

Eigen + Boost.Python + gcc-7 = crash

Abierto
#232 8 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C++
Estrellas
537
Forks
223
Merge medio
11 h 22 min
PR fusionados (30 d)
2

Descripción

I am using Boost.Python to provide bindings for a scientific app which uses [Eigen](http://eigen.tuxfamily.org/) for linear algebra. I am experiencing a segfault with some Eigen types, and I managed to isolate the code that causes the crash.

Please consider the [attached script](https://github.com/boostorg/python/files/2375991/test.txt) which:
* prepares a cpp file with a simple test case;
* builds the code with gcc-5, gcc-7, and gcc-8;
* runs the code from python.

As you can see from the comments at the bottom of the script, the test builds, but leads to a crash when run. This does not happen with gcc-5.

Interestingly, I can reproduce the problem by using `Matrix2d` and `Vector2d`; but it does **not** happen when using `Matrix3d` or `Vector3d` (this can be easily verified by replacing in the attached script).

Now, while the problem can be in any of the 3 components (Eigen, Boost.Python, gcc-7), I decided to post an issue here first because the project we are building uses Eigen extensively, and I never experienced any problem on "C++ side", even while building with gcc-7.

I hope that someone with experience with the Boost.Python internals can help me shed some light on this.

Some more info about the build system, in case it might be useful:
* `Ubuntu 16.04` running kernel `4.4.0-134-generic`
* `gcc version 5.5.0 20171010 (Ubuntu 5.5.0-12ubuntu1~16.04)` from apt package `build-essentials`
* `gcc version 7.3.0 (Ubuntu 7.3.0-21ubuntu1~16.04) ` from [PPA](https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test)
* `gcc version 8.1.0 (Ubuntu 8.1.0-5ubuntu1~16.04)` from [PPA](https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test)
* `boost 1.66` from [here](https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2) built with b2 (just as test, I tried building it with both gcc-5 and gcc-7, with no difference);
* `boost 1.58` from apt package `libboost-all-dev`.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.