Bug #18634 2012-06-09 18:56

earlgrey

Freeze when opening "/usr/include/gtk+2-.0/gdk/gdkkeysyms.h"

========================= OS =======================================

OS : Debian "squeeze"

2.6.32.38-debian-gwr.01 #1 SMP Sun Oct 16 06:39:52 CEST 2011 x86_64 GNU/Linux

========================= C::B ======================================

svn build rev 8032 (2012-06-05 07:19:34) gcc 4.4.5 Linux/unicode - 64 bit

Build Jun 6 2012 17:55:01 - wx2.8.12 ( Lnux, unicode ) - 64 bits

svn build rev 8032

SDK version 1.13.3

=========================== BUG ===================================

1) Open C::B

2) File -> Open -> "/usr/include/gtk+2-.0/gdk/gdkkeysyms.h"

3) C::B freezes, forcing to kill it.

Same behaviour with or without Code Completion enabled.

Category
Application::Editor
Group
Platform:Linux
Status
Open
Close date
 
Assigned to
ollydbg
ollydbg 2012-06-10 08:59

How do you disable the Code-Completion plugin?

It should be disabled by plugin manager, Thanks.

earlgrey 2012-06-10 10:03

* I used : Settings > Editor > Code Completion > "Disable Code Completion" checkbox

* Disabling then re-enabling CC through the plugin manager first worked ( so I thought it was a ld.so.cache problem, plugins are shared libraries, no ? ), but after one minute the bug re-appeared.

* The bug disappear by disabling CC through the plugin manager - but it is not a satisfactory solution :)

Please also note that this bug was present in the two precedent svn revisions that I got from jens lody apt repository.

Regards

earlgrey 2012-06-10 10:05

Seems that you have got an infinite loop, or more likely a thread lock, somewhere.

ollydbg 2012-06-11 00:37

QUOTE: * The bug disappear by disabling CC through the plugin manager

It looks like there is a infinite loop in the CC's parser.

QUOTE: * I used : Settings > Editor > Code Completion > "Disable Code Completion" checkbox

If I remember correctly, this does not disable the CC correctly.

I need some test code snippet to reproduce the bug(infinite loop).

mortenmacfly 2012-06-11 06:50

I tried on Windows - no problems at all. I also don't see why it should fail, because in this file are only #defines.

Can you provide a sample case, including the exact (!) version of that file through the forums, for example?

earlgrey 2012-06-11 18:02

My version of "gdkkeysyms.h" is at

http://gwr.free.fr/gdkkeysyms.h

earlgrey 2012-06-11 18:28
###################################################################################################
#  I open my workspace, with CC enabled through plugin manager, but disabled from Settigs > Editor > CC
#
#  Immediatly after all files have been opened, I open manually "gdkkeysyms.h" ; and C::B freezes, last message in gdb is 
#  the "[Thread 0x7fffd8e02700 (LWP 16026) exited]" line.
# 
#  Seems to be linux / wx related...
###################################################################################################

(gdb) start
Temporary breakpoint 1 at 0x441570: file app.cpp, line 266.
Starting program: /usr/bin/codeblocks 
[Thread debugging using libthread_db enabled]

Temporary breakpoint 1, main (argc=1, argv=0x7fffffffe718) at app.cpp:266
266	app.cpp: No such file or directory.
	in app.cpp
(gdb) continue
Continuing.
Initialize EditColourSet .....
[New Thread 0x7fffea642700 (LWP 15998)]
[New Thread 0x7fffe9e41700 (LWP 15999)]
[New Thread 0x7fffe9640700 (LWP 16000)]
[New Thread 0x7fffe8e3f700 (LWP 16001)]
Initialize EditColourSet: done.
EnvVars: loaded
Debugger: loaded
OpenFilesList: loaded
ClassWizard: loaded
CB_Koders: loaded
BYOGames: loaded
Autosave: loaded
HelpPlugin: loaded
SpellChecker: loaded
Valgrind: loaded
ToolsPlus: loaded
EditorTweaks: loaded
cbDragScroll: loaded
Cccc: loaded
NassiShneidermanPlugin: loaded
ThreadSearch: loaded
wxSmith: loaded
wxSmithMime: loaded
CodeSnippets: loaded
FilesExtensionHandler: loaded
CppCheck: loaded
wxSmithAui: loaded
DoxyBlocks: loaded
Profiler: loaded
Abbreviations: loaded
lib_finder: loaded
ProjectsImporter: loaded
HeaderFixup: loaded
copystrings: loaded
AutoVersioning: loaded
AStylePlugin: loaded
Compiler: loaded
wxSmithContribItems: loaded
Exporter: loaded
BrowseTracker: loaded
SymTab: loaded
Cscope: loaded
cbKeyBinder: loaded
MouseSap: loaded
ReopenEditor: loaded
RegExTestbed: loaded
CodeCompletion: loaded
ScriptedWizard: loaded
FileManager: loaded
ToDoList: loaded
HexEditor: loaded
CodeStat: loaded
IncrementalSearch: loaded
Environment variables plugin activated
Debugger plugin activated
Open files list plugin activated
Class wizard plugin activated
Koders query plugin activated
BYO Games plugin activated
Autosave plugin activated
Help plugin plugin activated
SpellChecker plugin activated
Valgrind plugin activated
ToolsPlus plugin activated
Editor Tweaks plugin: Building menu
Editor Tweaks plugin: making the menu 14
EditorTweaks plugin activated
DragScroll plugin activated
Cccc plugin activated
NassiShneidermanPlugin plugin activated
ThreadSearch plugin activated
wxSmith plugin activated
wxSmith - MIME plugin plugin activated
Code snippets plugin activated
Files extension handler plugin activated
CppCheck plugin activated
wxSmith - Aui plugin activated
DoxyBlocks plugin activated
Code profiler plugin activated
Abbreviations plugin activated
Library finder plugin activated
Foreign projects importer plugin activated
Header Fixup plugin activated
Copy Strings to clipboard plugin activated
AutoVersioning plugin activated
Source code formatter (AStyle) plugin activated
Added compiler "GNU GCC Compiler"
Added compiler "Intel C/C++ Compiler"
Added compiler "SDCC Compiler"
Added compiler "Tiny C Compiler"
Added compiler "GDC D Compiler"
Added compiler "LLVM D Compiler"
Added compiler "Digital Mars D Compiler"
Added compiler "GNU Fortran Compiler"
Added compiler "G95 Fortran 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
wxSmith - Contrib Items plugin activated
Source Exporter plugin activated
BrowseTracker plugin activated
Symbol Table Plugin plugin activated
Cscope plugin activated
Keyboard shortcuts plugin activated
MouseSap plugin activated
ReopenEditor plugin activated
Regular expressions testbed plugin activated
[New Thread 0x7fffdb48c700 (LWP 16009)]
Code completion plugin activated
Project wizard added for 'Empty project'
Project wizard added for 'Fortran application'
Project wizard added for 'Fortran library'
Project wizard added for 'Fortran DLL'
Project wizard added for 'Console application'
Project wizard added for 'D application'
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 'SFML project'
Project wizard added for 'Static library'
Project wizard added for 'Shared library'
Project wizard added for 'wxWidgets project'
Build-target wizard added for 'Console'
Build-target wizard added for 'Static 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'
Project wizard added for 'MCS51 Project'
File(s) wizard added for 'Empty file'
File(s) wizard added for 'C/C++ source'
File(s) wizard added for 'C/C++ header'
File(s) wizard added for 'Fortran source'
Scripted wizard plugin activated
[New Thread 0x7fffdac8b700 (LWP 16010)]
FileManager plugin activated
Todo List plugin activated
HexEditor plugin activated
Code statistics plugin activated
IncrementalSearch plugin activated

(codeblocks:15810): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GtkRadioMenuItem'

(codeblocks:15810): Gtk-CRITICAL **: gtk_radio_menu_item_get_group: assertion `GTK_IS_RADIO_MENU_ITEM (radio_menu_item)' failed

(codeblocks:15810): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GtkRadioMenuItem'

(codeblocks:15810): Gtk-CRITICAL **: gtk_radio_menu_item_get_group: assertion `GTK_IS_RADIO_MENU_ITEM (radio_menu_item)' failed
Loading toolbar...
Initializing plugins...
[New Thread 0x7fffda48a700 (LWP 16013)]
[Thread 0x7fffda48a700 (LWP 16013) exited]
Updating class browser...
Class browser updated.
Loading workspace "/home/gwr/.codeblocks/gkconfig.workspace"
Loading project file...
Parsing project file...
Loading target Debug
Loading target Release
Loading project files...
37 files loaded
Done loading project in 2ms
Project's base path: /mnt/Clean/gwr/Src/libgwr/
Project's common toplevel path: /mnt/Clean/gwr/Src/libgwr/
Loading project file...
Parsing project file...
Loading target Debug
Loading target Release
Loading project files...
39 files loaded
Done loading project in 7ms
Project's base path: /mnt/Clean/gwr/Src/libkconfig/
Project's common toplevel path: /mnt/Clean/gwr/Src/libkconfig/
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)
Editor Open
Project data set for /mnt/Clean/gwr/Src/libkconfig/src/objects/kconfig-objects-kernel.cc

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed
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)
Editor Open
Project data set for /mnt/Clean/gwr/Src/libkconfig/src/objects/kconfig-objects-item.h

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed
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)
Editor Open
Project data set for /mnt/Clean/gwr/Src/libkconfig/src/objects/kconfig-objects-symbol.h

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed
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)
Editor Open
Project data set for /mnt/Clean/gwr/Src/libkconfig/src/objects/kconfig-objects-containers.h

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed
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)
Editor Open
Project data set for /mnt/Clean/gwr/Src/libkconfig/src/common/kconfig-public.h

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed
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)
Editor Open
Project data set for /mnt/Clean/gwr/Src/libkconfig/src/objects/kconfig-objects-kernel.h

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed
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)
Editor Open
Project data set for /mnt/Clean/gwr/Src/libkconfig/src/common/kconfig-exp.cc

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed
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)
Editor Open
Project data set for /mnt/Clean/gwr/Src/libkconfig/src/objects/kconfig-objects-scalar.cc
Loading project file...
Parsing project file...
Loading target Release
Loading target Debug
Loading project files...
23 files loaded
Done loading project in 2ms
Project's base path: /mnt/Clean/gwr/Src/gkconfig/
Project's common toplevel path: /

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed
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)
Editor Open
Project data set for /mnt/Clean/gwr/Src/gkconfig/src/gkconfig-kernel.h

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed
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)
Editor Open
Project data set for /mnt/Clean/gwr/Src/gkconfig/src/gkconfig-kernel.cc

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed
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)
Editor Open
Project data set for /mnt/Clean/gwr/Src/gkconfig/src/widget/gkconfig-widget-panel-kernel.h

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed
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)
Editor Open
Project data set for /mnt/Clean/gwr/Src/gkconfig/src/widget/gkconfig-widget-panel-kernel.cc

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed
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)
Editor Open
Project data set for /mnt/Clean/gwr/Src/gkconfig/src/widget/gkconfig-widget-panel-kernel-shell.cc

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed
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)
Editor Open
Project data set for /mnt/Clean/gwr/Src/gkconfig/src/widget/gkconfig-widget-panel-kernel-shell-search.cci
Top Editor: /mnt/Clean/gwr/Src/gkconfig/src/widget/gkconfig-widget-panel-kernel-shell-search.cci
libkconfig now depends on libgwr (1 deps)
gkconfig now depends on libgwr (1 deps)
gkconfig now depends on libkconfig (2 deps)
Loading workspace layout "/home/gwr/.codeblocks/gkconfig.workspace.layout"
Project /mnt/Clean/gwr/Src/libkconfig/libkconfig.cbp has been activated.
[New Thread 0x7fffd9c19700 (LWP 16014)]
Caching result of `pkg-config --cflags gtk+-2.0`

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed
Cached
Caching result of `pkg-config gtk+-2.0 --cflags`
Cached
Caching result of `pkg-config gtk+-2.0 --libs`
Cached
Caching GCC dir: /usr/include/c++/4.4
Caching GCC dir: /usr/include/c++/4.4/x86_64-linux-gnu
Caching GCC dir: /usr/include/c++/4.4/backward
Caching GCC dir: /usr/local/include
Caching GCC dir: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include
Caching GCC dir: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed
Caching GCC dir: /usr/include/x86_64-linux-gnu
Caching GCC dir: /usr/include
Passing list of files to batch-parser.
Header to parse with priority: '/usr/include/c++/4.4/cstddef'
Header to parse with priority: '/usr/include/boost/config.hpp'
Header to parse with priority: '/usr/include/boost/filesystem/config.hpp'
Add 3 priority parsing file(s) for project 'libkconfig'...
Added 29 file(s) for project 'libkconfig' to batch-parser...
Create new parser for project 'libkconfig'
Updating class browser...
Class browser updated.
[New Thread 0x7fffda48a700 (LWP 16022)]
Starting batch parsing for project 'libkconfig'...
Project 'libkconfig' parsing stage done!
Project 'libkconfig' parsing stage done (569 total parsed files, 25632 tokens in 0 minute(s), 0.727 seconds).
Updating class browser...
Class browser updated.
[New Thread 0x7fffd9a18700 (LWP 16023)]
Caching result of `pkg-config --libs gtk+-2.0 libglade-2.0`
Cached
Passing list of files to batch-parser.
Header to parse with priority: '/usr/include/c++/4.4/cstddef'
Header to parse with priority: '/usr/include/boost/config.hpp'
Header to parse with priority: '/usr/include/boost/filesystem/config.hpp'
Add 3 priority parsing file(s) for project 'gkconfig'...
Added 12 file(s) for project 'gkconfig' to batch-parser...
Create new parser for project 'gkconfig'
Start switch from OnParsingOneByOneTimer
Switch parser to project 'gkconfig'
Updating class browser...
Class browser updated.
[New Thread 0x7fffd9817700 (LWP 16025)]
Starting batch parsing for project 'gkconfig'...
[Thread 0x7fffda48a700 (LWP 16022) exited]
[New Thread 0x7fffd8e02700 (LWP 16026)]
[New Thread 0x7fffd3fff700 (LWP 16027)]
Project 'gkconfig' parsing stage done!
Project 'gkconfig' parsing stage done (1783 total parsed files, 54687 tokens in 0 minute(s), 2.449 seconds).
Updating class browser...
Class browser updated.
[Thread 0x7fffd3fff700 (LWP 16027) exited]
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)
Editor Open

** (codeblocks:15810): CRITICAL **: clearlooks_style_draw_flat_box: assertion `width >= -1' failed
[Thread 0x7fffd8e02700 (LWP 16026) exited]

### Here gdkkeysyms.h has been opened, and C::B has frozen ###

^C
Program received signal SIGINT, Interrupt.
0x00007ffff20a7ec5 in *__GI___xstat (vers=<value optimized out>, name=<value optimized out>, buf=0x7fffffff9f70) at ../sysdeps/unix/sysv/linux/wordsize-64/xstat.c:38
38	../sysdeps/unix/sysv/linux/wordsize-64/xstat.c: No such file or directory.
	in ../sysdeps/unix/sysv/linux/wordsize-64/xstat.c
Current language:  auto
The current source language is "auto; currently c".

*******************************************************************************************************************************************

(gdb) backtrace
#0  0x00007ffff20a7ec5 in *__GI___xstat (vers=<value optimized out>, name=<value optimized out>, buf=0x7fffffff9f70) at ../sysdeps/unix/sysv/linux/wordsize-64/xstat.c:38
#1  0x00007ffff584944e in wxStat(wchar_t const*, stat*) () from /usr/lib/libwx_baseu-2.8.so.0
#2  0x00007ffff5849f77 in wxDirExists(wchar_t const*) () from /usr/lib/libwx_baseu-2.8.so.0
#3  0x00007ffff58a09d6 in wxDirData::Read(wxString*) () from /usr/lib/libwx_baseu-2.8.so.0
#4  0x00007ffff5838d39 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#5  0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#6  0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#7  0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#8  0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#9  0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#10 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#11 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#12 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#13 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#14 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#15 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#16 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#17 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#18 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#19 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#20 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#21 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#22 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#23 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#24 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#25 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#26 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#27 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#28 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#29 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#30 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#31 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0




earlgrey 2012-06-11 18:30
###################################################################################################
# I am not familar with gdb, so I forgot the rest of the call stack :)
################################################################################################### 

#56 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#57 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#58 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#59 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#60 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#61 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#62 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#63 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
---Type <return> to continue, or q <return> to quit---
#64 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#65 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#66 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#67 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#68 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#69 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#70 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#71 0x00007ffff5838f40 in wxDir::Traverse(wxDirTraverser&, wxString const&, int) const () from /usr/lib/libwx_baseu-2.8.so.0
#72 0x00007fffdc510291 in NativeParser::GetAllPathsByFilename (this=<value optimized out>, filename=<value optimized out>) at nativeparser.cpp:2537
#73 0x00007fffdc4da18f in ClassBrowserBuilderThread::Init (this=0x205a200, np=<value optimized out>, treeTop=<value optimized out>, treeBottom=<value optimized out>, active_filename=<value optimized out>, user_data=0x254dff0, bo=..., tt=0x7fffd40321b0, 
    idThreadEvent=2656) at classbrowserbuilderthread.cpp:116
#74 0x00007fffdc4d34fc in ClassBrowser::ThreadedBuildTree (this=0x2041420) at classbrowser.cpp:856
#75 0x00007fffdc4d4fdd in ClassBrowser::UpdateClassBrowserView (this=0x2041420, checkHeaderSwap=224) at classbrowser.cpp:244
#76 0x00007fffdc514cc2 in NativeParser::OnEditorActivated (this=0x1be8900, editor=<value optimized out>) at nativeparser.cpp:2408
#77 0x00007fffdc4e6414 in CodeCompletion::OnEditorActivatedTimer (this=0x1be8880, event=<value optimized out>) at codecompletion.cpp:2363
#78 0x00007ffff58b4e60 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /usr/lib/libwx_baseu-2.8.so.0
#79 0x00007ffff58b5e24 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from /usr/lib/libwx_baseu-2.8.so.0
#80 0x00007ffff58b5f07 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/libwx_baseu-2.8.so.0
#81 0x00007ffff6254168 in wxTimerBase::Notify() () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#82 0x00007ffff615f5ab in ?? () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#83 0x00007ffff2f51ecb in ?? () from /lib/libglib-2.0.so.0
#84 0x00007ffff2f516f2 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#85 0x00007ffff2f55568 in ?? () from /lib/libglib-2.0.so.0
#86 0x00007ffff2f55a75 in g_main_loop_run () from /lib/libglib-2.0.so.0
#87 0x00007ffff52da6b7 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#88 0x00007ffff61569f8 in wxEventLoop::Run() () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#89 0x00007ffff61dbc2b in wxAppBase::MainLoop() () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#90 0x000000000044186b in CodeBlocksApp::OnRun (this=0x56d23f0) at app.cpp:777
#91 0x00007ffff585b855 in wxEntry(int&, wchar_t**) () from /usr/lib/libwx_baseu-2.8.so.0
#92 0x0000000000441582 in main (argc=1, argv=0x7fffffff9f70) at app.cpp:266
earlgrey 2012-06-11 19:02

Problem is Linux-only related ;

Can be :

- 64 bits glibc or compiler failure

- wx calling glibc with bad params

######################################

(gdb) backtrace

#0 0x00007ffff20a7ec5 in *__GI___xstat (vers=<value optimized out>, name=<value optimized out>, buf=0x7fffffff9f70) at ../sysdeps/unix/sysv/linux/wordsize-64/xstat.c:38

#######################################

Here is the function :

/* Get information about the file NAME in BUF. */

34 int

35 __xstat (int vers, const char *name, struct stat *buf)

36 {

37 if (vers == _STAT_VER_KERNEL || vers == _STAT_VER_LINUX)

38 return INLINE_SYSCALL (stat, 2, name, CHECK_1 (buf));

39

40 __set_errno (EINVAL);

41 return -1;

42 }

Line 38 is IO call, so the bug is an IO lock.

earlgrey 2012-06-12 18:47

What is doing this "//srv" on my Linux box ?

==========================================

37 in ../sysdeps/unix/sysv/linux/wordsize-64/xstat.c

(gdb) print vers

$6 = 1

(gdb) print name

$7 = 0x825cb90 "//srv"

==========================================

Could it be the reason of the freeze ?

earlgrey 2012-06-12 19:50

Sorry, confusion between "//" and "\\"

earlgrey 2012-06-12 20:28

Got it : seems like C::B is scanning recursively my filesystem from "/"

Hope it helps.

ollydbg 2012-06-12 23:56

QUOTE: Got it : seems like C::B is scanning recursively my filesystem from "/"

As you said, CC does not cause this issue. If I remember correct, maybe there are some bug in the path handling in C::B. But sorry I mainly works on Windows system, so I hope some developer under Linux can help you more.

earlgrey 2012-06-14 18:18

> I hope some developer under Linux can help you more.

Maybe me ( C::B was easy to compile ). Can I ask you / C::B developper ( maybe mortenmacfly ) about the purpose of the

================================

"NativeParser::GetAllPathsByFilename()"

================================

method , and what is it supposed to do ?

earlgrey 2012-06-14 18:18

> I hope some developer under Linux can help you more.

Maybe me ( C::B was easy to compile ). Can I ask you / C::B developper ( maybe mortenmacfly ) about the purpose of the

================================

"NativeParser::GetAllPathsByFilename()"

================================

method , and what is it supposed to do ?

earlgrey 2012-06-14 19:39

OK, a cbproject class has a "m_CommonTopLevelPath" member ; and in my project I have :

- files of type "/home/......." ,

- file of type "/mnt/..." ( due of usage of some symlinks )

so logically m_CommonTopLevelPath will be "/", and unfortunately at nativeparser.cpp:2537

=================================================

prjDir.Traverse(traverser, filespec, wxDIR_FILES | wxDIR_DIRS);

=================================================

will therefore scan recursively all my filesystem.

ollydbg 2012-06-15 02:18

QUOTE: will therefore scan recursively all my filesystem.

I think you have found the reason, the first thing I suggest that you can disable the "Enable headers code completion", this will disable the running of header file crawlering.

earlgrey 2012-06-15 18:07
=======================================================================
/** Get the implementation file path if the input is a header file. or Get the header file path
     * if the input is an implementation file.
     * Both the implementation file and header file can be in different directories.
     * @param filename input filename
     * @return corresponding file paths, in wxArrayString format
     */
    wxArrayString GetAllPathsByFilename(const wxString& filename);
=======================================================================

- your tip failed on headers code completion failed ; but it is not so important ; 

- on the other side, <gdkkeysyms.h> does not belong to my project ( I just open it within a debug session ) so it should not have anything to do with the "CommonTopLevelPath" of my cbproject ; right ? 
earlgrey 2012-06-15 18:16

I mean why search gdkkeysyms.c in my project's files, while gdkkeysyms.h does not belong to my project ? ( this is not directly related to the bug )

ollydbg 2012-06-16 02:50

QUOTE- on the other side, <gdkkeysyms.h> does not belong to my project ( I just open it within a debug session ) so it should not have anything to do with the "CommonTopLevelPath" of my cbproject ; right ?

The gdkkeysyms.h does not belong to your project file, but this header file maybe included in your cpp files. I don't think it is related to CommonTopLevelPath.

BTW: Mostly I can't test for you because you are in Linux but I'm mainly under Windows. I hope you can create a sample project file, and attachment to our c::b forum, and some linux guys can test it.

Thanks.

earlgrey 2012-06-16 06:27

-= LAST POST =- :)

- sorry for having been verbose, but I love C::B, use it every single day since I downloaded it :)

- The bug is not Linux-related, neither unix-symlinks related, it is a side-effect of C::B assuming 2 assertions :

* "a cbProject has all of its files under the same directory"

* "this directory contains a reasonable number of files, so we can use wxDir::Traverse() on it"

- Bug should be reproducible under Windows ( unfortunately no svn installer is available, I could not test ) :

* Make a dummy workspace containing a dummy project containing 2 files :

** "/A/dummy.h"

** "/B/dummy.c"

* Open any file from your filesystem in the C::B editor

Well, under Windows, you are "encouraged" to put everything under "C:\Users\user\My Documents", but C::B is said cross-platform, so this is definitely a C::B bug.

- In fact I simply remove my 2 old bash scripts that resided in "/usr/local/bin" from one of my projects, and all is OK now.

- thank you very much for your attention

- Regards to you and all the C::B team.

ollydbg 2012-06-16 13:23

QUOTE:

- Bug should be reproducible under Windows ( unfortunately no svn installer is available, I could not test ) :

* Make a dummy workspace containing a dummy project containing 2 files :

** "/A/dummy.h"

** "/B/dummy.c"

* Open any file from your filesystem in the C::B editor

How can I do this under Windows?

I have a dummy cbp file: E:\code\cb\test_code\dummy\cmd.cbp

and I have two files in this project:

E:\code\A\dummy.h

E:\code\B\dummy.c

But it looks like I have no freeze issue.

earlgrey 2012-06-16 14:30

> E:\code\A\dummy.h

> E:\code\B\dummy.c

At this point cbProject->m_CommonTopLevelPath is "E:\code"

Add

"E:\foo.h"

to your project, so cbProject->m_CommonTopLevelPath is now "E:\"

Then open for example "E:\code\bar.h" in C::B ( bar.h must not belong to your project ), and E: should be scanned recursively.

But if you dont have many files on that partition, you wont have the "long loop" effect.

You can try with :

C:\code1\dummy.h

C:\code2\dummy.c

So cbProject->m_CommonTopLevelPath is "C:\" : in Windows many things are under C:\

And then open "C:\code3\toto.h"

You can put a breakpoint on

===================================================

wxStat(wchar_t const*, stat*) () from /usr/lib/libwx_baseu-2.8.so.0

===================================================

to verify what C::B is doing, that is what I did.

earlgrey 2012-06-16 15:00

More concisely,

> E:\code\A\dummy.h

> E:\code\B\dummy.c

should be :

> E:\A\dummy.h

> E:\B\dummy.c

ollydbg 2012-06-17 01:22

QUOTE:

More concisely,

> E:\code\A\dummy.h

> E:\code\B\dummy.c

should be :

> E:\A\dummy.h

> E:\B\dummy.c

I did that, but still no freeze.

I have E:\code\cb\test_code\dummy\cmd.cbp which contains two files:

E:\A\dummy.h

E:\B\dummy.c

Now, I try to open a file which does not belong this cbp, like: E:\C\a.h

I don't have any freeze when open the a.h file. I'm still not sure which behavior will let c::b to scan all the files under: E:\ ?

Thanks.

earlgrey 2012-06-17 03:51
nativeparser.cpp , line approximatively 2500
=========================================================================================================================

wxArrayString NativeParser::GetAllPathsByFilename(const wxString& filename)
{
    TRACE(_T("NativeParser::GetAllPathsByFilename()"));

    [ ...  ]

        if (project)
        {
            const wxString prjPath = project->GetCommonTopLevelPath();                                                       [ problematic value : "/"  ( or for you, "E:\" ) ]
            wxString priorityPath;
            if (fn.HasExt() && (fn.GetExt().StartsWith(_T("h")) || fn.GetExt().StartsWith(_T("c"))))
            {
                wxFileName priFn(prjPath);
                priFn.AppendDir(fn.GetExt().StartsWith(_T("h")) ? _T("sdk") : _T("include"));
                if (priFn.DirExists())                                                                                                                                [ m_CommonTopLevelPath/sdk or m_CommonTopLevelPath/include search ]
                {

                  [ ... ]

                }
            }

            if (dirs.IsEmpty())
            {
                wxDir prjDir(prjPath);                                                                                                        [ prjDir is "/"  ( or for you, "E:\" ) ]
                if (prjDir.IsOpened())
                {
                    wxArrayString others;
                    NativeParserHelper::ParserDirTraverser traverser(priorityPath, others);
                    prjDir.Traverse(traverser, filespec, wxDIR_FILES | wxDIR_DIRS);                       [ Here is the long wait, wxDIR_DIR flag implies recursive scan ]
                    if (others.GetCount() == 1)
                        AddPaths(dirs, others[0], fn.HasExt());
                }
            }
        }
    }

    if (!files.IsEmpty())
        AddPaths(dirs, files[0], fn.HasExt());

    return dirs;
}
=========================================================================================================================
earlgrey 2012-06-17 04:49

> I don't have any freeze when open the a.h file.

How many files have you under "E:\" ?

> I'm still not sure which behavior will let c::b to scan all the files under: E:\ ?

This is the right way to reproduce the bug

OK, I will look at building rev 8032 under win7.

ollydbg 2012-06-17 05:24

Quote: nativeparser.cpp , line approximatively 2500 ...

This file is in the sources of Code-Completion plugin, so If you disable the Code-Completion plugin (from the plugin manager panel), I believe there is no freeze. In fact I think the freeze was caused by the header file crawler.

Quote:How many files have you under "E:\" ?

I have a lot of files under E:\, which is much much larger then C:\

I will look into this issue. (debug the NativeParser::GetAllPathsByFilename related code). Thanks you!!!

earlgrey 2012-06-17 07:34

As wxDir::Traverse() is based on callbacks on Traversers, maybe the win32 implementation uses "overlapped IO" wether the Linux impl uses blocking IO ?

ollydbg 2012-06-17 12:35
I debugged, and found that:
            const wxString prjPath = project->GetCommonTopLevelPath();
            wxString priorityPath;
            if (fn.HasExt() && (fn.GetExt().StartsWith(_T("h")) || fn.GetExt().StartsWith(_T("c"))))
            {
                wxFileName priFn(prjPath);
                priFn.AppendDir(fn.GetExt().StartsWith(_T("h")) ? _T("sdk") : _T("include"));
                if (priFn.DirExists())

Here, the prjPath="E:\\"
and the prjFn="E"
and the if(prjFn.DirExists()) is false, so this if clause does not get any chance to run.
ollydbg 2012-06-17 12:39

Forgot to say: there:

priFn has such values:

[debug]{m_volume = "E", m_dirs = 1 count of wxArrayString = {[0] = 0x4041044 L"sdk"}, m_name = "", m_ext = "", m_relative = false, m_hasExt = false}>>>>>>cb_gdb:

and if (priFn.DirExists()) is false.

earlgrey 2012-06-17 14:05

- The bug is not Linux-related, neither unix-symlinks related, it is a side-effect of C::B assuming 2 assertions :

* "a cbProject has all of its files under the same directory"

* "this directory contains a reasonable number of files, so we can use wxDir::Traverse() on it"

This is usual practice in coding, but you know end-users ( like me ) are a pain :)

=> The "CommonTopLevelPath concept" is broken.

ollydbg 2012-06-17 14:17
        /** @return the top-level path common to all project files. */
        wxString GetCommonTopLevelPath() const;

Its logic is OK. It do return the root folder "/" in your cases, but I think some plugins don't use this function correctly. (like the code-completion plugin).

In fact, the freeze only happens in the code-completion plugin, right?
earlgrey 2012-06-17 14:41

Me > The "CommonTopLevelPath concept" is broken !

You > Its logic is OK !

Anyway this is minor side effect, easy to correct. So thank you for your answers.

Regards again to all the C::B Team.