Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9203909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:34:43+00:00 2026-06-17T23:34:43+00:00

I’ve made this simple test program, and it sometimes triggers a Debug Break or

  • 0

I’ve made this simple test program, and it sometimes triggers a Debug Break or it just crashes (under Debug/Win32/VS2010SP1) – and of course, sometimes it even works. Is there anything I am doing wrong or is there a bug somewhere in PPL (VS2010)?

#include "stdafx.h"
#include <ppl.h>
#include <vector>

int _tmain(int argc, _TCHAR* argv[])
{
    std::vector<int> vi;
    Concurrency::critical_section cs;
    Concurrency::parallel_for(0, 10000, [&](int i)
    {
        Concurrency::critical_section::scoped_lock l(cs);
        vi.push_back(i);
    });
    return 0;
}

The Debug Break call stack looks like below:

msvcr100d.dll!_CrtDbgBreak() Line 85 C
msvcr100d.dll!_VCrtDbgReportW(int nRptType=2, const wchar_t * szFile=0x0f45d230, int nLine=728, const wchar_t * szModule=0x00000000, const wchar_t * szFormat=0x0f45d400, char * arglist=0x7d92f7c4) Line 502 C
msvcr100d.dll!_CrtDbgReportWV(int nRptType=2, const wchar_t * szFile=0x0f45d230, int nLine=728, const wchar_t * szModule=0x00000000, const wchar_t * szFormat=0x0f45d400, char * arglist=0x7d92f7c4) Line 241 + 0x1d bytes C++
msvcr100d.dll!_CrtDbgReportW(int nRptType=2, const wchar_t * szFile=0x0f45d230, int nLine=728, const wchar_t * szModule=0x00000000, const wchar_t * szFormat=0x0f45d400, …) Line 258 + 0x1d bytes C++
msvcr100d.dll!Concurrency::details::LockQueueNode::Copy(Concurrency::details::LockQueueNode * pCopyFromNode=0x7d92f908) Line 728 + 0x27 bytes C++
msvcr100d.dll!Concurrency::critical_section::_Acquire_lock(void * _PLockingNode=0x7d92f908, bool _FHasExternalNode=true) Line 1019 C++
msvcr100d.dll!Concurrency::critical_section::scoped_lock::scoped_lock(Concurrency::critical_section & _Critical_section=locked) Line 1083 C++
Lockable.exe!anonymous namespace'::<lambda0>::operator()(int i=1418) Line 14 + 0x11 bytes C++
Lockable.exe!Concurrency::_Parallel_chunk_helper_invoke<int,unsigned int,
anonymous namespace’::,0>::_Invoke(const int & _First=0, unsigned int & _Index=1418, const anonymous-namespace'::<lambda0> & _Func={...}) Line 1445 C++
Lockable.exe!Concurrency::_Parallel_chunk_helper<int,unsigned int,
anonymous namespace’::,0>::operator()() Line 1781 + 0x16 bytes C++
Lockable.exe!Concurrency::task_handle,0> > >(Concurrency::task_handle,0> > * _PChore=0x7c13fba8 {_M_first=0 _M_step=1 _M_function={…} …}) Line 3495 C++
msvcr100d.dll!Concurrency::details::_UnrealizedChore::_StructuredChoreWrapper(Concurrency::details::_UnrealizedChore * pChore=0x7c13fba8 {_M_first=0 _M_step=1 _M_function={…} …}) Line 99 + 0xc bytes C++
msvcr100d.dll!Concurrency::details::_UnrealizedChore::_Invoke() Line 3454 + 0xc bytes C++
msvcr100d.dll!Concurrency::details::WorkItem::Invoke() Line 75 C++
msvcr100d.dll!Concurrency::details::InternalContextBase::ExecuteChoreInline(Concurrency::details::WorkItem * pWork=0x7d92fe7c) Line 1385 C++
msvcr100d.dll!Concurrency::details::InternalContextBase::Dispatch(Concurrency::DispatchState * pDispatchState=0x7d92fe9c) Line 1478 C++
msvcr100d.dll!Concurrency::details::FreeThreadProxy::Dispatch() Line 157 C++
msvcr100d.dll!Concurrency::details::ThreadProxy::ThreadProxyMain(void * lpParameter=0x2ed5b4f0) Line 162 C++
kernel32.dll!763c33aa()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!771a9ef2()
ntdll.dll!771a9ec5()

One crash I’ve just got looks like the lock has not been held (cs: not_locked)

Lockable.exe!std::vector >::_Orphan_range(int * _First=0x0000c5db, int * _Last=0x0000c5db) Line 1442 + 0x5 bytes C++
Lockable.exe!std::vector >::push_back(const int & _Val=4177) Line 995 C++

Lockable.exe!anonymous namespace'::<lambda0>::operator()(int i=4177) Line 16 C++
Lockable.exe!Concurrency::_Parallel_chunk_helper_invoke<int,unsigned int,
anonymous namespace’::,0>::_Invoke(const int & _First=0, unsigned int & _Index=4177, const anonymous-namespace'::<lambda0> & _Func={...}) Line 1445 C++
Lockable.exe!Concurrency::_Parallel_chunk_helper<int,unsigned int,
anonymous namespace’::,0>::operator()() Line 1833 + 0x16 bytes C++
Lockable.exe!Concurrency::task_handle,0> > >(Concurrency::task_handle,0> > * _PChore=0x7cbffc24 {_M_first=0 _M_step=1 _M_function={…} …}) Line 3495 C++
msvcr100d.dll!Concurrency::details::_UnrealizedChore::_StructuredChoreWrapper(Concurrency::details::_UnrealizedChore * pChore=0x7cbffc24 {_M_first=0 _M_step=1 _M_function={…} …}) Line 99 + 0xc bytes C++
msvcr100d.dll!Concurrency::details::_UnrealizedChore::_Invoke() Line 3454 + 0xc bytes C++
msvcr100d.dll!Concurrency::details::WorkItem::Invoke() Line 75 C++
msvcr100d.dll!Concurrency::details::InternalContextBase::ExecuteChoreInline(Concurrency::details::WorkItem * pWork=0x7bc0fab4) Line 1385 C++
msvcr100d.dll!Concurrency::details::InternalContextBase::Dispatch(Concurrency::DispatchState * pDispatchState=0x7bc0fad4) Line 1478 C++
msvcr100d.dll!Concurrency::details::FreeThreadProxy::Dispatch() Line 157 C++
msvcr100d.dll!Concurrency::details::ThreadProxy::ThreadProxyMain(void * lpParameter=0x2dcf6200) Line 162 C++
kernel32.dll!763c33aa()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!771a9ef2()
ntdll.dll!771a9ec5()

And there could be other random access violations even inside the PPL internal implementation, that I guess you could be able to reproduce. (hopefully)

I ran the same program under Visual Studio 2012 Express for Desktop, and everything seems to be working properly after many test runs.

I’m wondering that if PPL under VS2010 is buggy to be used in a production environment?

Thanks for any inputs!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:34:44+00:00Added an answer on June 17, 2026 at 11:34 pm

    So finally, after posting a question on Microsoft Connect (or Social?), the issue has been explained thoroughly.

    http://social.msdn.microsoft.com/Forums/en-US/parallelcppnative/thread/9601a2d0-b1ef-4d81-8743-73c3965a7b63

    http://social.msdn.microsoft.com/Forums/eu/parallelcppnative/thread/38d2e8c8-e863-4da0-a45a-9776ab27feed

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am doing a simple coin flipping experiment for class that involves flipping a
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.