Code::Blocks Forums

User forums => Help => Topic started by: s5unty on January 12, 2007, 04:11:05 am

Title: pure virtual method called
Post by: s5unty on January 12, 2007, 04:11:05 am
Settings -> Editor -> Keyboard shortcuts, I need to remove Ctrl-Space which be used to complete code. But after doing that and exit Code::Blocks, I got some errors like this:
>pure virtual method called
>terminate called without an active exception
>忽略 (core dumped)

kubuntu 6.10
Nightly builds CB_20070108_rev3466_Ubuntu6.06.deb

Thanx and forget my poor english.
Title: Re: pure virtual method called
Post by: Der Meister on January 12, 2007, 01:08:49 pm
I can't reproduce this here with revision 3479 on gentoo Linux (wxGTK 2.6.2, gcc 4.1.1).
Title: Re: pure virtual method called
Post by: s5unty on January 13, 2007, 11:24:42 am
I found the error message "pure virtual method called" was disappeard after I use the version 3480 which by checkout and compile/build, although I can't remove the keyboard shortcut "Ctrl+Space" which used to "Code Complete". and I found there is a bug: Open Settings -> Editor -> Keyboard shortcuts, choose any selection in the Command Listbox. for instance, select File -> open. after that, click the highlighted item from Current shortcuts Listbox, will change it to unselected state. The core dump will be occured by click Remove Button right now.
Title: Re: pure virtual method called
Post by: Der Meister on January 13, 2007, 11:45:13 am
Yes, I can reproduce this one. Here is the backtrace for this crash:
Code
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1232185680 (LWP 8344)]
0xb44499ba in wxKeyConfigPanel::OnRemoveKey (this=0x8d40aa0) at keybinder.h:353
353                     if (updateMnu) Update();
(gdb) bt                       
#0  0xb44499ba in wxKeyConfigPanel::OnRemoveKey (this=0x8d40aa0)
    at keybinder.h:353         
#1  0xb754338b in wxAppConsole::HandleEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#2  0xb75e52f8 in wxEvtHandler::ProcessEventIfMatches ()
   from /usr/lib/libwx_baseu-2.6.so.0
#3  0xb75e559d in wxEventHashTable::HandleEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#4  0xb75e5710 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#5  0xb788d138 in wxWindowBase::TryParent ()
   from /usr/lib/libwx_gtk2u_core-2.6.so.0
#6  0xb75e56b9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#7  0xb77d9902 in wxButton::wxCreateObject ()
   from /usr/lib/libwx_gtk2u_core-2.6.so.0
#8  0xb6e7af4a in g_cclosure_marshal_VOID__VOID ()
   from /usr/lib/libgobject-2.0.so.0
#9  0xb6e6c2d5 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#10 0xb6e7e673 in g_signal_chain_from_overridden ()
   from /usr/lib/libgobject-2.0.so.0
#11 0xb6e7f8a0 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#12 0xb6e7fd09 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#13 0xb6f7565c in gtk_button_clicked () from /usr/lib/libgtk-x11-2.0.so.0
#14 0xb6f77179 in gtk_button_set_alignment () from /usr/lib/libgtk-x11-2.0.so.0
#15 0xb6e7af4a in g_cclosure_marshal_VOID__VOID ()
   from /usr/lib/libgobject-2.0.so.0
#16 0xb6e6a515 in g_value_set_boxed () from /usr/lib/libgobject-2.0.so.0
#17 0xb6e6c2d5 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#18 0xb6e7e81f in g_signal_chain_from_overridden ()
   from /usr/lib/libgobject-2.0.so.0
#19 0xb6e7f8a0 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#20 0xb6e7fd09 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#21 0xb6f756df in gtk_button_released () from /usr/lib/libgtk-x11-2.0.so.0
#22 0xb6f75730 in gtk_button_released () from /usr/lib/libgtk-x11-2.0.so.0
#23 0xb7038ef2 in gtk_marshal_BOOLEAN__VOID ()
   from /usr/lib/libgtk-x11-2.0.so.0
#24 0xb6e6a515 in g_value_set_boxed () from /usr/lib/libgobject-2.0.so.0
#25 0xb6e6c555 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#26 0xb6e7e9d8 in g_signal_chain_from_overridden ()
   from /usr/lib/libgobject-2.0.so.0
#27 0xb6e7f662 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#28 0xb6e7fd09 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#29 0xb713aec0 in gtk_widget_get_default_style ()
   from /usr/lib/libgtk-x11-2.0.so.0
#30 0xb7032f9d in gtk_propagate_event () from /usr/lib/libgtk-x11-2.0.so.0
#31 0xb7033fc2 in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
#32 0xb729113b in gdk_add_client_message_filter ()
   from /usr/lib/libgdk-x11-2.0.so.0
#33 0xb6ddfc6a in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#34 0xb6de049b in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#35 0xb6de0835 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#36 0xb703441c in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#37 0xb778260b in wxEventLoop::Run () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#38 0xb77e552c in wxDialog::ShowModal ()
   from /usr/lib/libwx_gtk2u_core-2.6.so.0
#39 0xb7cab4cc in EditorManager::Configure (this=0x82e5648)
    at editormanager.cpp:270
#40 0x0807c9b7 in MainFrame::OnSettingsEditor (this=0x8a73ac8,
    event=@0xbfeebf30) at main.cpp:3507
#41 0xb754338b in wxAppConsole::HandleEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#42 0xb75e52f8 in wxEvtHandler::ProcessEventIfMatches ()
   from /usr/lib/libwx_baseu-2.6.so.0
#43 0xb75e560a in wxEventHashTable::HandleEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#44 0xb75e5710 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#45 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#46 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#47 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#48 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#49 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#50 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#51 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#52 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#53 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#54 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#55 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#56 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#57 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#58 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#59 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#60 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#61 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#62 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#63 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#64 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#65 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#66 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#67 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#68 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#69 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#70 0xb75e56a9 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#71 0xb77f2d96 in wxMenuItem::~wxMenuItem ()
   from /usr/lib/libwx_gtk2u_core-2.6.so.0
#72 0xb6e7af4a in g_cclosure_marshal_VOID__VOID ()
   from /usr/lib/libgobject-2.0.so.0
#73 0xb6e6c2d5 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#74 0xb6e7e3b2 in g_signal_chain_from_overridden ()
   from /usr/lib/libgobject-2.0.so.0
#75 0xb6e7f8a0 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#76 0xb6e7fd09 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#77 0xb713edbe in gtk_widget_activate () from /usr/lib/libgtk-x11-2.0.so.0
#78 0xb7044fcc in gtk_menu_shell_activate_item ()
   from /usr/lib/libgtk-x11-2.0.so.0
#79 0xb704645a in gtk_menu_shell_append () from /usr/lib/libgtk-x11-2.0.so.0
#80 0xb703e7bf in gtk_menu_reorder_child () from /usr/lib/libgtk-x11-2.0.so.0
#81 0xb7038ef2 in gtk_marshal_BOOLEAN__VOID ()
   from /usr/lib/libgtk-x11-2.0.so.0
#82 0xb6e6a515 in g_value_set_boxed () from /usr/lib/libgobject-2.0.so.0
#83 0xb6e6c2d5 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#84 0xb6e7e9d8 in g_signal_chain_from_overridden ()
   from /usr/lib/libgobject-2.0.so.0
#85 0xb6e7f662 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#86 0xb6e7fd09 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#87 0xb713aec0 in gtk_widget_get_default_style ()
   from /usr/lib/libgtk-x11-2.0.so.0
#88 0xb7032f9d in gtk_propagate_event () from /usr/lib/libgtk-x11-2.0.so.0
#89 0xb7033fc2 in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
#90 0xb729113b in gdk_add_client_message_filter ()
   from /usr/lib/libgdk-x11-2.0.so.0
#91 0xb6ddfc6a in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#92 0xb6de049b in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#93 0xb6de0835 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#94 0xb703441c in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#95 0xb778260b in wxEventLoop::Run () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#96 0xb780f09a in wxAppBase::MainLoop ()
   from /usr/lib/libwx_gtk2u_core-2.6.so.0
#97 0xb780e8d1 in wxAppBase::OnRun () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#98 0x08068b85 in CodeBlocksApp::OnRun (this=0x8115080) at app.cpp:580
#99 0xb7585f2a in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#100 0xb7585fd2 in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#101 0x08066f10 in main (argc=Cannot access memory at address 0x0
) at app.cpp:188

Edit:
I think I found the problem and already have a patch. I could not test it yet but if it works I will post it here and probably upload it to berlios.
Title: Re: pure virtual method called
Post by: Der Meister on January 13, 2007, 01:44:26 pm
OK, I found and solved the problem and posted the patch at berlios. (Look here (https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=1821&group_id=5358).)

Although keybinder tries to disable the remove button whenever there is no shortcut selected it fails in one situation: If someone just deselects the selected shortcut the buttons are not updated because deselection an item does not create an event, or at least not the EVT_LISTBOX event (and there seems to be no other event that could be generated in this situation). That way the Remove-button stays enabled. Then if you click it wxKeyConfigPanel::OnRemoveKey will be called with an invalid parameter. My patch simply adds a check to the event handler for the button which checks if there is any shortcut selected. If yes it calls wxKeyConfigPanel::OnRemoveKey as usual, if no it simply returns and does nothing. I tested it here with revision 3479 and it seems to work.
Title: Re: pure virtual method called
Post by: Pecan on January 13, 2007, 02:08:23 pm
OK, I found and solved the problem and posted the patch at berlios. (Look here (https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=1821&group_id=5358).)

Thank you. I'll attend to that today.
Title: Re: pure virtual method called
Post by: Pecan on January 13, 2007, 05:55:18 pm
Fixed SVN 3482

I'm unable to reproduce the described Ctrl-space problem either on MSWindows or andLinux.

I added Ctrl-space to the "About" menu item. It also deleted ok.