Author Topic: Is CC crash, or Debugger plugin?  (Read 73077 times)

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Is CC crash, or Debugger plugin?
« on: June 09, 2011, 08:09:51 am »
Do you have the CC tooltips activated? Most of the time the crashes happen there.
Sometimes it happens, when I debug something, move the mouse over a variable and it crashes. Somewhere in AddToken.
It happens on complex projects: my work project, C::B debuggers branch. It is very rare crash, but it is quite annoying :(

Sometimes it happens, when I debug something, move the mouse over a variable and it crashes.
Do you enable the option: "Compiler and debugger settings > Debugger settings > Evaluate expression under cursor"  ?


Yes, I always have it enabled.

Somebody has same issue about this?
We need more information.
:)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Is CC crash, or Debugger plugin?
« Reply #1 on: June 09, 2011, 08:20:57 am »
what is the exact steps to product the crash???
I don't have such crash when debugging, if the debugee crashed, you can at least see the debug-log message.
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: Is CC crash, or Debugger plugin?
« Reply #2 on: June 09, 2011, 08:38:17 am »
what is the exact steps to product the crash???
I don't have such crash when debugging, if the debugee crashed, you can at least see the debug-log message.
Hi, ollydbg, Do you remember the option: "Compiler and debugger settings > Debugger settings > Evaluate expression under cursor".
If use this option, there will random crash when debug any project.
So, you tell me, just shut off the option?
About A year ago... :D

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Is CC crash, or Debugger plugin?
« Reply #3 on: June 09, 2011, 08:40:24 am »
At that time, we are rewriting CC.
So, this issue should existed on Code::Blocks 10.5 official release.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Is CC crash, or Debugger plugin?
« Reply #4 on: June 09, 2011, 08:50:17 am »
I suggest you turn off that option "Compiler and debugger settings > Debugger settings > Evaluate expression under cursor", because when the mouse hover a variable which is not initialized.(e.g. an un-initialized std::vector), then gdb will crash. :D
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: Is CC crash, or Debugger plugin?
« Reply #5 on: June 09, 2011, 09:31:15 am »
I suggest you turn off that option "Compiler and debugger settings > Debugger settings > Evaluate expression under cursor", because when the mouse hover a variable which is not initialized.(e.g. an un-initialized std::vector), then gdb will crash. :D
At the same time, CC doing buffer parsing for local variable.
And should add the token to the temp tokens-tree.
So, If you turn off the option, the crash should been gone.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Is CC crash, or Debugger plugin?
« Reply #6 on: June 09, 2011, 10:20:20 am »
Loaden: The debugger plugin runs in the main thread and has no access to the CC data structures.
The backtrace points to AddToken in the CC plugin, so it is definitely CC crash.
And this crash happens during code editing, too.

I'll give you the backtrace the next time it happens. At the moment I'm on linux debugger's branch head.
(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 Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Is CC crash, or Debugger plugin?
« Reply #7 on: June 09, 2011, 10:47:34 am »
Loaden: The debugger plugin runs in the main thread and has no access to the CC data structures.
The backtrace points to AddToken in the CC plugin, so it is definitely CC crash.
And this crash happens during code editing, too.

I'll give you the backtrace the next time it happens. At the moment I'm on linux debugger's branch head.
In sometimes, I don't believe GDB's backtrace.
So, I am tried MSVC's Debugger, but CB can't compile with MSVC, or can't work.
In many times, the GDB's backtrace is not useful.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Is CC crash, or Debugger plugin?
« Reply #8 on: June 09, 2011, 11:19:20 am »
1. The backtrace is from the build in crash handler in C::B, not GDB.
2. GDB on linux is totally different beast to GDB on windows
3. The backtrace looks pretty normal, no strange things in it.
(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 Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Is CC crash, or Debugger plugin?
« Reply #9 on: June 09, 2011, 12:57:10 pm »
1. The backtrace is from the build in crash handler in C::B, not GDB.
2. GDB on linux is totally different beast to GDB on windows
3. The backtrace looks pretty normal, no strange things in it.

OK, Please try the latest reversion, at least rev7188.
If you catch any thing, please post here.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Is CC crash, or Debugger plugin?
« Reply #10 on: June 09, 2011, 01:11:13 pm »
I'm on the branch and have to wait for the next merge.
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Is CC crash, or Debugger plugin?
« Reply #11 on: June 09, 2011, 01:26:23 pm »
If I have such crash, I will report it here. :D
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Is CC crash, or Debugger plugin?
« Reply #12 on: June 09, 2011, 04:46:13 pm »
Crashed again, head of debugger's branch built with --enable-debug.
I've attached both a crash report generated by C::B and backtrace for all threads taken from gdb.

Happy debugging  8)
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Is CC crash, or Debugger plugin?
« Reply #13 on: June 20, 2011, 05:56:42 pm »
Loaden: The crash is not fixed with the locker changes you've made recently. I'm using debuggers branch r7245.
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Is CC crash, or Debugger plugin?
« Reply #14 on: June 30, 2011, 12:15:15 pm »
And a deadlock here:

Code
(gdb) bt
#0  0x0000003afd60d4c4 in __lll_lock_wait () from /lib64/libpthread.so.0
#1  0x0000003afd608e1a in _L_lock_1034 () from /lib64/libpthread.so.0
#2  0x0000003afd608cdc in pthread_mutex_lock () from /lib64/libpthread.so.0
#3  0x0000003b954fa3e9 in wxMutexInternal::Lock (this=<value optimized out>) at ./src/unix/threadpsx.cpp:248
#4  0x00002aaab2eff2de in CodeCompletion::ParseFunctionsAndFillToolbar (this=0x1ad22d20, force=<value optimized out>) at /usr/include/wx-2.8/wx/thread.h:271
#5  0x0000003b954fcbff in wxEvtHandler::ProcessEventIfMatches (entry=<value optimized out>, handler=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1239
#6  0x0000003b954fcd9f in wxEventHashTable::HandleEvent (this=<value optimized out>, event=<value optimized out>, self=<value optimized out>) at ./src/common/event.cpp:906
#7  0x0000003b954fcee9 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1301
#8  0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#9  0x0000003b954fd3d0 in wxEvtHandler::ProcessPendingEvents (this=<value optimized out>) at ./src/common/event.cpp:1196
#10 0x0000003b9546214e in wxAppConsole::ProcessPendingEvents (this=<value optimized out>) at ./src/common/appbase.cpp:294
#11 0x0000003b90a723d6 in wxAppBase::ProcessIdle (this=<value optimized out>) at ./src/common/appcmn.cpp:435
#12 0x0000003b909cd99f in wxapp_idle_callback () at ./src/gtk/app.cpp:213
#13 0x0000003b9242cdb4 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#14 0x0000003b9242fc0d in ?? () from /lib64/libglib-2.0.so.0
#15 0x0000003b9242ff1a in g_main_loop_run () from /lib64/libglib-2.0.so.0
#16 0x0000003b958b88ca in gtk_dialog_run () from /usr/lib64/libgtk-x11-2.0.so.0
#17 0x0000003b90a5a7ba in wxMessageDialog::ShowModal (this=<value optimized out>) at ./src/gtk/msgdlg.cpp:117
#18 0x00002ac1b5e13228 in cbMessageBox (message=..., caption=..., style=256, parent=<value optimized out>, x=-1, y=-1) at globals.cpp:1219
#19 0x00002aaab2ef56f6 in CodeCompletion::OnGotoDeclaration (this=0x1ad22d20, event=...) at codecompletion.cpp:2800
#20 0x0000003b954fcbff in wxEvtHandler::ProcessEventIfMatches (entry=<value optimized out>, handler=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1239
#21 0x0000003b954fcd9f in wxEventHashTable::HandleEvent (this=<value optimized out>, event=<value optimized out>, self=<value optimized out>) at ./src/common/event.cpp:906
#22 0x0000003b954fcee9 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1301
#23 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#24 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#25 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#26 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#27 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#28 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#29 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#30 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#31 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#32 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#33 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#34 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#35 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#36 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#37 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#38 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#39 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#40 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#41 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#42 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#43 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#44 0x0000003b90af8b46 in wxWindowBase::TryParent (this=<value optimized out>, event=<value optimized out>) at ./src/common/wincmn.cpp:2661
#45 0x0000003b954fce90 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1314
#46 0x0000003b954fce80 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1308
#47 0x0000003b90af8b46 in wxWindowBase::TryParent (this=<value optimized out>, event=<value optimized out>) at ./src/common/wincmn.cpp:2661
#48 0x0000003b954fce90 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1314
#49 0x0000003b90af8b46 in wxWindowBase::TryParent (this=<value optimized out>, event=<value optimized out>) at ./src/common/wincmn.cpp:2661
#50 0x0000003b954fce90 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1314
#51 0x00002aaab4ce42f4 in wxMenuCmd::Exec (this=<value optimized out>, origin=0x1b8b0fa0, client=0x1b8b0fa0) at menuutils.cpp:543
#52 0x00002aaab4cda9d2 in wxKeyBinder::OnChar (this=0x1b144070, event=..., next=0x1b8b0fa0) at keybinder.cpp:1429
#53 0x0000003b954fcbff in wxEvtHandler::ProcessEventIfMatches (entry=<value optimized out>, handler=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1239
#54 0x0000003b954fcd9f in wxEventHashTable::HandleEvent (this=<value optimized out>, event=<value optimized out>, self=<value optimized out>) at ./src/common/event.cpp:906
#55 0x0000003b954fcee9 in wxEvtHandler::ProcessEvent (this=<value optimized out>, event=<value optimized out>) at ./src/common/event.cpp:1301
#56 0x0000003b909f8ef6 in gtk_window_key_press_callback (widget=<value optimized out>, gdk_event=<value optimized out>, win=<value optimized out>) at ./src/gtk/window.cpp:1034
#57 0x0000003b9592ffcd in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
#58 0x0000003b8f80b08a in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#59 0x0000003b8f81b2ed in ?? () from /lib64/libgobject-2.0.so.0
#60 0x0000003b8f81c516 in g_signal_emit_valist () from /lib64/libgobject-2.0.so.0
#61 0x0000003b8f81c923 in g_signal_emit () from /lib64/libgobject-2.0.so.0
#62 0x0000003b95a2d79e in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
#63 0x0000003b95a3b7fb in gtk_window_propagate_key_event () from /usr/lib64/libgtk-x11-2.0.so.0
#64 0x0000003b95a3e57b in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
#65 0x0000003b9592ffcd in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
#66 0x0000003b8f80b08a in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#67 0x0000003b8f81b8e6 in ?? () from /lib64/libgobject-2.0.so.0
#68 0x0000003b8f81c516 in g_signal_emit_valist () from /lib64/libgobject-2.0.so.0
#69 0x0000003b8f81c923 in g_signal_emit () from /lib64/libgobject-2.0.so.0
#70 0x0000003b95a2d79e in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
#71 0x0000003b95929785 in gtk_propagate_event () from /usr/lib64/libgtk-x11-2.0.so.0
#72 0x0000003b9592a6d1 in gtk_main_do_event () from /usr/lib64/libgtk-x11-2.0.so.0
#73 0x0000003b9304689c in ?? () from /usr/lib64/libgdk-x11-2.0.so.0
#74 0x0000003b9242cdb4 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#75 0x0000003b9242fc0d in ?? () from /lib64/libglib-2.0.so.0
#76 0x0000003b9242ff1a in g_main_loop_run () from /lib64/libglib-2.0.so.0
#77 0x0000003b9592aa63 in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0
#78 0x0000003b909e456d in wxEventLoop::Run (this=<value optimized out>) at ./src/gtk/evtloop.cpp:76
#79 0x0000003b90a72378 in wxAppBase::MainLoop (this=<value optimized out>) at ./src/common/appcmn.cpp:312
#80 0x000000000043d09b in CodeBlocksApp::OnRun (this=0x1ad2b450) at app.cpp:788
#81 0x0000003b95499cc1 in wxEntry (argc=<value optimized out>, argv=<value optimized out>) at ./src/common/init.cpp:448
#82 0x000000000043b342 in main (argc=1, argv=0x80) at app.cpp:260

Latest debugger branch, on a simple project...
(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!]