Home Dashboard Directory Help
Search

OpenMP Release x64 crash in critical section by Anton Naumovets


Status: 

Closed
 as Fixed Help for as Fixed


1
0
Sign in
to vote
Type: Bug
ID: 606013
Opened: 9/28/2010 3:56:55 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

Crash when executing the program below with OpenMP in Release x64.
Create a project (console application) with this code.
Build with /openmp and /O1 or /O2 or /Ox (Optimization) options in Release x64 configuration.
The bug is also reproducible in VS 2005.
In the dissasembly it looks like the push_back(0) was moved out of the critical section.

#include <omp.h>
#include <vector>

class EmptyClass
{
public:
    EmptyClass() {}
};

class SuperEdge
{
public:
    SuperEdge() {mp_points[0] = NULL; mp_points[1] = NULL;}

private:
    const int* mp_points[2];
};

EmptyClass CreateEmptyClass(SuperEdge s)
{
return EmptyClass();
}

int main(int argc, wchar_t* argv[], wchar_t* envp[])
{
std::vector<int> v;
long count = 1000000;

SuperEdge edge;
#pragma omp parallel for
for(long i = 0; i < count; ++i)
    {
    EmptyClass p = CreateEmptyClass(edge);
    #pragma omp critical
     {
     v.push_back(0);
     }
    }

return 0;
}
Details
Sign in to post a comment.
Posted by Anton Naumovets on 10/6/2010 at 11:55 PM
Sorry, I could not understand from your feedback and the status of the ID whether it is reproducible or not.
Posted by Microsoft on 10/6/2010 at 5:20 PM
Thanks for reporting this issue. I can confirm this is a bug in x64 openMP code generation. The VC++ team will investigate this bug and provide a fix in a future release.
Posted by Microsoft on 9/28/2010 at 6:13 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Posted by Microsoft on 9/28/2010 at 6:13 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.