Menu

#629 Control-A, Control-V crashes Code::Blocks

Undefined
fixed
wx30 (74)
Bug_Report
2018-03-14
2018-02-25
No

Steps to reproduce: Copy some text to your clipboard in a different application (such as a terminal). Open a file in Code::Blocks. Press Control-A to select all text. Press Control-V to paste the new text.

In my experience, Code::Blocks pretty reliably crashes, unless the data has been copied from a Code::Blocks editor. For example, Ctrl-A Ctrl-C Ctrl-V does not reproduce this issue. The issue does not require an entire project to be open; a single, plain-text file will have this issue.

In my case, I was copying data out of gnome-terminal.

Related

Tickets: #804
Tickets: #829

Discussion

  • Teodor Petrov

    Teodor Petrov - 2018-02-25

    OS and Codeblocks version please?
    How have you installed codeblock?
    Can you provide a backtrace?

    For me it works perfectly fine...

     
  • Josh @ Dreamland

    Version 17.12; Build: Jan 20, 2018, 10:29:55 - wx3.0.3 (Linux, unicode) - 64 bit

    Installed through Pacman.

    Backtrace: https://pastebin.com/93J88b1e

     
  • Teodor Petrov

    Teodor Petrov - 2018-02-27
    • labels: --> wx30
     
  • Teodor Petrov

    Teodor Petrov - 2018-02-27

    Can you try if the fix from rev11280 fixes the problem for you? I'm not sure it is good idea to use the wxgtk-3 when targeting gtk3. It is hightly untested and as far as I know there are many bugs in wxwidgets 3.0.x when targeting gtk3.

     
  • Josh @ Dreamland

    I built the current SVN trunk (11319), and the issue persists.

    The issue affects a selection of any size, not just the full-page selection.

     
  • Teodor Petrov

    Teodor Petrov - 2018-03-14

    OK, I can reproduce.

    Can you try if the patch below solves the problem for you?

    diff --git a/src/src/main.cpp b/src/src/main.cpp
    index 380749d2d..7cfcb1ed0 100644
    --- a/src/src/main.cpp
    +++ b/src/src/main.cpp
    @@ -4315,10 +4315,10 @@ void MainFrame::OnEditorUpdateUI(CodeBlocksEvent& event)
    
         if (Manager::Get()->GetEditorManager() && event.GetEditor() == Manager::Get()->GetEditorManager()->GetActiveEditor())
         {
    -#if defined(__WXMSW__) && wxCHECK_VERSION(3, 0, 0)
    +#if /*defined(__WXMSW__) &&*/ wxCHECK_VERSION(3, 0, 0)
             // Execute the code to update the status bar outside of the paint event for scintilla.
             // Executing this function directly in the event handler causes redraw problems on Windows.
    -        CallAfter(DoUpdateStatusBar);
    +        CallAfter(&MainFrame::DoUpdateStatusBar);
     #else
             DoUpdateStatusBar();
     #endif // defined(__wxMSW__) && wxCHECK_VERSION(3, 0, 0)
    

    Oh, and gtk3 is so ugly and broken...

     
  • Josh @ Dreamland

    Seems to do the trick. I can no longer reproduce it after applying that patch. Thanks!

    Perhaps I should just build Code::Blocks against GTK2. It's unclear to me why it's built against GTK3 in the official package. I don't have anything nice to say about the GTK3 transition, myself, so I'll leave it at that.

    Cheers

     
  • Teodor Petrov

    Teodor Petrov - 2018-03-14

    Because GTK people wil try to deprecate GTK2 and Arch follows upstream closly, so they've switchted your wxgtk to use GTK3...

     
  • Teodor Petrov

    Teodor Petrov - 2018-03-14
    • status: open --> fixed
    • assigned_to: Teodor Petrov
     
  • Teodor Petrov

    Teodor Petrov - 2018-03-14

    Fixed in trunk.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.