cpp-sort icon indicating copy to clipboard operation
cpp-sort copied to clipboard

schwartz_adapter segfaults on the Travis GCC Windows build

Open Morwenn opened this issue 6 years ago • 2 comments

The issue

Many of the schwartz_adapter tests segfault with the following configuration:

  • 64-bit MinGW-w64
  • Release mode
  • Sorting a wrapper<double>

Instead of just Release mode, we can reduce the issue to the following flags: -O2 -finline-functions -fpeel-loops -ftree-loop-vectorize -fno-omit-frame-pointer -g.

No amount of warnings, sanitizers, Valgring or static analyzers catch any issue in any configuration mode. It just segfaults with the configuration described above.

It looks like a codegen issue more than an actual programming error.


Legacy issue

While it works everywhere else (including my home computer where I use MinGW-w64), every test using schwartz_adapter segfaults in the new experimental travis-windows branch of the library when GCC is used, and only in Release mode.

It might be linked to #138, but if it's not the case finding the issue might prove more difficult.

Morwenn avatar Feb 20 '19 11:02 Morwenn

I still don't understand where it comes from: I'm passing const lvalues to memory whose lifetime ends after all the machinery is done, so I don't understand where the segfaults might come from.

Morwenn avatar Mar 10 '19 13:03 Morwenn

Cicada says it looks more and more like a codegen bug and managed to reduce the problematic optimization falgs to the following ones: -O2 -finline-functions -fpeel-loops -ftree-loop-vectorize -fno-omit-frame-pointer -g

Morwenn avatar Mar 18 '19 08:03 Morwenn