Error occurred on Sunday, December 30, 2018 at 14:25:15.
codeblocks.exe caused an Access Violation at location 00000000677535AC in module codecompletion.dll Reading from location 0000000000000000.
AddrPC Params
00000000677535AC 000000000DC28E30 000000000E7964F0 000000000EF75658 codecompletion.dll!0x935ac
0000000067753F32 000000000DC28E30 000000000E7964F0 0000000000000006 codecompletion.dll!0x93f32
00000000677539B6 000000000DC28E30 000000000D974280 000000000E7964E0 codecompletion.dll!0x939b6
00000000677532CF 000000000DC28E30 000000000D974280 00000000FFFFFFFF codecompletion.dll!0x932cf
0000000067751B1F 000000000DC28E30 0000000067750F7E 000000000DC28E30 codecompletion.dll!0x91b1f
0000000067751401 000000000E7965E0 000000000DC28E30 000000000F83BDF0 codecompletion.dll!0x91401
00000000677511C6 000000000E796730 000000000DC28E30 000000000F4F0AC0 codecompletion.dll!0x911c6
000000006773C4B8 000000000DC28E20 000000000DC28E30 0000000002000002 codecompletion.dll!0x7c4b8
000000006773C0DD 000000000DC28E20 000000000DC29048 0000000008F4D700 codecompletion.dll!0x7c0dd
000000006773AC75 000000000DC28E20 000000000DC28E20 0000000000000000 codecompletion.dll!0x7ac75
00000000677312D4 0000000008F4D3B0 000000000E797E00 000000000E797E00 codecompletion.dll!0x712d4
000000006773467D 0000000008F4D3B0 000000000E797E00 000000000DC28B01 codecompletion.dll!0x7467d
000000006773EC6A 000000000DC28950 000000006780B8A0 0000000002000002 codecompletion.dll!0x7ec6a
000000006773B1A7 000000000DC28950 000000000DC28B78 0000000008F4D700 codecompletion.dll!0x7b1a7
000000006773AC75 000000000DC28950 000000000DC28950 0000000000000000 codecompletion.dll!0x7ac75
00000000677312D4 0000000008F4D3B0 000000000E798E20 000000000E798E00 codecompletion.dll!0x712d4
000000006773467D 0000000008F4D3B0 000000000E798E20 000000000DC28101 codecompletion.dll!0x7467d
000000006773EC6A 000000000DC27FB0 000000006780B8A0 0000000002080130 codecompletion.dll!0x7ec6a
000000006773B1A7 000000000DC27FB0 000000000DC281D8 0000000008F4D700 codecompletion.dll!0x7b1a7
000000006773AC75 000000000DC27FB0 000000000DC27FB0 0000000000000000 codecompletion.dll!0x7ac75
00000000677312D4 0000000008F4D3B0 000000000E799E40 000000000E799E00 codecompletion.dll!0x712d4
000000006773467D 0000000008F4D3B0 000000000E799E40 000000000DC26E01 codecompletion.dll!0x7467d
000000006773EC6A 000000000DC26C70 000000006780B8A0 0000000002000002 codecompletion.dll!0x7ec6a
000000006773B1A7 000000000DC26C70 000000000DC26E98 0000000008F4D700 codecompletion.dll!0x7b1a7
000000006773AC75 000000000DC26C70 000000000DC26C70 0000000000000000 codecompletion.dll!0x7ac75
00000000677312D4 0000000008F4D3B0 000000000E79AE60 000000000E79AE00 codecompletion.dll!0x712d4
000000006773467D 0000000008F4D3B0 000000000E79AE60 000000000DC28601 codecompletion.dll!0x7467d
000000006773EC6A 000000000DC28480 000000006780B8A0 00000000020800F0 codecompletion.dll!0x7ec6a
000000006773B1A7 000000000DC28480 000000000DC286A8 0000000008F4D700 codecompletion.dll!0x7b1a7
000000006773AC75 000000000DC28480 000000000DC28480 0000000000000000 codecompletion.dll!0x7ac75
00000000677312D4 0000000008F4D3B0 000000000E79BE80 000000000E79BE00 codecompletion.dll!0x712d4
000000006773467D 0000000008F4D3B0 000000000E79BE80 000000000DC26901 codecompletion.dll!0x7467d
000000006773EC6A 000000000DC267A0 000000006780B8A0 0000000002000000 codecompletion.dll!0x7ec6a
000000006773B1A7 000000000DC267A0 000000000DC269C8 0000000008F4D700 codecompletion.dll!0x7b1a7
000000006773AC75 000000000DC267A0 000000000DC267A0 0000000000000000 codecompletion.dll!0x7ac75
00000000677312D4 0000000008F4D3B0 000000000E79CEA0 000000000E79CE00 codecompletion.dll!0x712d4
000000006773467D 0000000008F4D3B0 000000000E79CEA0 000000000DC26401 codecompletion.dll!0x7467d
000000006773EC6A 000000000DC262D0 000000006780B8A0 000000000208004C codecompletion.dll!0x7ec6a
000000006773B1A7 000000000DC262D0 000000000DC264F8 0000000008F4D700 codecompletion.dll!0x7b1a7
000000006773AC75 000000000DC262D0 000000000DC262D0 0000000000000000 codecompletion.dll!0x7ac75
00000000677312D4 0000000008F4D3B0 000000000E79DEC0 000000000E79DE00 codecompletion.dll!0x712d4
000000006773467D 0000000008F4D3B0 000000000E79DEC0 000000000DC26001 codecompletion.dll!0x7467d
000000006773EC6A 000000000DC25E00 000000006780B8A0 000000000208004E codecompletion.dll!0x7ec6a
000000006773B1A7 000000000DC25E00 000000000DC26028 0000000008F4D700 codecompletion.dll!0x7b1a7
000000006773AC75 000000000DC25E00 000000000DC25E00 0000000000000000 codecompletion.dll!0x7ac75
00000000677312D4 0000000008F4D3B0 000000000E79EEE0 000000000E79EE00 codecompletion.dll!0x712d4
000000006773467D 0000000008F4D3B0 000000000E79EEE0 000000000D8F9001 codecompletion.dll!0x7467d
000000006773EC6A 000000000D8F8E50 000000006780B8A0 0000000002080058 codecompletion.dll!0x7ec6a
000000006773B1A7 000000000D8F8E50 000000000D8F9078 000000000D621800 codecompletion.dll!0x7b1a7
000000006773AC75 000000000D8F8E50 00000000000005CC 000000000E79F900 codecompletion.dll!0x7ac75
0000000067761A62 000000000D8F8E50 000000000D621880 0000000000000000 codecompletion.dll!0xa1a62
00000000709787AF 000000000D621820 0000000000000000 0000000000000000 codeblocks.dll!cbThreadPool::cbWorkerThread::Entry
0000000069D3AFF2 000000000D621820 000000000D621830 0000000000000000 wxmsw311u_gcc_cb.dll!wxThread::CallEntry
0000000069D3F419 00007FFD02A0F090 0000000000000000 0000000000000000 wxmsw311u_gcc_cb.dll!wxMutex::wxMutex
0000000069D3FD01 00000000090466F0 0000000000000000 0000000000000000 wxmsw311u_gcc_cb.dll!wxMutex::wxMutex
00007FFD0004AE06 00007FFD0009F6D0 000000000911C140 0000000000000000 msvcrt.dll!_beginthreadex
00007FFD0004AEDC 0000000000000000 0000000000000000 0000000000000000 msvcrt.dll!_endthreadex
00007FFD000C2784 0000000000000000 0000000000000000 0000000000000000 KERNEL32.DLL!BaseThreadInitThunk
00007FFD02A30C31 0000000000000000 0000000000000000 0000000000000000 ntdll.dll!RtlUserThreadStart
can anyone confirm this ?Yes, you need this dll's:
c:\dev\CodeBlocks>dumpbin /dependents codeblocks.exe
Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file codeblocks.exe
File Type: EXECUTABLE IMAGE
Image has the following dependencies:
COMCTL32.dll
libgcc_s_seh-1.dll
KERNEL32.dll
msvcrt.dll
SHELL32.dll
SHFOLDER.dll
USER32.dll
libstdc++-6.dll
wxmsw311u_gcc_cb.dll
codeblocks.dll
exchndl.dll
Summary
1000 .CRT
A000 .bss
1000 .data
1000 .edata
20000 .idata
11000 .pdata
39000 .rdata
7000 .reloc
3D000 .rsrc
123000 .text
1000 .tls
1E000 .xdata
dll's added in a zip file (Mingw64dlls8.1.0.7z), see original message.Thank you. I tested the build and got the same crash for code completion
00000000677535AC 000000000CB29760 000000000D2DF150 000000000D29D018 codecompletion.dll!0x935ac
0000000067753F32 000000000CB29760 000000000D2DF150 000000000000000D codecompletion.dll!0x93f32
00000000677539B6 000000000CB29760 000000000D175330 000000000A6F9DF0 codecompletion.dll!0x939b6
00000000677532CF 000000000CB29760 000000000D175330 00000000FFFFFFFF codecompletion.dll!0x932cf
0000000067751B1F 000000000CB29760 0000000067750F7E 000000000CB29760 codecompletion.dll!0x91b1f
0000000067751401 000000000A6F9EF0 000000000CB29760 000000000CB29AF0 codecompletion.dll!0x91401
0000000067751067 000000000A6FA310 000000000CB29760 000000000C71D2F0 codecompletion.dll!0x91067
000000006773BFE7 000000000CB29750 000000000CB29978 00000000079DF700 codecompletion.dll!0x7bfe7
000000006773AC75 000000000CB29750 000000000CB29750 0000000000000000 codecompletion.dll!0x7ac75
00000000677312D4 00000000079DF420 000000000A6FAE60 000000000A6FAE00 codecompletion.dll!0x712d4
000000006773467D 00000000079DF420 000000000A6FAE60 000000000CB29401 codecompletion.dll!0x7467d
000000006773EC6A 000000000CB29280 000000006780B8A0 000000000C47CC60 codecompletion.dll!0x7ec6a
000000006773B1A7 000000000CB29280 000000000CB294A8 00000000079DF700 codecompletion.dll!0x7b1a7
000000006773AC75 000000000CB29280 000000000CB29280 0000000000000000 codecompletion.dll!0x7ac75
00000000677312D4 00000000079DF420 000000000A6FBE80 000000000A6FBE00 codecompletion.dll!0x712d4
000000006773467D 00000000079DF420 000000000A6FBE80 000000000CB28F01 codecompletion.dll!0x7467d
000000006773EC6A 000000000CB28DB0 000000006780B8A0 0000000007DFCB80 codecompletion.dll!0x7ec6a
000000006773B1A7 000000000CB28DB0 000000000CB28FD8 00000000079DF700 codecompletion.dll!0x7b1a7
000000006773AC75 000000000CB28DB0 000000000CB28DB0 0000000000000000 codecompletion.dll!0x7ac75
00000000677312D4 00000000079DF420 000000000A6FCEA0 000000000A6FCE00 codecompletion.dll!0x712d4
000000006773467D 00000000079DF420 000000000A6FCEA0 000000000CB28B01 codecompletion.dll!0x7467d
000000006773EC6A 000000000CB288E0 000000006780B8A0 0000000007A78D40 codecompletion.dll!0x7ec6a
000000006773B1A7 000000000CB288E0 000000000CB28B08 00000000079DF700 codecompletion.dll!0x7b1a7
000000006773AC75 000000000CB288E0 000000000CB288E0 0000000000000000 codecompletion.dll!0x7ac75
00000000677312D4 00000000079DF420 000000000A6FDEC0 000000000A6FDE00 codecompletion.dll!0x712d4
000000006773467D 00000000079DF420 000000000A6FDEC0 000000000CB28101 codecompletion.dll!0x7467d
000000006773EC6A 000000000CB27F40 000000006780B8A0 000000000CAF8A60 codecompletion.dll!0x7ec6a
000000006773B1A7 000000000CB27F40 000000000CB28168 00000000079DF700 codecompletion.dll!0x7b1a7
000000006773AC75 000000000CB27F40 000000000CB27F40 0000000000000000 codecompletion.dll!0x7ac75
00000000677312D4 00000000079DF420 000000000A6FEEE0 000000000A6FEE00 codecompletion.dll!0x712d4
000000006773467D 00000000079DF420 000000000A6FEEE0 000000000C6E5401 codecompletion.dll!0x7467d
000000006773EC6A 000000000C6E52A0 000000006780B8A0 000000000C68B230 codecompletion.dll!0x7ec6a
000000006773B1A7 000000000C6E52A0 000000000C6E54C8 000000000B977A00 codecompletion.dll!0x7b1a7
000000006773AC75 000000000C6E52A0 0000000000000430 000000000A6FF900 codecompletion.dll!0x7ac75
0000000067761A62 000000000C6E52A0 000000000B977A90 0000000000000000 codecompletion.dll!0xa1a62
00000000709787AF 000000000B977A30 0000000000000000 0000000000000000 codeblocks.dll!cbThreadPool::cbWorkerThread::Entry
0000000069D3AFF2 000000000B977A30 000000000B977A40 0000000000000000 wxmsw311u_gcc_cb.dll!wxThread::CallEntry
0000000069D3F419 000000000B977A30 0000000007AEFB90 0000000000000000 wxmsw311u_gcc_cb.dll!wxMutex::wxMutex
0000000069D3FD01 0000000007E5D760 0000000000000000 0000000000000000 wxmsw311u_gcc_cb.dll!wxMutex::wxMutex
000007FEFD7F415F 000007FEFD881EA0 0000000007E5D760 0000000000000000 msvcrt.dll!_endthreadex
000007FEFD7F6EBD 0000000000000000 0000000000000000 0000000000000000 msvcrt.dll!_endthreadex
0000000076FC59CD 0000000000000000 0000000000000000 0000000000000000 kernel32.dll!BaseThreadInitThunk
000000007722385D 0000000000000000 0000000000000000 0000000000000000 ntdll.dll!RtlUserThreadStart
Would it be possible to leave the debugging symbols in the nightly build? So this (and other nightly crashes) would be more easier to debug...would be nice if they did that lol...
could everyone who suffers from some crash, try the same thing with the previous nightly (same code version but the older compiler), so we can determine if it is due to code changes or just using the new compiler.I have tried it and at the moment i do not get any crash during working. I will still test during the day.
This version crash on start, when I try open existing project
The Zip File size of the latest version is smaller than the previous one.You have to add the static linked libraries, that killerbot provides in a other download. TDM links statically to this libraries and for this the executable will be larger...
Is there any reason that you know?
Please see in the attached jpg.
Saw an assertion error which might be a useful pointer:Are you able to reproduce this on a simple project? Do you have something special in your compiler settings?
Assertion failed in SystemHeadersThread::SystemHeadersThread(wxEvtHandler*, wxCritialSection*, SystemHeadersMap&, const wxArrayString&) at D:\Codeblocks\src\plugins\codecompletion\systemheadersthread.cpp:145.
incDirs.size()>0
-------------------
Error occurred on Tuesday, January 1, 2019 at 18:34:03.
codeblocks.exe caused an Access Violation at location 00000000097235AC in module codecompletion.dll Reading from location 0000000000000000.
AddrPC Params
00000000097235AC 000000001F2968F0 0000000021A764F0 000000001EED6B68 codecompletion.dll!KMP_Find [D:/Codeblocks/src/plugins/codecompletion/parser/tokenizer.cpp @ 1720]
1718: else
1719: {
> 1720: index += j - next[j];
1721: if (next[j] != -1)
1722: j = next[j];
0000000009723F32 000000001F2968F0 0000000021A764F0 0000000000000006 codecompletion.dll!GetFirstTokenPosition [D:/Codeblocks/src/plugins/codecompletion/parser/tokenizer.cpp @ 1934]
1932: for (;;)
1933: {
> 1934: const int ret = KMP_Find(p, key, keyLen);
1935: if (ret == -1)
1936: break;
00000000097239B6 000000001F2968F0 000000001F0F09F0 0000000021A764E0 codecompletion.dll!GetMacroExpandedText [D:/Codeblocks/src/plugins/codecompletion/parser/tokenizer.cpp @ 1849]
1847: {
1848: // find the first exist of formal arg from data to dataEnd
> 1849: const int pos = GetFirstTokenPosition(data, dataEnd - data, key, keyLen);
1850: if (pos != -1)
1851: {
00000000097232CF 000000001F2968F0 000000001F0F09F0 00000000FFFFFFFF codecompletion.dll!ReplaceMacroUsage [D:/Codeblocks/src/plugins/codecompletion/parser/tokenizer.cpp @ 1665]
1663:
1664: wxString macroExpandedText;
> 1665: if ( GetMacroExpandedText(tk, macroExpandedText) )
1666: return ReplaceBufferText(macroExpandedText, tk);
1667:
0000000009721B1F 000000001F2968F0 0000000009720F7E 000000001F2968F0 codecompletion.dll!CheckMacroUsageAndReplace [D:/Codeblocks/src/plugins/codecompletion/parser/tokenizer.cpp @ 1089]
1087: const Token* token = m_TokenTree->at(id);
1088: if (token)
> 1089: return ReplaceMacroUsage(token);// either object like macro or function like macro can be handled
1090: }
1091: return false;
0000000009721401 0000000021A765E0 000000001F2968F0 0000000021C27CA0 codecompletion.dll!DoGetToken [D:/Codeblocks/src/plugins/codecompletion/parser/tokenizer.cpp @ 966]
964: if (identifier)
965: {
> 966: bool replaced = CheckMacroUsageAndReplace();
967: // replaced is true means macro expansion happens, so we need to call Lex()
968: if (replaced)
00000000097211C6 0000000021A76730 000000001F2968F0 000000000EDC9040 codecompletion.dll!PeekToken [D:/Codeblocks/src/plugins/codecompletion/parser/tokenizer.cpp @ 904]
902: if (SkipUnwanted())
903: {
> 904: m_PeekToken = DoGetToken();
905: if (m_PeekToken == _T("(") && m_State^tsRawExpression)
906: ReadParentheses(m_PeekToken);
000000000970C4B8 000000001F2968E0 000000001F2968F0 0000000002000002 codecompletion.dll!DoParse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 1016]
1014: {
1015: // check for operator()()
> 1016: wxString peek = m_Tokenizer.PeekToken();
1017: if ( !peek.IsEmpty()
1018: && peek.GetChar(0) != ParserConsts::opbracket_chr)
000000000970C0DD 000000001F2968E0 000000001F296B08 000000000EF41400 codecompletion.dll!DoParse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 929]
927: {
928: m_Tokenizer.GetToken(); // "eat" {
> 929: DoParse(); // time for recursion ;)
930: }
931: }
000000000970AC75 000000001F2968E0 000000001F2968E0 0000000000000000 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 533]
531: }
532:
> 533: DoParse();
534:
535: if (!m_Options.useBuffer) // Parsing a file
00000000097012D4 000000000EF41130 0000000021A77E00 0000000021A77E00 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 345]
343: // run the parse recursively
344: AddParserThread(thread);
> 345: result = thread->Parse();
346: RemoveParserThread(thread);
347: delete thread;
000000000970467D 000000000EF41130 0000000021A77E00 000000001F298701 codecompletion.dll!ParseFile [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 670]
668:
669: // TODO (Morten#9#) locker ?
> 670: const bool ret = Parse(filename, !isGlobal, locked);
671:
672: return ret;
000000000970EC6A 000000001F2985C0 00000000097DB8A0 000000000208010A codecompletion.dll!HandleIncludes [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 1738]
1736:
1737: TRACE(_T("HandleIncludes() : Adding include file '%s'"), real_filename.wx_str());
> 1738: m_Parent->ParseFile(real_filename, isGlobal, true);
1739: }
1740: while (false);
000000000970B1A7 000000001F2985C0 000000001F2987E8 000000000EF41400 codecompletion.dll!DoParse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 653]
651: // those could be: "#include" or "#warning" or "#xxx" and more
652: if (token == ParserConsts::kw_include)
> 653: HandleIncludes();
654: else // handle "#warning" or "#xxx" and more, just skip them
655: m_Tokenizer.SkipToEOL();
000000000970AC75 000000001F2985C0 000000001F2985C0 0000000000000000 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 533]
531: }
532:
> 533: DoParse();
534:
535: if (!m_Options.useBuffer) // Parsing a file
00000000097012D4 000000000EF41130 0000000021A78E20 0000000021A78E00 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 345]
343: // run the parse recursively
344: AddParserThread(thread);
> 345: result = thread->Parse();
346: RemoveParserThread(thread);
347: delete thread;
000000000970467D 000000000EF41130 0000000021A78E20 000000001F293101 codecompletion.dll!ParseFile [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 670]
668:
669: // TODO (Morten#9#) locker ?
> 670: const bool ret = Parse(filename, !isGlobal, locked);
671:
672: return ret;
000000000970EC6A 000000001F292F20 00000000097DB8A0 0000000002080130 codecompletion.dll!HandleIncludes [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 1738]
1736:
1737: TRACE(_T("HandleIncludes() : Adding include file '%s'"), real_filename.wx_str());
> 1738: m_Parent->ParseFile(real_filename, isGlobal, true);
1739: }
1740: while (false);
000000000970B1A7 000000001F292F20 000000001F293148 000000000EF41400 codecompletion.dll!DoParse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 653]
651: // those could be: "#include" or "#warning" or "#xxx" and more
652: if (token == ParserConsts::kw_include)
> 653: HandleIncludes();
654: else // handle "#warning" or "#xxx" and more, just skip them
655: m_Tokenizer.SkipToEOL();
000000000970AC75 000000001F292F20 000000001F292F20 0000000000000000 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 533]
531: }
532:
> 533: DoParse();
534:
535: if (!m_Options.useBuffer) // Parsing a file
00000000097012D4 000000000EF41130 0000000021A79E40 0000000021A79E00 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 345]
343: // run the parse recursively
344: AddParserThread(thread);
> 345: result = thread->Parse();
346: RemoveParserThread(thread);
347: delete thread;
000000000970467D 000000000EF41130 0000000021A79E40 000000001F299B01 codecompletion.dll!ParseFile [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 670]
668:
669: // TODO (Morten#9#) locker ?
> 670: const bool ret = Parse(filename, !isGlobal, locked);
671:
672: return ret;
000000000970EC6A 000000001F299900 00000000097DB8A0 0000000002000002 codecompletion.dll!HandleIncludes [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 1738]
1736:
1737: TRACE(_T("HandleIncludes() : Adding include file '%s'"), real_filename.wx_str());
> 1738: m_Parent->ParseFile(real_filename, isGlobal, true);
1739: }
1740: while (false);
000000000970B1A7 000000001F299900 000000001F299B28 000000000EF41400 codecompletion.dll!DoParse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 653]
651: // those could be: "#include" or "#warning" or "#xxx" and more
652: if (token == ParserConsts::kw_include)
> 653: HandleIncludes();
654: else // handle "#warning" or "#xxx" and more, just skip them
655: m_Tokenizer.SkipToEOL();
000000000970AC75 000000001F299900 000000001F299900 0000000000000000 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 533]
531: }
532:
> 533: DoParse();
534:
535: if (!m_Options.useBuffer) // Parsing a file
00000000097012D4 000000000EF41130 0000000021A7AE60 0000000021A7AE00 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 345]
343: // run the parse recursively
344: AddParserThread(thread);
> 345: result = thread->Parse();
346: RemoveParserThread(thread);
347: delete thread;
000000000970467D 000000000EF41130 0000000021A7AE60 000000001F292701 codecompletion.dll!ParseFile [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 670]
668:
669: // TODO (Morten#9#) locker ?
> 670: const bool ret = Parse(filename, !isGlobal, locked);
671:
672: return ret;
000000000970EC6A 000000001F292580 00000000097DB8A0 00000000020800F0 codecompletion.dll!HandleIncludes [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 1738]
1736:
1737: TRACE(_T("HandleIncludes() : Adding include file '%s'"), real_filename.wx_str());
> 1738: m_Parent->ParseFile(real_filename, isGlobal, true);
1739: }
1740: while (false);
000000000970B1A7 000000001F292580 000000001F2927A8 000000000EF41400 codecompletion.dll!DoParse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 653]
651: // those could be: "#include" or "#warning" or "#xxx" and more
652: if (token == ParserConsts::kw_include)
> 653: HandleIncludes();
654: else // handle "#warning" or "#xxx" and more, just skip them
655: m_Tokenizer.SkipToEOL();
000000000970AC75 000000001F292580 000000001F292580 0000000000000000 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 533]
531: }
532:
> 533: DoParse();
534:
535: if (!m_Options.useBuffer) // Parsing a file
00000000097012D4 000000000EF41130 0000000021A7BE80 0000000021A7BE00 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 345]
343: // run the parse recursively
344: AddParserThread(thread);
> 345: result = thread->Parse();
346: RemoveParserThread(thread);
347: delete thread;
000000000970467D 000000000EF41130 0000000021A7BE80 000000001F294E01 codecompletion.dll!ParseFile [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 670]
668:
669: // TODO (Morten#9#) locker ?
> 670: const bool ret = Parse(filename, !isGlobal, locked);
671:
672: return ret;
000000000970EC6A 000000001F294C00 00000000097DB8A0 0000000002000000 codecompletion.dll!HandleIncludes [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 1738]
1736:
1737: TRACE(_T("HandleIncludes() : Adding include file '%s'"), real_filename.wx_str());
> 1738: m_Parent->ParseFile(real_filename, isGlobal, true);
1739: }
1740: while (false);
000000000970B1A7 000000001F294C00 000000001F294E28 000000000EF41400 codecompletion.dll!DoParse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 653]
651: // those could be: "#include" or "#warning" or "#xxx" and more
652: if (token == ParserConsts::kw_include)
> 653: HandleIncludes();
654: else // handle "#warning" or "#xxx" and more, just skip them
655: m_Tokenizer.SkipToEOL();
000000000970AC75 000000001F294C00 000000001F294C00 0000000000000000 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 533]
531: }
532:
> 533: DoParse();
534:
535: if (!m_Options.useBuffer) // Parsing a file
00000000097012D4 000000000EF41130 0000000021A7CEA0 0000000021A7CE00 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 345]
343: // run the parse recursively
344: AddParserThread(thread);
> 345: result = thread->Parse();
346: RemoveParserThread(thread);
347: delete thread;
000000000970467D 000000000EF41130 0000000021A7CEA0 000000001F292201 codecompletion.dll!ParseFile [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 670]
668:
669: // TODO (Morten#9#) locker ?
> 670: const bool ret = Parse(filename, !isGlobal, locked);
671:
672: return ret;
000000000970EC6A 000000001F2920B0 00000000097DB8A0 000000000208004C codecompletion.dll!HandleIncludes [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 1738]
1736:
1737: TRACE(_T("HandleIncludes() : Adding include file '%s'"), real_filename.wx_str());
> 1738: m_Parent->ParseFile(real_filename, isGlobal, true);
1739: }
1740: while (false);
000000000970B1A7 000000001F2920B0 000000001F2922D8 000000000EF41400 codecompletion.dll!DoParse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 653]
651: // those could be: "#include" or "#warning" or "#xxx" and more
652: if (token == ParserConsts::kw_include)
> 653: HandleIncludes();
654: else // handle "#warning" or "#xxx" and more, just skip them
655: m_Tokenizer.SkipToEOL();
000000000970AC75 000000001F2920B0 000000001F2920B0 0000000000000000 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 533]
531: }
532:
> 533: DoParse();
534:
535: if (!m_Options.useBuffer) // Parsing a file
00000000097012D4 000000000EF41130 0000000021A7DEC0 0000000021A7DE00 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 345]
343: // run the parse recursively
344: AddParserThread(thread);
> 345: result = thread->Parse();
346: RemoveParserThread(thread);
347: delete thread;
000000000970467D 000000000EF41130 0000000021A7DEC0 000000001F295201 codecompletion.dll!ParseFile [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 670]
668:
669: // TODO (Morten#9#) locker ?
> 670: const bool ret = Parse(filename, !isGlobal, locked);
671:
672: return ret;
000000000970EC6A 000000001F2950D0 00000000097DB8A0 000000000208003E codecompletion.dll!HandleIncludes [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 1738]
1736:
1737: TRACE(_T("HandleIncludes() : Adding include file '%s'"), real_filename.wx_str());
> 1738: m_Parent->ParseFile(real_filename, isGlobal, true);
1739: }
1740: while (false);
000000000970B1A7 000000001F2950D0 000000001F2952F8 000000000EF41400 codecompletion.dll!DoParse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 653]
651: // those could be: "#include" or "#warning" or "#xxx" and more
652: if (token == ParserConsts::kw_include)
> 653: HandleIncludes();
654: else // handle "#warning" or "#xxx" and more, just skip them
655: m_Tokenizer.SkipToEOL();
000000000970AC75 000000001F2950D0 000000001F2950D0 0000000000000000 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 533]
531: }
532:
> 533: DoParse();
534:
535: if (!m_Options.useBuffer) // Parsing a file
00000000097012D4 000000000EF41130 0000000021A7EEE0 0000000021A7EE00 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 345]
343: // run the parse recursively
344: AddParserThread(thread);
> 345: result = thread->Parse();
346: RemoveParserThread(thread);
347: delete thread;
000000000970467D 000000000EF41130 0000000021A7EEE0 000000000F319701 codecompletion.dll!ParseFile [D:/Codeblocks/src/plugins/codecompletion/parser/parser.cpp @ 670]
668:
669: // TODO (Morten#9#) locker ?
> 670: const bool ret = Parse(filename, !isGlobal, locked);
671:
672: return ret;
000000000970EC6A 000000000F319550 00000000097DB8A0 0000000002000002 codecompletion.dll!HandleIncludes [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 1738]
1736:
1737: TRACE(_T("HandleIncludes() : Adding include file '%s'"), real_filename.wx_str());
> 1738: m_Parent->ParseFile(real_filename, isGlobal, true);
1739: }
1740: while (false);
000000000970B1A7 000000000F319550 000000000F319778 000000001EF07700 codecompletion.dll!DoParse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 653]
651: // those could be: "#include" or "#warning" or "#xxx" and more
652: if (token == ParserConsts::kw_include)
> 653: HandleIncludes();
654: else // handle "#warning" or "#xxx" and more, just skip them
655: m_Tokenizer.SkipToEOL();
000000000970AC75 000000000F319550 0000000000000660 0000000021A7F900 codecompletion.dll!Parse [D:/Codeblocks/src/plugins/codecompletion/parser/parserthread.cpp @ 533]
531: }
532:
> 533: DoParse();
534:
535: if (!m_Options.useBuffer) // Parsing a file
0000000009731A62 000000000F319550 000000001EF07840 0000000000000000 codecompletion.dll!Execute [D:/Development/wxWidgets-3.1.1/include/wx/wxcrt.h @ 958]
956:
957: inline bool wxIsalnum(const wxUniChar& c) { return wxCRT_IsalnumW(c) != 0; }
> 958: inline bool wxIsalpha(const wxUniChar& c) { return wxCRT_IsalphaW(c) != 0; }
959: inline bool wxIscntrl(const wxUniChar& c) { return wxCRT_IscntrlW(c) != 0; }
960: inline bool wxIsdigit(const wxUniChar& c) { return wxCRT_IsdigitW(c) != 0; }
00000000709787AF 000000001EF077E0 0000000000000000 0000000000000000 codeblocks.dll!Entry [D:/Codeblocks/src/sdk/cbthreadpool.cpp @ 228]
226: if (!Aborted())
227: {
> 228: m_pTask->Execute(); // run task's job here
229:
230: {
0000000069D3AFF2 000000001EF077E0 000000001EF077F0 0000000000000000 wxmsw311u_gcc_cb.dll!wxThread::CallEntry
0000000069D3F419 00007FFD02A0F090 0000000000000000 0000000000000000 wxmsw311u_gcc_cb.dll!wxThreadInternal::DoThreadStart
0000000069D3FD01 000000000EF6CF80 0000000000000000 0000000000000000 wxmsw311u_gcc_cb.dll!wxThreadInternal::WinThreadStart
00007FFD0004AE06 00007FFD0009F6D0 000000000F038060 0000000000000000 msvcrt.dll!_beginthreadex
00007FFD0004AEDC 0000000000000000 0000000000000000 0000000000000000 msvcrt.dll!_endthreadex
00007FFD000C2784 0000000000000000 0000000000000000 0000000000000000 KERNEL32.DLL!BaseThreadInitThunk
00007FFD02A30C31 0000000000000000 0000000000000000 0000000000000000 ntdll.dll!RtlUserThreadStart
codeblocks.exe 17.12.0.0
ntdll.dll 10.0.15063.1324
KERNEL32.DLL 10.0.15063.1058
KERNELBASE.dll 10.0.15063.1266
msvcrt.dll 7.0.15063.0
COMCTL32.dll 6.10.15063.1155
SHELL32.dll 10.0.15063.1387
combase.dll 10.0.15063.1155
ucrtbase.dll 10.0.15063.1182
cfgmgr32.dll 10.0.15063.0
RPCRT4.dll 10.0.15063.1155
bcryptPrimitives.dll 10.0.15063.994
shcore.dll 10.0.15063.1155
GDI32.dll 10.0.15063.1324
gdi32full.dll 10.0.15063.1387
windows.storage.dll 10.0.15063.1324
msvcp_win.dll 10.0.15063.936
advapi32.dll 10.0.15063.1356
USER32.dll 10.0.15063.936
sechost.dll 10.0.15063.1356
win32u.dll 10.0.15063.608
shlwapi.dll 10.0.15063.1058
kernel.appcore.dll 10.0.15063.1155
powrprof.dll 10.0.15063.0
profapi.dll 10.0.15063.0
SHFOLDER.dll 10.0.15063.0
libgcc_s_seh-1.dll
libstdc++-6.dll
libwinpthread-1.dll 1.0.0.0
exchndl.dll 0.8.2.0
PSAPI.DLL 10.0.15063.0
VERSION.dll 10.0.15063.0
wxmsw311u_gcc_cb.dll 3.1.1.0
comdlg32.dll 10.0.15063.1155
ole32.dll 10.0.15063.1235
OLEAUT32.dll 10.0.15063.966
OLEACC.dll 7.2.15063.447
UxTheme.dll 10.0.15063.0
WINMM.dll 10.0.15063.0
WINSPOOL.DRV 10.0.15063.1235
WSOCK32.dll 10.0.15063.0
WS2_32.dll 10.0.15063.0
WINMMBASE.dll 10.0.15063.0
bcrypt.dll 10.0.15063.1155
mgwhelp.dll 0.8.2.0
dbghelp.dll 6.3.9600.17298
codeblocks.dll
IMM32.DLL 10.0.15063.0
CRYPTBASE.DLL 10.0.15063.0
MSCTF.dll 10.0.15063.1155
SspiCli.dll 10.0.15063.850
dwmapi.dll 10.0.15063.994
TextInputFramework.dll 10.0.15063.1155
CoreUIComponents.dll 10.0.15063.1387
CoreMessaging.dll 10.0.15063.1387
ntmarta.dll 10.0.15063.0
wintypes.dll 10.0.15063.1155
usermgrcli.dll 10.0.15063.0
clbcatq.dll 2001.12.10941.16384
dataexchange.dll 10.0.15063.0
dcomp.dll 10.0.15063.1155
d3d11.dll 10.0.15063.1155
dxgi.dll 10.0.15063.966
twinapi.appcore.dll 10.0.15063.1206
WindowsCodecs.dll 10.0.15063.1324
msftedit.DLL 10.0.15063.1155
Windows.Globalization.dll 10.0.15063.1292
Bcp47Langs.dll 10.0.15063.1155
globinputhost.dll 10.0.15063.966
thumbcache.dll 10.0.15063.1155
policymanager.dll 10.0.15063.1155
msvcp110_win.dll 10.0.15063.850
abbreviations.dll
astyle.dll
autosave.dll
AutoVersioning.dll
BrowseTracker.dll
byogames.dll
cb_koders.dll
Cccc.dll
classwizard.dll
codecompletion.dll
codesnippets.dll
codestat.dll
compiler.dll
copystrings.dll
CppCheck.dll
Cscope.dll
debugger.dll
defaultmimehandler.dll
devpakupdater.dll
DoxyBlocks.dll 1.7.663.8397
DragScroll.dll
EditorConfig.dll
EditorTweaks.dll
envvars.dll
Exporter.dll
FileManager.dll
FortranProject.dll
headerfixup.dll
help_plugin.dll
HHCTRL.OCX 10.0.15063.1112
HexEditor.dll
IncrementalSearch.dll
keybinder.dll
lib_finder.dll
wxflatnotebook.dll
MouseSap.dll
NassiShneiderman.dll
OccurrencesHighlighting.dll
openfileslist.dll
Profiler.dll
ProjectOptionsManipulator.dll
projectsimporter.dll
RegExTestbed.dll
ReopenEditor.dll
rndgen.dll
scriptedwizard.dll
SmartIndentCpp.dll
SmartIndentFortran.dll
SmartIndentHDL.dll
SmartIndentLua.dll
SmartIndentPascal.dll
SmartIndentPython.dll
SmartIndentXML.dll
SpellChecker.dll
SymTab.dll
ThreadSearch.dll
wxcustombutton.dll
todo.dll
ToolsPlus.dll
wxsmith.dll
wxsmithlib.dll
wxSmithAui.dll
wxSmithContribItems.dll
wxdatetimepicker.dll
wxmathplot.dll
wxspeedbutton.dll
wxchartctrl.dll
wximagepanel.dll
wxkwic.dll
wxled.dll
xpmanifest.dll
msimg32.dll 10.0.15063.0
WININET.dll 11.0.15063.1387
iertutil.dll 11.0.15063.1266
ondemandconnroutehelper.dll 10.0.15063.966
IPHLPAPI.DLL 10.0.15063.0
winhttp.dll 10.0.15063.997
mswsock.dll 10.0.15063.0
NSI.dll 10.0.15063.0
WINNSI.DLL 10.0.15063.0
urlmon.dll 11.0.15063.1324
msiso.dll 11.0.15063.1266
DNSAPI.dll 10.0.15063.1206
mdnsNSP.dll 3.1.0.1
rasadhlp.dll 10.0.15063.0
fwpuclnt.dll 10.0.15063.966
Windows 10.0.15063
DrMingw 0.8.2
What is the value of j and next?
> info locals
next = <error reading variable next (Cannot access memory at address 0x0)>
index = 0
i = 0
j = 0
some heavy compiler optimizing going on here xDI hope this is sarcasm, because the bug happens even with -O0...
diff --git a/src/plugins/codecompletion/parser/tokenizer.cpp b/src/plugins/codecompletion/parser/tokenizer.cpp
index 34e85c0..9b72cef 100644
--- a/src/plugins/codecompletion/parser/tokenizer.cpp
+++ b/src/plugins/codecompletion/parser/tokenizer.cpp
@@ -1668,7 +1668,7 @@ bool Tokenizer::ReplaceMacroUsage(const Token* tk)
return false;
}
-void Tokenizer::KMP_GetNextVal(const wxChar* pattern, int next[])
+void Tokenizer::KMP_GetNextVal(const wxChar* pattern, int next[], const int patternLen)
{
int j = 0, k = -1;
next[0] = -1;
@@ -1677,6 +1677,8 @@ void Tokenizer::KMP_GetNextVal(const wxChar* pattern, int next[])
if (k == -1 || pattern[j] == pattern[k])
{
++j;
+ if (j >= patternLen + 1)
+ abort();
++k;
if (pattern[j] != pattern[k])
next[j] = k;
@@ -1704,8 +1706,8 @@ int Tokenizer::KMP_Find(const wxChar* text, const wxChar* pattern, const int pat
}
}
- int next[patternLen];
- KMP_GetNextVal(pattern, next);
+ int next[patternLen + 1];
+ KMP_GetNextVal(pattern, next, patternLen);
int index = 0, i = 0, j = 0;
while (text[i] != _T('\0') && pattern[j] != _T('\0'))
diff --git a/src/plugins/codecompletion/parser/tokenizer.h b/src/plugins/codecompletion/parser/tokenizer.h
index a5ea3bf..911835f 100644
--- a/src/plugins/codecompletion/parser/tokenizer.h
+++ b/src/plugins/codecompletion/parser/tokenizer.h
@@ -489,7 +489,7 @@ private:
bool GetMacroExpandedText(const Token* tk, wxString& expandedText);
/** used in the KMP find function */
- void KMP_GetNextVal(const wxChar* pattern, int next[]);
+ void KMP_GetNextVal(const wxChar* pattern, int next[], const int patternLen);
/** Tokenizer options specify the token reading option */
TokenizerOptions m_TokenizerOptions;
Here is patch which fixes one of the issues with this function....
...
I won't make any changes, because I don't understand the code here. @ollydbg would you be able to fix the issue now that we know what is causing it?
#define M(a,b) 2*a+b
M(x,y)
funny:Code> info locals
next = <error reading variable next (Cannot access memory at address 0x0)>
index = 0
i = 0
j = 0
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 USE_OPENGL=1 VENDOR=cb CXXFLAGS="-Wno-unused-local-typedefs -Wno-deprecated-declarations -fno-keep-inline-dllexport" >log-release.txt 2>&1
int Tokenizer::KMP_Find(const wxChar* text, const wxChar* pattern, const int patternLen)
{
if (!text || !pattern || pattern[0] == _T('\0') || text[0] == _T('\0'))
return -1;
if (patternLen > 1024)
{
if (patternLen < 5012)
TRACE(_T("KMP_Find() : %s - %s"), text, pattern);
else
{
TRACE(_T("KMP_Find: The plan buffer is too big, %d"), patternLen);
return -2;
}
}
int next[patternLen];
KMP_GetNextVal(pattern, next); //bp1
int index = 0, i = 0, j = 0; //bp2
> info locals
[debug]> info locals
[debug]next = {2283936, 0, 1875784749, 0}
[debug]index = 0
[debug]i = 14
[debug]j = 0
[debug]>>>>>>cb_gdb:
next = {2283936, 0, 1875784749, 0}
index = 0
i = 14
j = 0
> info locals
[debug]> info locals
[debug]next = <error reading variable next (Cannot access memory at address 0x1)>
[debug]index = 0
[debug]i = 14
[debug]j = 0
[debug]>>>>>>cb_gdb:
next = <error reading variable next (Cannot access memory at address 0x1)>
index = 0
i = 14
j = 0
void Tokenizer::KMP_GetNextVal(const wxChar* pattern, int next[])
{
int j = 0, k = -1;
next[0] = -1;
while (pattern[j] != _T('\0'))
{
if (k == -1 || pattern[j] == pattern[k])
{
++j;
++k;
if (pattern[j] != pattern[k])
next[j] = k; // error
else
next[j] = next[k];
}
else
k = next[k];
}
}
int Tokenizer::GetFirstTokenPosition(const wxChar* buffer, const size_t bufferLen,
const wxChar* key, const size_t keyLen)
{
int pos = -1;
wxChar* p = const_cast<wxChar*>(buffer);
const wxChar* endBuffer = buffer + bufferLen;
for (;;)
{
const int ret = KMP_Find(p, key, keyLen);
if (ret == -1)
break;
// check previous char
p += ret;
if (p > buffer)
{
const wxChar ch = *(p - 1);
if (ch == _T('_') || wxIsalnum(ch))
{
p += keyLen;
continue;
}
}
// check next char
p += keyLen;
if (p < endBuffer)
{
const wxChar ch = *p;
if (ch == _T('_') || wxIsalnum(ch))
continue;
}
// got it
pos = p - buffer - keyLen;
break;
}
return pos;
}
[debug]> info args
[debug]this = 0x41d4200
[debug]buffer = 0x41d7bf0 L"text ## line"
[debug]bufferLen = 12
[debug]key = 0x41d7868 L"text"
[debug]keyLen = 4
[debug]>>>>>>cb_gdb:
this = 0x41d4200
buffer = 0x41d7bf0 L"text ## line"
bufferLen = 12
key = 0x41d7868 L"text"
keyLen = 4
void Tokenizer::KMP_GetNextVal(const wxChar* pattern, int next[])
{
int len = 0;
next[0] = 0; // CB code uses -1
int i = 1;
while (pattern[i] != _T('\0'))
{
if (pattern[i] == pattern[len])
{
len++;
next[i] = len;
i++;
}
else
{
if (len)
{
len = next[len - 1];
}
else
{
next[i] = 0;
i++;
}
}
}
}
Also, I would try using a std::vector or new[] instead of a dynamic array for next.And you'll make the parser slow... There is already a known limit on the number of elements in this array. It can be used. But this won't solve the problem.
codeblocks.exe caused an Access Violation at location 0CAC57FA in module codecompletion.dll Reading from location 2A13C000.
Registers:
eax=2a13c000 ebx=2523b6f0 ecx=00000000 edx=00001390 esi=2523c740 edi=77de22b0
eip=0cac57fa esp=2523b6e0 ebp=2523b728 iopl=0 nv up ei pl nz na po nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010206
AddrPC Params
0CAC57FA 2A13AC70 00001022 2A17F5D4 codecompletion.dll!KMP_Find [G:/Codeblocks/src/plugins/codecompletion/parser/tokenizer.cpp @ 1716]
1714: while ( i < textLen && j < patternLen)
1715: {
> 1716: if (j == -1 || text[i] == pattern[j])
1717: {
1718: ++i;
0CAC61CB 2A139C94 00001022 2A17F5D4 codecompletion.dll!GetFirstTokenPosition [G:/Codeblocks/src/plugins/codecompletion/parser/tokenizer.cpp @ 1928]
1926: for (;;)
1927: {
> 1928: const int ret = KMP_Find(p, bufferLen, key, keyLen);
1929: if (ret == -1)
1930: break;
0CAC5C30 25F51558 2523B92C 2523B8F8 codecompletion.dll!GetMacroExpandedText [G:/Codeblocks/src/plugins/codecompletion/parser/tokenizer.cpp @ 1843]
1841: {
1842: // find the first exist of formal arg from data to dataEnd
> 1843: const int pos = GetFirstTokenPosition(data, dataEnd - data, key, keyLen);
1844: if (pos != -1)
1845: {
0x0c7c57fa in Tokenizer::KMP_Find (this=0x228ce570, text=0x2bfc5fc2 L")", textLen=43, pattern=0x2bfc56ec L"T", patternLen=1)
at G:\Codeblocks\src\plugins\codecompletion\parser\tokenizer.cpp:1716
1716 if (j == -1 || text[i] == pattern[j])
(gdb) bt
#0 0x0c7c57fa in Tokenizer::KMP_Find (this=0x228ce570, text=0x2bfc5fc2 L")", textLen=43, pattern=0x2bfc56ec L"T", patternLen=1)
at G:\Codeblocks\src\plugins\codecompletion\parser\tokenizer.cpp:1716
#1 0x0c7c61cb in Tokenizer::GetFirstTokenPosition (this=0x228ce570,
buffer=0x2bfc5f6e L", name, base, class wxARRAY_DEFAULT_EXPORT)", bufferLen=43, key=0x2bfc56ec L"T", keyLen=1)
at G:\Codeblocks\src\plugins\codecompletion\parser\tokenizer.cpp:1928
#2 0x0c7c5c30 in Tokenizer::GetMacroExpandedText (this=0x228ce570, tk=0x2569fc30, expandedText=...)
at G:\Codeblocks\src\plugins\codecompletion\parser\tokenizer.cpp:1843
#3 0x0c7c55a6 in Tokenizer::ReplaceMacroUsage (this=0x228ce570, tk=0x2569fc30)
at G:\Codeblocks\src\plugins\codecompletion\parser\tokenizer.cpp:1665
#4 0x0c7c38ee in Tokenizer::CheckMacroUsageAndReplace (this=0x228ce570)
at G:\Codeblocks\src\plugins\codecompletion\parser\tokenizer.cpp:1089
#5 0x0c7c30c2 in Tokenizer::DoGetToken (this=0x228ce570) at G:\Codeblocks\src\plugins\codecompletion\parser\tokenizer.cpp:966
#6 0x0c7c2e88 in Tokenizer::PeekToken (this=0x228ce570) at G:\Codeblocks\src\plugins\codecompletion\parser\tokenizer.cpp:904
#7 0x0c7b060d in ParserThread::HandleFunction (this=0x228ce568, name=..., isOperator=false, isPointer=false)
at G:\Codeblocks\src\plugins\codecompletion\parser\parserthread.cpp:2463
#8 0x0c7aa705 in ParserThread::DoParse (this=0x228ce568) at G:\Codeblocks\src\plugins\codecompletion\parser\parserthread.cpp:1188
#9 0x0c7ad146 in ParserThread::HandleNamespace (this=0x228ce568)
at G:\Codeblocks\src\plugins\codecompletion\parser\parserthread.cpp:1755
#10 0x0c7aa0aa in ParserThread::DoParse (this=0x228ce568) at G:\Codeblocks\src\plugins\codecompletion\parser\parserthread.cpp:1043
#11 0x0c7a8295 in ParserThread::Parse (this=0x228ce568) at G:\Codeblocks\src\plugins\codecompletion\parser\parserthread.cpp:533
#12 0x0c7d37e2 in ParserThread::Execute (this=0x228ce568) at G:/Codeblocks/src/plugins/codecompletion/parser/parserthread.h:192
#13 0x020264d8 in cbThreadPool::cbWorkerThread::Entry (this=0x226f3e88) at G:\Codeblocks\src\sdk\cbthreadpool.cpp:228
#14 0x645d34d0 in wxThread::CallEntry() () from C:\Windows\system32\wxmsw311u_gcc_custom.dll
#15 0x645d4cc2 in wxThreadInternal::DoThreadStart(wxThread*) () from C:\Windows\system32\wxmsw311u_gcc_custom.dll
#16 0x645d54c3 in wxThreadInternal::WinThreadStart(void*)@4 () from C:\Windows\system32\wxmsw311u_gcc_custom.dll
#17 0x00000000 in ?? ()
There is a new crash in KMP_Find() with revision 11547 and wxwidgets 3.1.1. To reproduce, just open CodeBlocks_wx31.workspace and wait (it happens sometimes, specially when you start compiling just after loading).Thanks for the report, I will try to reproduce this crash tonight.
...
OK, I fixed this bug in trunk r11548. The bug is introduced in rev11545. Though I can't reproduce a crash in my PC, but I think the fix is quite obvious.There is a new crash in KMP_Find() with revision 11547 and wxwidgets 3.1.1. To reproduce, just open CodeBlocks_wx31.workspace and wait (it happens sometimes, specially when you start compiling just after loading).Thanks for the report, I will try to reproduce this crash tonight.
...
Can't say this is related to CodeBlocks but I was running 11543 at the time, and this is a pretty serious error and problem.No, it is not codeblocks.
My Windows 10 pc running my project Blue Screened right when I ran my project's executable from within CodeBlocks using Build->Run.You have hardware or OS/driver problem! User software cannot cause a BSOD on a well working computer! I doubt you're using Windows 98.
..., but I lost a file in the process. It was open in the Code Blocks editor, and after Windows recovered from the blue screen and restarted, the file was empty....
It was open in the Code Blocks editor, and after Windows recovered from the blue screen and restarted, the file was empty. I opened it with a hex editor and discovered it was a bunch of zeros. The entire file contents were wiped out.Also codeblocks uses some special save procedure to prevent exactly this. It saves the file first in a temporary file, copies the temporary file over the old file and then removes the temp file after the copy process was successful. So there is always a valid file with your content on the system if something bad is happening
..., but I lost a file in the process. It was open in the Code Blocks editor, and after Windows recovered from the blue screen and restarted, the file was empty....
For these cases we use backup solutions. In the software development world these are called version control systems. The one which won the battle is called git. Start using it, even for personal projects and you won't have problems like these in the future.
And I probably had several hundred lines of code that were three days old since the last commit.
The file had already been saved I believe, as I was in the process of running the project right after building it.QuoteIt was open in the Code Blocks editor, and after Windows recovered from the blue screen and restarted, the file was empty. I opened it with a hex editor and discovered it was a bunch of zeros. The entire file contents were wiped out.Also codeblocks uses some special save procedure to prevent exactly this. It saves the file first in a temporary file, copies the temporary file over the old file and then removes the temp file after the copy process was successful. So there is always a valid file with your content on the system if something bad is happening
Doing the save-to-temp-and-move prevents problems only if cb crashes. If the os crashes the file could be in the write caches of the os and it could be lost. In theory the journal should handle such cases, but there is always a chance of total failure.I read that the change journal of NTFS is not able to recover old versions of the file.
The problem is not that the file was ever deleted, it was physically overwritten during the blue screen.There are multiple levels of caches, both software and hardware. If the file hasn't been flushed fully to the storage media, there is nothing that would prevent a corruption.
Well I'm screwed then. :/ No temporary file to undelete means no back up copy. Dang. I'd honestly prefer you litter my source directory with temporary deleted files then make it as if they never existed. :/The problem is not that the file was ever deleted, it was physically overwritten during the blue screen.There are multiple levels of caches, both software and hardware. If the file hasn't been flushed fully to the storage media, there is nothing that would prevent a corruption.
C::B deletes the original with a move operation. So after a successful save there is no trace of the temporary file.
Well I'm screwed then. :/ No temporary file to undelete means no back up copy. Dang. I'd honestly prefer you litter my source directory with temporary deleted files then make it as if they never existed. :/Sorry, we're not making a backup software. For such purposes there are better alternatives (like using git and commit every small change you make every hour or two; this have other benefits which a backup solution won't provide).
=================================================================
==27797==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6100011229fc at pc 0x7fffe061e899 bp 0x7fffccd7f070 sp 0x7fffccd7f060
READ of size 4 at 0x6100011229fc thread T11
#0 0x7fffe061e898 in Tokenizer::KMP_Find(wchar_t const*, int, wchar_t const*, int) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/tokenizer.cpp:1716
#1 0x7fffe061f5ee in Tokenizer::GetFirstTokenPosition(wchar_t const*, unsigned long, wchar_t const*, unsigned long) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/tokenizer.cpp:1929
#2 0x7fffe061ef1d in Tokenizer::GetMacroExpandedText(Token const*, wxString&) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/tokenizer.cpp:1843
#3 0x7fffe061e2a6 in Tokenizer::ReplaceMacroUsage(Token const*) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/tokenizer.cpp:1665
#4 0x7fffe061aeb4 in Tokenizer::CheckMacroUsageAndReplace() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/tokenizer.cpp:1089
#5 0x7fffe061a404 in Tokenizer::DoGetToken() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/tokenizer.cpp:966
#6 0x7fffe0619c55 in Tokenizer::PeekToken() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/tokenizer.cpp:904
#7 0x7fffe05eb56a in ParserThread::HandleFunction(wxString&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:2463
#8 0x7fffe05e3630 in ParserThread::DoParse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:1188
#9 0x7fffe05e93ce in ParserThread::HandleClass(ParserThread::EClassType) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:2112
#10 0x7fffe05e25c6 in ParserThread::DoParse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:882
#11 0x7fffe05e0961 in ParserThread::Parse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:533
#12 0x7fffe05c369c in Parser::Parse(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:345
#13 0x7fffe05c8a45 in Parser::ParseFile(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:670
#14 0x7fffe05e6f08 in ParserThread::HandleIncludes() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:1738
#15 0x7fffe05e14e2 in ParserThread::DoParse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:653
#16 0x7fffe05e0961 in ParserThread::Parse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:533
#17 0x7fffe05c369c in Parser::Parse(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:345
#18 0x7fffe05c8a45 in Parser::ParseFile(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:670
#19 0x7fffe05e6f08 in ParserThread::HandleIncludes() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:1738
#20 0x7fffe05e14e2 in ParserThread::DoParse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:653
#21 0x7fffe05e0961 in ParserThread::Parse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:533
#22 0x7fffe05c369c in Parser::Parse(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:345
#23 0x7fffe05c8a45 in Parser::ParseFile(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:670
#24 0x7fffe05e6f08 in ParserThread::HandleIncludes() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:1738
#25 0x7fffe05e14e2 in ParserThread::DoParse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:653
#26 0x7fffe05e0961 in ParserThread::Parse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:533
#27 0x7fffe05c369c in Parser::Parse(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:345
#28 0x7fffe05c8a45 in Parser::ParseFile(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:670
#29 0x7fffe05e6f08 in ParserThread::HandleIncludes() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:1738
#30 0x7fffe05e14e2 in ParserThread::DoParse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:653
#31 0x7fffe05e0961 in ParserThread::Parse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:533
#32 0x7fffe05c369c in Parser::Parse(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:345
#33 0x7fffe05c8a45 in Parser::ParseFile(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:670
#34 0x7fffe05e6f08 in ParserThread::HandleIncludes() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:1738
#35 0x7fffe05e14e2 in ParserThread::DoParse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:653
#36 0x7fffe05e0961 in ParserThread::Parse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:533
#37 0x7fffe05c369c in Parser::Parse(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:345
#38 0x7fffe05c8a45 in Parser::ParseFile(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:670
#39 0x7fffe05e6f08 in ParserThread::HandleIncludes() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:1738
#40 0x7fffe05e14e2 in ParserThread::DoParse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:653
#41 0x7fffe05e0961 in ParserThread::Parse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:533
#42 0x7fffe05c369c in Parser::Parse(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:345
#43 0x7fffe05c8a45 in Parser::ParseFile(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:670
#44 0x7fffe05e6f08 in ParserThread::HandleIncludes() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:1738
#45 0x7fffe05e14e2 in ParserThread::DoParse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:653
#46 0x7fffe05e0961 in ParserThread::Parse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:533
#47 0x7fffe05c369c in Parser::Parse(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:345
#48 0x7fffe05c8a45 in Parser::ParseFile(wxString const&, bool, bool) /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parser.cpp:670
#49 0x7fffe05e6f08 in ParserThread::HandleIncludes() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:1738
#50 0x7fffe05e14e2 in ParserThread::DoParse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:653
#51 0x7fffe05e0961 in ParserThread::Parse() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.cpp:533
#52 0x7fffe05f595c in ParserThread::Execute() /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/parserthread.h:192
#53 0x7ffff1aa05cf (libcodeblocks.so+0x6b35cf)
#54 0x7ffff2978642 in wxThread::CallEntry() ../git/include/wx/thrimpl.cpp:356
#55 0x7ffff2982d55 in wxThreadInternal::PthreadStart(wxThread*) ../git/src/unix/threadpsx.cpp:869
#56 0x7ffff29831d1 in wxPthreadStart ../git/src/unix/threadpsx.cpp:819
#57 0x7ffff083215b (/lib64/libpthread.so.0+0x815b)
#58 0x7ffff05650ae in clone (/lib64/libc.so.6+0x1040ae)
0x6100011229fc is located 0 bytes to the right of 188-byte region [0x610001122940,0x6100011229fc)
allocated by thread T11 here:
#0 0x7ffff6efde60 in operator new(unsigned long) /var/tmp/portage/sys-devel/gcc-6.4.0-r5/work/gcc-6.4.0/libsanitizer/asan/asan_new_delete.cc:60
#1 0x7ffff114e3ae in std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_assign(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) /var/tmp/portage/sys-devel/gcc-8.2.0-r6/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:265
Thread T11 created by T0 here:
#0 0x7ffff6e67448 in __interceptor_pthread_create /var/tmp/portage/sys-devel/gcc-6.4.0-r5/work/gcc-6.4.0/libsanitizer/asan/asan_interceptors.cc:236
#1 0x7ffff297d739 in wxThreadInternal::Create(wxThread*, unsigned int) ../git/src/unix/threadpsx.cpp:1121
SUMMARY: AddressSanitizer: heap-buffer-overflow /home/obfuscated/projects/codeblocks/git/src/plugins/codecompletion/parser/tokenizer.cpp:1716 in Tokenizer::KMP_Find(wchar_t const*, int, wchar_t const*, int)
Shadow bytes around the buggy address:
0x0c208021c4e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c208021c4f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c208021c500: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c208021c510: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c208021c520: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
=>0x0c208021c530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00[04]
0x0c208021c540: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
0x0c208021c550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04
0x0c208021c560: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c208021c570: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c208021c580: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==27797==ABORTING
Is this report from revision 11543? KMP-related routines were fixed in revisions 11544 to 11548.
Got it, revision 11548 corrected the issue in all lines but one. Patch is attached.Fixed in trunk now, thanks!