CodeLite 9.2 crashes in «Keyboard Shortcuts» dialog when a key is pressed #1483

Closed
al-mission-2016 opened this Issue Nov 25, 2016 · 10 comments

Projects

None yet

3 participants

@al-mission-2016

Description.
IDE always collapses (Segmentation fault) when I press a key to set a filter in
Menu->Settings->Keyboard Shortcuts Dialog, when Filter field is focused (receives keyboard input).

My system:
Distro: Linux Mint 18 Sarah, Kernel: 4.4.0-45-generic x86_64, Cinnamon 3.0.7
CodeLite ver. 9.2 was installed from the Linux Mint repository (9.2-1unofficial.xenial).

Comment:
Presumably the bug is lurking somewhere in the code in
CodeLite/LiteEditor/acceltabledlg.cpp::
void AccelTableDlg::PopulateTable(const wxString& filter);

In particular key-press event leads to invocation of AccelTableDlg::PopulateTable(…):

void AccelTableDlg::OnText(wxCommandEvent& event)
{
    wxUnusedVar(event);
    PopulateTable(m_textCtrlFilter->GetValue());
}

@eranif
Owner
eranif commented Nov 26, 2016

Do you get this crash with 9.2.7?
You can get it from here: https://forums.codelite.org/viewtopic.php?f=20&t=3539

@al-mission-2016
al-mission-2016 commented Nov 26, 2016 edited

Yes, the same crash with 9.2.7 (b.t.w. I've tested IDE on another machine with the same ver. of Linux Mint 18).

A hint. When I paste some long string (into Filter field) and then delete one letter after another there is no crash until the rest of the string matches something in associations. E.g. the string "edit111" does not crash, but "edit" does, i.e. probably it happens when PopulateTable() puts non-zero data into wxDataViewCtrl* m_dataview. (?)

@dghart
Collaborator
dghart commented Nov 27, 2016

Hi,
I confirm that this happens in ubuntu too, both 16.04 and 16.10; and it happens with CodeLite git HEAD built with either wx3.0.2 or 3.1.0. It also happens if you start adding a shortcut and then cancel it.

However it doesn't happen in debian jessie, fedora 25 or openSUSE 42.2.

When it does crash, the backtrace is not very helpful:
0 0x00000000008b2986 KeyboardAcceleModel::GetParent .../codelite-9.2-260-gf6725e6/LiteEditor/keyboardaccelemodel.cpp 78
1 0x00007ffff6501e19 wxDataViewCtrlInternal_FindParentNode .../src/gtk/dataview.cpp 4192
2 0x00007ffff6505048 wxDataViewCtrlInternal::FindParentNode .../src/gtk/dataview.cpp 4244
3 0x00007ffff65063c3 wxDataViewCtrlInternal::iter_next .../src/gtk/dataview.cpp 3874
4 0x00007fffe61929d5 ??
5 0x00007fffe6192ad8 ??
6 0x00007fffe6192ad8 ??
7 0x00007fffe6192ad8 ??
8 0x00007fffe6192ad8 ??
9 0x00007fffe6192ad8 ??
10 0x00007fffe6192ad8 ??
11 0x00007fffe6192ad8 ??
...
for about 50k frames. So it's not really CodeLite code that's the problem. It might be wxWidgets or a library that it calls, or it might be a timing issue somewhere. It's certainly beyond my ability to debug :(

@eranif
Owner
eranif commented Nov 28, 2016 edited

@dghart what are the steps to reproduce this?
I can't make it crash here

@al-mission-2016

To reproduce it one only need to

  1. open Menu->Settings->Keyboard Shortcuts Dialog
  2. press any alpha-numerical key
    (note that focus is by default on filter text field)
@eranif
Owner
eranif commented Nov 28, 2016

No crash... it just works.
Just tested this on Ubuntu 16.04, Debian Jessie and Ubuntu 14.04

What happens if you do this:

  • Close CodeLite
  • Rename or delete the folder ~/.codelite
  • Start CodeLite

Does it still crash?

@dghart
Collaborator
dghart commented Nov 28, 2016

To reproduce it one only need to
open Menu->Settings->Keyboard Shortcuts Dialog
press any alpha-numerical key

That doesn't work for me. I never get crashes without first showing, then closing, the Edit Shortcut dialog.

Eran, I've tested with clean ~/.codelites and it still happens.

@al-mission-2016

Alas, refreshing CodeLite (now v9.2.7) with removing config ~/.condelite does not help. It is still miraculously disappearing (crashes).
Yea, it is not easy to catch a black bug in a dark room... :)

@eranif
Owner
eranif commented Nov 29, 2016

I am not able to assist you as I am not able to reproduce this.
Hopefully, @dghart will be able to debug this and provide some insight

@eranif eranif pushed a commit that closed this issue Dec 14, 2016
Eran Ifrah Simplified the "Keyboard shortcuts" dialog.
    Fixes: #1483
6901ebc
@eranif eranif closed this in 6901ebc Dec 14, 2016
@eranif
Owner
eranif commented Dec 14, 2016

I was able to reproduce this with a later version of wxWidgets (does not happen with my current version of wxWidgets). This is a bug in wxWidgets that can not be fixed by CodeLite, instead, I had to redesign this dialog to avoid the calls to the crashing methods. Hopefully, this is now fixed now

Please confirm :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment