I keep getting a debug error thrown, telling me that abort() has been called and then when I go to debug in Visual Studio it takes me to the following code (the last line is where it throws):
void __cdecl _NMSG_WRITE (
int rterrnum
)
{
const wchar_t * const error_text = _GET_RTERRMSG(rterrnum);
if (error_text)
{
int msgshown = 0;
#ifdef _DEBUG
/*
* Report error.
*
* If _CRT_ERROR has _CRTDBG_REPORT_WNDW on, and user chooses
* "Retry", call the debugger.
*
* Otherwise, continue execution.
*
*/
if (rterrnum != _RT_CRNL && rterrnum != _RT_BANNER && rterrnum != _RT_CRT_NOTINIT)
{
switch (_CrtDbgReportW(_CRT_ERROR, NULL, 0, NULL, L"%s", error_text))
{
case 1: _CrtDbgBreak(); msgshown = 1; break;
It appears when I step over whatever-is-the-last-line in the below function:
X::my_func(){
//a,b,c are 2x ints and a unordered_map
std::thread t1(&X::multi_thread_func, this, a, b, c);
int c = 0;
//The debug error message doesn't appear until I step over this line. If I were
//to add further code to this function then the error only appears after stepping
//over the last line in the function.
int c1 = 0;
}
I appreciate there's not a lot to go on- but could people give me tips how I could continue my investigation from within Visual Studio 2012?
EDIT: If I remove the multithreaded call I don't get the error