User forums > Nightly builds

The 30 December 2018 build (11543) is out.

<< < (9/13) > >>

ollydbg:
The crash issue of the KMP algorithm is fixed in trunk now. The "next" array should have the same length as the "pattern" array, so access beyond the array is not allowed.
@Miguel Gimenez  @oBFusCATed
Thanks for the help.

EDIT:
However, there are still some performance issue. For example, for a fixed "pattern" string, we will generate the "next" array many times. :(

Miguel Gimenez:
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).


--- Code: ---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:             {

--- End code ---

Full report is attached.

Windows 7 64 bits

EDIT: running with GDB (previous attempts didn't crash) I get:

text = L")"
textLen = 43
pattern = L"T"
patternLen = 1

textLen seems incorrect.


--- Code: ---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 ?? ()

--- End code ---

ollydbg:

--- Quote from: Miguel Gimenez on January 09, 2019, 01:49:01 pm ---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).
...

--- End quote ---
Thanks for the report, I will try to reproduce this crash tonight.

ollydbg:

--- Quote from: ollydbg on January 09, 2019, 02:54:06 pm ---
--- Quote from: Miguel Gimenez on January 09, 2019, 01:49:01 pm ---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).
...

--- End quote ---
Thanks for the report, I will try to reproduce this crash tonight.

--- End quote ---
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.
You can see the commit message of r11548. Thanks!

Miguel Gimenez:
It works now, thank you for the quick fix.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version