Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Contributions to C::B => Topic started by: Simbaba on February 27, 2013, 04:48:48 pm

Title: open one header file always crush, need help!
Post by: Simbaba on February 27, 2013, 04:48:48 pm
I want write a plugin for notepad++.

Firstly,reference the demo code.

But when open the "Notepad_plus_msgs.h" file, the codeblocks IDE crushed!

Title: Re: open one header file always crush, need help!
Post by: Jenna on February 27, 2013, 05:23:04 pm
I can confirm this on windows.
It seems to be the ToDoListView that crashes.
Can you please try it with ToDoList-plugin disabled ?
Title: Re: open one header file always crush, need help!
Post by: MortenMacFly on February 27, 2013, 09:26:50 pm
...works for me under Windows. ToDoList (basically all) plugin(s) enabled.
Title: Re: open one header file always crush, need help!
Post by: jarod42 on February 28, 2013, 10:45:05 am
Crash here too (C::B 12.11, win) (all plugins enable).
but I can open the file if it is not in the project.
Title: Re: open one header file always crush, need help!
Post by: Simbaba on February 28, 2013, 01:32:26 pm
I can confirm this on windows.
It seems to be the ToDoListView that crashes.
Can you please try it with ToDoList-plugin disabled ?

Thanks, that's it!
Title: Re: open one header file always crush, need help!
Post by: Simbaba on February 28, 2013, 01:33:40 pm
Crash here too (C::B 12.11, win) (all plugins enable).
but I can open the file if it is not in the project.

So am i. ;D
Title: Re: open one header file always crush, need help!
Post by: Simbaba on February 28, 2013, 04:29:25 pm
Accidental found that under the C:\CodeBlocks directory, a file "codeblocks.RPT",as following:

-------------------

Error occured on Thursday, February 28, 2013 at 20:53:19.

C:\CodeBlocks\codeblocks.exe caused an Access Violation at location 6bacfc45 in module C:\CodeBlocks\share\codeblocks\plugins\todo.dll Reading from location 038eb000.

Registers:
eax=00000000 ebx=000043d0 ecx=000057fe edx=038e0004 esi=00ca0f78 edi=0022df28
eip=6bacfc45 esp=0022dc30 ebp=0022dd78 iopl=0         nv up ei pl nz na pe cy
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010203

Call stack:
6BACFC45  C:\CodeBlocks\share\codeblocks\plugins\todo.dll:6BACFC45
6BAD0EE8  C:\CodeBlocks\share\codeblocks\plugins\todo.dll:6BAD0EE8
617E083E  C:\CodeBlocks\codeblocks.dll:617E083E  _ZN8cbEditor17DoInitializationsERK8wxStringP10LoaderBase
63090FC7  C:\CodeBlocks\share\codeblocks\plugins\FileManager.dll:63090FC7
Title: Re: open one header file always crush, need help!
Post by: Simbaba on February 28, 2013, 04:30:47 pm
I want to debug this bug, but don't know how on windows ;D
Title: Re: open one header file always crush, need help!
Post by: Jenna on March 01, 2013, 06:54:40 pm
Can anybody, who gets the crash, test the attached patch.

The cause for the crash seems to be the headerguard at the last line, which has a comment, that starts with NOTE (a keyword for the todolist), and the fact, that there is no line after it, so there is no linefeed (or carriage-return) and the plugin tries to read beyond the buffers length.
Title: Re: open one header file always crush, need help!
Post by: Simbaba on March 06, 2013, 12:43:07 pm
i will, but if dll file would be better.
Title: Re: open one header file always crush, need help!
Post by: Simbaba on March 06, 2013, 03:24:31 pm
Met much trouble, if each plugin has CBP project would be better!

Luckily, all resolved.

Jens's Patch seemly resolve the crush problem.