Author Topic: Crash with Cut/Copy-Paste (Linux)  (Read 4755 times)

Offline artoj

  • Almost regular
  • **
  • Posts: 206
  • Location: Supporting my team
    • http://ajonsson.kapsi.fi/
Crash with Cut/Copy-Paste (Linux)
« on: July 05, 2006, 09:14:43 pm »
Hello,

I'm having a weird problem with C::B on my Linux system. The system is Ubuntu Dapper with latest patches, wxWidgets 2.6.3 Unicode with Patch 2, C::B revision 2689 Unicode.

Create a new file (File - New), save it to some location, write "aaaa aaaaaaa" to the file. Select the line and press Ctrl+X (or Edit-Cut), Ctrl+V (or Edit-Paste) and C::B crashes. You can change the "a" character to whatever you want.

The error on my system is:
Code
*** glibc detected *** free(): invalid next size (fast): 0x08d079c8 ***

I debugged C::B with GDB and I got the following:
Code
GNU gdb 6.4-debian
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".

(gdb) run
Starting program: /usr/local/bin/codeblocks
[Thread debugging using libthread_db enabled]
[New Thread -1228740928 (LWP 20580)]
[New Thread -1244910672 (LWP 20660)]
[New Thread -1253303376 (LWP 20661)]
[New Thread -1261696080 (LWP 20662)]
[New Thread -1270088784 (LWP 20663)]
[New Thread -1281762384 (LWP 20664)]
[New Thread -1297417296 (LWP 20669)]
[New Thread -1297683536 (LWP 20670)]
[Thread -1297683536 (LWP 20670) exited]

Program received signal SIGABRT, Aborted.
[Switching to Thread -1228740928 (LWP 20580)]
0xffffe410 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb74549a1 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb74562b9 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb748887a in __fsetlocking () from /lib/tls/i686/cmov/libc.so.6
#4  0xb748efd4 in malloc_usable_size () from /lib/tls/i686/cmov/libc.so.6
#5  0xb748f34a in free () from /lib/tls/i686/cmov/libc.so.6
#6  0xb788068d in selection_handler () from /usr/local/lib/libwx_gtk2u-2.6.so.0
#7  0xb70e3fb4 in _gtk_marshal_VOID__BOXED_UINT_UINT ()
   from /usr/lib/libgtk-x11-2.0.so.0
#8  0xb6de779f in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#9  0xb6df62ea in g_signal_stop_emission () from /usr/lib/libgobject-2.0.so.0
#10 0xb6df7b19 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#11 0xb6dfb030 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#12 0xb712480e in _gtk_selection_notify () from /usr/lib/libgtk-x11-2.0.so.0
#13 0xb7124a72 in gtk_selection_convert () from /usr/lib/libgtk-x11-2.0.so.0
#14 0xb788050b in wxClipboard::GetData ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#15 0xb7358e7b in ScintillaWX::Paste (this=0x8d66968)
    at src/ScintillaWX.cpp:444
#16 0xb7383dee in Editor::WndProc (this=0x8d66968, iMessage=2179, wParam=0,
    lParam=0) at src/scintilla/src/Editor.cxx:5739
#17 0xb740b52d in ScintillaBase::WndProc (this=0x8d66968, iMessage=0,
    wParam=0, lParam=0) at src/scintilla/src/ScintillaBase.cxx:709
#18 0xb7356324 in ScintillaWX::WndProc (this=0x8d66968, iMessage=2179,
    wParam=6, lParam=0) at src/ScintillaWX.cpp:668
#19 0xb735af4b in wxScintilla::SendMsg (this=0x0, msg=0, wp=0, lp=0)
    at src/wxscintilla.cpp:195
#20 0xb735d71f in wxScintilla::Paste (this=0x0) at src/wxscintilla.cpp:1288
#21 0xb7d170bb in cbEditor::Paste (this=0x0) at cbeditor.cpp:1463
#22 0x08078fd2 in MainFrame::OnEditPaste (this=0x8320090, event=@0xbfabd4d0)
    at main.cpp:2128
#23 0xb77c7a2d in wxAppConsole::HandleEvent ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#24 0xb7853a79 in wxEvtHandler::ProcessEventIfMatches ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#25 0xb7853c50 in wxEventHashTable::HandleEvent ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#26 0xb7854201 in wxEvtHandler::ProcessEvent ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#27 0xb78541a7 in wxEvtHandler::ProcessEvent ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#28 0xb78541a7 in wxEvtHandler::ProcessEvent ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#29 0xb78541a7 in wxEvtHandler::ProcessEvent ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#30 0xb78541a7 in wxEvtHandler::ProcessEvent ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#31 0xb78541a7 in wxEvtHandler::ProcessEvent ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#32 0xb78541a7 in wxEvtHandler::ProcessEvent ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#33 0xb78541a7 in wxEvtHandler::ProcessEvent ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#34 0xb78541a7 in wxEvtHandler::ProcessEvent ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#35 0xb78541a7 in wxEvtHandler::ProcessEvent ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#36 0xb78541a7 in wxEvtHandler::ProcessEvent ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#37 0xb78541a7 in wxEvtHandler::ProcessEvent ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#38 0xb78541a7 in wxEvtHandler::ProcessEvent ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#39 0xb78ff865 in gtk_menu_clicked_callback ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#40 0xb6df3423 in g_cclosure_marshal_VOID__VOID ()
   from /usr/lib/libgobject-2.0.so.0
#41 0xb6de779f in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#42 0xb6df62ea in g_signal_stop_emission () from /usr/lib/libgobject-2.0.so.0
#43 0xb6df7b19 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#44 0xb6df7e89 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#45 0xb71c4288 in gtk_widget_can_activate_accel ()
   from /usr/lib/libgtk-x11-2.0.so.0
#46 0xb6de779f in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#47 0xb6df62ea in g_signal_stop_emission () from /usr/lib/libgobject-2.0.so.0
#48 0xb6df7886 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#49 0xb6df7e89 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#50 0xb701084b in gtk_accel_group_activate () from /usr/lib/libgtk-x11-2.0.so.0
#51 0xb701109b in gtk_accel_groups_activate ()
   from /usr/lib/libgtk-x11-2.0.so.0
#52 0xb71d86af in gtk_window_activate_key () from /usr/lib/libgtk-x11-2.0.so.0
#53 0xb71d8709 in gtk_window_activate_key () from /usr/lib/libgtk-x11-2.0.so.0
#54 0xb70e28f0 in _gtk_marshal_BOOLEAN__BOXED ()
   from /usr/lib/libgtk-x11-2.0.so.0
#55 0xb6de716f in g_cclosure_new_swap () from /usr/lib/libgobject-2.0.so.0
#56 0xb6de779f in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#57 0xb6df69ce in g_signal_stop_emission () from /usr/lib/libgobject-2.0.so.0
#58 0xb6df7886 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#59 0xb6df7e89 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#60 0xb71c4dbf in gtk_widget_activate () from /usr/lib/libgtk-x11-2.0.so.0
#61 0xb70e1179 in gtk_propagate_event () from /usr/lib/libgtk-x11-2.0.so.0
#62 0xb70e147b in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
#63 0xb72eadec in _gdk_events_queue () from /usr/lib/libgdk-x11-2.0.so.0
#64 0xb6d758d6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#65 0xb6d78996 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#66 0xb6d78cb8 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#67 0xb70e0775 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#68 0xb7893c54 in wxEventLoop::Run () from /usr/local/lib/libwx_gtk2u-2.6.so.0
#69 0xb791c7f7 in wxAppBase::MainLoop ()
   from /usr/local/lib/libwx_gtk2u-2.6.so.0
#70 0xb791c8db in wxAppBase::OnRun () from /usr/local/lib/libwx_gtk2u-2.6.so.0
#71 0x08065485 in CodeBlocksApp::OnRun (this=0x0) at app.cpp:478
#72 0xb77fc4e4 in wxEntry () from /usr/local/lib/libwx_gtk2u-2.6.so.0
#73 0xb77fc59a in wxEntry () from /usr/local/lib/libwx_gtk2u-2.6.so.0
#74 0x08063b52 in main (argc=1, argv=0x0) at app.cpp:126

If I copy the text from another application and then paste it to C::B, no problems occur.

Unicode problem perhaps?

Offline artoj

  • Almost regular
  • **
  • Posts: 206
  • Location: Supporting my team
    • http://ajonsson.kapsi.fi/
Re: Crash with Cut/Copy-Paste (Linux)
« Reply #1 on: July 05, 2006, 11:08:10 pm »
It seems this has already been posted to Berlios. I'll try to look more carefully next time.

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: Crash with Cut/Copy-Paste (Linux)
« Reply #2 on: July 06, 2006, 09:13:41 pm »
I can't reproduce this with revision 2699, gcc 3.4.6, wxGTK 2.6.2 (unicode) on Linux.
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.