[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#939655: g++ v9 with OpenMP segfaults with shared vectors



Control: reassign -1 gcc-9
Control: tags -1 + moreinfo

On 07.09.19 12:19, David Cortes wrote:
Package: g++
Version: 4:9.2.1-3

When executing code compiled with g++ 9.2.1 that has OpenMP for-loops
with vectors as shared variables, it results in a segmentation fault.
According to Asan (address sanitizer), this might be due to double-
freed variables when running the code.

Example:
#pragma omp parallel for schedule(static) num_threads(nthreads)
shared(some_vector, some_variable)
for (int i = 0; i < some_vector.size(); i++) {
	some_func(some_vector[i], some_variable)
}

Setup:
- Processor Ryzen 2700 (8 cores)
- Kernel version 5.2+106
- Compile flags tried: -std=c++11 -fopenmp -march=native -O2

The version currently in buster (4:8.3.0-1) and older do not show this
problem. Tried with different samples of code in different projects and
they all presented the same issue. Potential problems such as out-of-
bounds writes were already discarded. Compiling without OpenMP does not
produce such error.

would it be possible to attach a self-contained example showing this behavior?


Reply to: