C++ “Access violation reading location” Error with openmp?

-4

Here is the exception info:

Exception thrown at 0x00007FF9FB67520E (ucrtbased.dll) in RealRTCPP.exe: 
0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

from the malloc line of

....
if (void* const block = malloc(size))
    {
        return block;
    }
....

of the new_scalar.cpp

when I try to use

ShadeData * output = new ShadeData;

inside a openmp for loop where ShadeData is a struct.

This error only happens when I use

#pragma omp parallel for

for the loop, but it seems that malloc is thread safe, what is going on?

c++
openmp
asked on Stack Overflow Dec 12, 2018 by NEo Yang

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0