https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120201

--- Comment #21 from Stuart <stuart.a.hayhurst at gmail dot com> ---
Using the updated patch fixes the reproducer for me and the case I was hitting
in the actual project, but another std::memcpy in the actual project fails,
with the same problem after inspecting with GDB.

stuart@debian:~/ammonite-engine$ ASAN_OPTIONS=detect_odr_violation=0
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib64:./build" gdb ./build/demo

...

(gdb) run
Starting program: /home/stuart/ammonite-engine/build/demo

...

Thread 1 "demo" received signal SIGSEGV, Segmentation fault.
0x00007ffff73c7caa in ammonite::maths::inverse<float, 4u> (a=..., dest=...) at
src/ammonite/models/loaders/../../maths/../../include/ammonite/maths/matrix.hpp:460
460           std::memcpy(glm::value_ptr(aMat), &a[0], sizeof(Mat<T, size>));
(gdb) display /i $pc
1: x/i $pc
=> 0x7ffff73c7caa
<_ZN8ammonite5maths7inverseIfLj4EEERAT0__AT0__T_RAT0__AT0__KS2_S5_+345>:     
vmovdqa64 %zmm0,-0xc0(%rbx)
(gdb) p $rbx % 64
$1 = 32

I can try and strip this down into another reproducer, but I don't really know
why this is any different to the other case.

Reply via email to