Author Topic: CC's new bug, SVN6049, XPSP3  (Read 27870 times)

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
CC's new bug, SVN6049, XPSP3
« on: January 05, 2010, 12:33:45 pm »
Operation steps:
1. Create a new C + + project
2. Add # include <vector>
3. In the main function, define a variable: vector <int> v;
4. The next line, enter the 'v.', at the point, after there has been no intelligence tips.
5. Close the current project, and then re-open this project.
6. Repeat step 4, and all normal!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CC's new bug, SVN6049, XPSP3
« Reply #1 on: January 05, 2010, 02:35:22 pm »
To handle the STL in later gccs (4.0+) C::B needs a patch to be applied (I think).
Also I think, CC does parse only save sources not the once you've just typed (latest patches could have fixed this though)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: CC's new bug, SVN6049, XPSP3
« Reply #2 on: January 05, 2010, 02:38:56 pm »
can not reproduce it.
can you turn debugSmartSense on and post the output here?
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: CC's new bug, SVN6049, XPSP3
« Reply #3 on: January 05, 2010, 02:54:28 pm »
3. In the main function, define a variable: vector <int> v;
4. The next line, enter the 'v.', at the point, after there has been no intelligence tips.
Notice that you'll need to save the file for CC to "know" about the newly added code fragments. CC does only know what's been saved.

To handle the STL in later gccs (4.0+) C::B needs a patch to be applied (I think).
Nope, not anymore. This is working fine in SVN trunk meanwhile... soon to be in scintilla / wxpropgrid_debugger branch, too.

can not reproduce it.
Me not, either. Working just fine here... however, I saved before. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: CC's new bug, SVN6049, XPSP3
« Reply #4 on: January 05, 2010, 02:57:20 pm »
Quote
Me not, either. Working just fine here... however, I saved before. Wink

I even don't save the file ,just keep typing. :P
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: CC's new bug, SVN6049, XPSP3
« Reply #5 on: January 05, 2010, 03:11:01 pm »
I can confirm this issue, if I start with an empty project (even with saving the file, reparsing and whatever).

If I start a console-project with the wizard and add vector to the includes it works without error (without saving).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: CC's new bug, SVN6049, XPSP3
« Reply #6 on: January 05, 2010, 03:19:51 pm »
I can confirm this issue, if I start with an empty project (even with saving the file, reparsing and whatever).
So an empty project with no file, then you create a new (cpp) file and add it to the project?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: CC's new bug, SVN6049, XPSP3
« Reply #7 on: January 05, 2010, 03:29:40 pm »
Quote
I can confirm this issue, if I start with an empty project (even with saving the file, reparsing and whatever).

confirm it.

Quote
So an empty project with no file, then you create a new (cpp) file and add it to the project?

yes.

I check out the search process output ,it seem that the vector can not be found.
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: CC's new bug, SVN6049, XPSP3
« Reply #8 on: January 05, 2010, 03:32:37 pm »
I can confirm this issue, if I start with an empty project (even with saving the file, reparsing and whatever).
So an empty project with no file, then you create a new (cpp) file and add it to the project?
Exactly.
Then I type literally the same as in the console-project.
Even the main-function is not shown in symbols-browser, until I manually start the reparsing (saving is not enough).

I just noticed that his does not happen, if I have just started C::B, but create a new project if another one is loaded.

Next thing: I just closed the first created project and tried the cc in the secondly created one (only this project is open at this moment) and C::B crashed !

Output from debug report:

Code
    <frame level="0"/>
    <frame level="1" function="TokensTree::FindTokensInFile(wxString const&amp;, std::set&lt;int, std::less&lt;int&gt;, std::allocator&lt;int&gt; &gt;&amp;, short)" offset="00000111"/>
    <frame level="2" function="Parser::FindTokensInFile(wxString const&amp;, std::set&lt;int, std::less&lt;int&gt;, std::allocator&lt;int&gt; &gt;&amp;, short)" offset="000000b9"/>
    <frame level="3" function="NativeParser::FindCurrentFunctionStart(cbEditor*, wxString*, wxString*, int)" offset="0000015a"/>
    <frame level="4" function="NativeParser::FindCurrentFunctionToken(cbEditor*, std::set&lt;int, std::less&lt;int&gt;, std::allocator&lt;int&gt; &gt;&amp;, int)" offset="000000df"/>
    <frame level="5" function="NativeParser::ParseFunctionArguments(cbEditor*, int)" offset="0000010d"/>
    <frame level="6" function="NativeParser::MarkItemsByAI(std::set&lt;int, std::less&lt;int&gt;, std::allocator&lt;int&gt; &gt;&amp;, bool, bool, bool, int)" offset="0000018f"/>
    <frame level="7" function="CodeCompletion::CodeComplete()" offset="00000174"/>
    <frame level="8" function="CodeCompletion::OnCodeCompleteTimer(wxTimerEvent&amp;)" offset="00000068"/>
    <frame level="9" function="wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&amp;, wxEvtHandler*, wxEvent&amp;)" offset="00000050"/>
    <frame level="10" function="wxEventHashTable::HandleEvent(wxEvent&amp;, wxEvtHandler*)" offset="000000a4"/>
    <frame level="11" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="000000c7"/>
    <frame level="12" function="wxTimerBase::Notify()" offset="00000068"/>
    <frame level="13"/>
    <frame level="14"/>
    <frame level="15" function="g_main_context_dispatch" offset="0000024a"/>
    <frame level="16"/>
    <frame level="17" function="g_main_loop_run" offset="000001bd"/>
    <frame level="18" function="gtk_main" offset="000000a7"/>
    <frame level="19" function="wxEventLoop::Run()" offset="00000048"/>
    <frame level="20" function="wxAppBase::MainLoop()" offset="0000004b"/>

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: CC's new bug, SVN6049, XPSP3
« Reply #9 on: January 05, 2010, 04:00:56 pm »
I can confirm this issue, if I start with an empty project (even with saving the file, reparsing and whatever).
So an empty project with no file, then you create a new (cpp) file and add it to the project?
Exactly.
[...]
Next thing: I just closed the first created project and tried the cc in the secondly created one (only this project is open at this moment) and C::B crashed !
Although I cannot reproduce both (it really works here!) I've submitted a possible bug-fix for the crash.

For the reproduction:
Is it possible that you provide a dumb-ass step-by-step instruction for me?
I created an empty project, then an empty (new) source file (lala.cpp) which I added to the targets of the project. When I typed in the vector stuff everything CC'ed just fine. including std:: and v..

Please notice that a file that does not belong to a project might indeed have issues when trying to CC a STL header as this is probably not known to CC as the include path's are missing. Please double-check if the file is really a file with a valid C++ extension and is really added to the empty project.

For the crash I probably did something wrong... it is not clear to me...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: CC's new bug, SVN6049, XPSP3
« Reply #10 on: January 05, 2010, 05:17:17 pm »
Unwork in svn 6055 too.
Quote
Initialize EditColourSet .....
Initialize EditColourSet: done.
Loading toolbar...
AStylePlugin: loaded
Autosave: loaded
BrowseTracker: loaded
Cccc: loaded
ClassWizard: loaded
CodeCompletion: loaded
CodeSnippets: loaded
CodeStat: loaded
Compiler: loaded
CppCheck: loaded
Debugger: loaded
FilesExtensionHandler: loaded
HelpPlugin: loaded
cbKeyBinder: loaded
OpenFilesList: loaded
ProjectsImporter: loaded
ScriptedWizard: loaded
ThreadSearch: loaded
ToDoList: loaded
wxSmith: loaded
wxSmithMime: loaded
wxSmithAui: loaded
wxSmithContribItems: loaded
WindowsXPLookNFeel: loaded
Source code formatter (AStyle) plugin activated
Autosave plugin activated
BrowseTracker plugin activated
Cccc plugin activated
Class wizard plugin activated
Code completion plugin activated
Code snippets plugin activated
Code statistics plugin activated
Added compiler "GNU GCC Compiler"
Parsing stage done (0 total parsed files, 0 tokens in 0 minute(s), 0.0 seconds).
Updating class browser...
Class browser updated.
Added compiler "Microsoft Visual C++ Toolkit 2003"
Added compiler "Microsoft Visual C++ 2005/2008"
Added compiler "Borland C++ Compiler (5.5, 5.82)"
Added compiler "Digital Mars Compiler"
Added compiler "OpenWatcom (W32) Compiler"
Added compiler "GNU GCC Compiler for MSP430"
Added compiler "Cygwin GCC"
Added compiler "LCC Compiler"
Added compiler "Intel C/C++ Compiler"
Added compiler "SDCC Compiler"
Added compiler "Tiny C Compiler"
Added compiler "GDC D Compiler"
Added compiler "Digital Mars D Compiler"
Added compiler "GNU ARM GCC Compiler"
Added compiler "GNU AVR GCC Compiler"
Added compiler "GNU GCC Compiler for PowerPC"
Added compiler "GNU GCC Compiler for TriCore"
Compiler plugin activated
CppCheck plugin activated
Debugger plugin activated
Files extension handler plugin activated
Help plugin plugin activated
Keyboard shortcuts plugin activated
Foreign projects importer plugin activated
Project wizard added for 'Empty project'
Project wizard added for 'Console application'
Project wizard added for 'D application'
Project wizard added for 'Direct/X project'
Project wizard added for 'Dynamic Link Library'
Project wizard added for 'Kernel Mode Driver'
Project wizard added for 'FLTK project'
Project wizard added for 'GLFW project'
Project wizard added for 'GLUT project'
Project wizard added for 'GTK+ project'
Project wizard added for 'Irrlicht project'
Project wizard added for 'Lightfeather project'
Project wizard added for 'Matlab project'
Project wizard added for 'OpenGL project'
Project wizard added for 'Ogre project'
Project wizard added for 'Code::Blocks plugin'
Project wizard added for 'QT4 project'
Project wizard added for 'SDL project'
Project wizard added for 'SmartWin project'
Project wizard added for 'Static library'
Project wizard added for 'STL port application'
Project wizard added for 'Shared library'
Project wizard added for 'Win32 GUI project'
Project wizard added for 'wxWidgets project'
Build-target wizard added for 'Console'
Build-target wizard added for 'Static library'
Build-target wizard added for 'Dynamic Link Library'
Build-target wizard added for 'wxWidgets'
Project wizard added for 'ARM Project'
Project wizard added for 'AVR Project'
Project wizard added for 'TriCore Project'
Project wizard added for 'PowerPC Project'
File(s) wizard added for 'Empty file'
File(s) wizard added for 'C/C++ source'
File(s) wizard added for 'C/C++ header'
Scripted wizard plugin activated
ThreadSearch plugin activated
Todo List plugin activated
wxSmith plugin activated
wxSmith - MIME plugin plugin activated
wxSmith - Aui plugin activated
wxSmith - Contrib Items plugin activated
Initializing plugins...
0 user templates loaded
Caching internal gcc dirs for adding to parser...
Caching GCC dir: d:\LoveDEV\lib\gcc\mingw32\4.4.1\include\c++
Caching GCC dir: d:\LoveDEV\lib\gcc\mingw32\4.4.1\include\c++\mingw32
Caching GCC dir: d:\LoveDEV\lib\gcc\mingw32\4.4.1\include\c++\backward
Caching GCC dir: d:\LoveDEV\lib\gcc\mingw32\4.4.1\include
Caching GCC dir: d:\LoveDEV\lib\gcc\mingw32\4.4.1\include-fixed
Caching GCC dir: d:\LoveDEV\include
Add project ddd in parsing queue
Project's base path: D:\Projects\ddd\
Project's common toplevel path: D:\Projects\ddd\
Passing list of files to batch-parser.
Batch-parsing 1 files...
Passing list of files to batch-parser.
Batch-parsing 1 files...
Starting batch parsing...
Text seems to be pure ASCII!
We use user specified encoding: Unicode 8 bit (UTF-8) (ID: 41)
Final encoding detected: Unicode 8 bit (UTF-8) (ID: 41)
Parsing stage done (137 total parsed files, 28673 tokens in 0 minute(s), 2.422 seconds).
Updating class browser...
Class browser updated.
Reparsing saved files...
Starting batch parsing...
Parsing stage done (152 total parsed files, 29144 tokens in 0 minute(s), 0.125 seconds).
Updating class browser...
Class browser updated.
Reparsing saved files...
Starting batch parsing...
Parsing stage done (152 total parsed files, 29144 tokens in 0 minute(s), 0.94 seconds).
Updating class browser...
Class browser updated.
Reparsing saved files...
Starting batch parsing...
Parsing stage done (152 total parsed files, 29144 tokens in 0 minute(s), 0.0 seconds).
Updating class browser...
Class browser updated.
Reparsing saved files...
Starting batch parsing...
Parsing stage done (152 total parsed files, 29144 tokens in 0 minute(s), 0.0 seconds).
Updating class browser...
Class browser updated.

[attachment deleted by admin]
« Last Edit: January 05, 2010, 05:22:19 pm by Loaden »

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: CC's new bug, SVN6049, XPSP3
« Reply #11 on: January 05, 2010, 06:09:21 pm »
rev6056 still not working.
I built an open-source project for the portable version of CB maintenance.
Address: http://code.google.com/p/portablecb/

You can use this version for testing:http://portablecb.googlecode.com/files/LoveDEV_SVN6056.exe

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: CC's new bug, SVN6049, XPSP3
« Reply #12 on: January 06, 2010, 02:16:47 am »
Operation steps:
1. Create a new C + + project
2. Add # include <vector>
3. In the main function, define a variable: vector <int> v;
4. The next line, enter the 'v.', at the point, after there has been no intelligence tips.
5. Close the current project, and then re-open this project.
6. Repeat step 4, and all normal!

I can not reproduce this.
When you create a new C++ project. I have already one cpp file in the project. some thing like below:

Code
#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

Then adding some code as you said.(I don't save that file)
Code
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    vector <int> v;
    v.
    cout << "Hello world!" << endl;
    return 0;
}
you can see the screen shot below:
So, it seems I can't reproduce this bug. :D
windowsXP SVN rev 6056.


[attachment deleted by admin]
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: CC's new bug, SVN6049, XPSP3
« Reply #13 on: January 06, 2010, 02:20:15 am »
@Loaden.
What is your macro replacement map contains?
You can view them in

Settings->Editor->CodeCompletion and Symbols browser

then in the "C/C++ parser", see the "replacement tokens" list.

You should have several entries.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: CC's new bug, SVN6049, XPSP3
« Reply #14 on: January 06, 2010, 02:58:34 am »
@Loaden.
What is your macro replacement map contains?
You can view them in

Settings->Editor->CodeCompletion and Symbols browser

then in the "C/C++ parser", see the "replacement tokens" list.

You should have several entries.
Only one item.


[attachment deleted by admin]