[go: up one dir, main page]

Menu

#161 Crash from edit history dialog

Development_Version
open
nobody
None
5
2021-11-28
2021-11-17
Ian
No
  1. Edit a history item from the menu and change the text
  2. Clear the history (alt-C)
  3. Press OK to save the new text
    parcellite crashes attempting to free an invalid pointer element->data in edit_selected(). The element data from before the edit dialog is no longer valid.
1 Attachments

Discussion

  • rickyrockrat

    rickyrockrat - 2021-11-19

    Ian, I see a bunch of bug reports from you. Can you build the head and verify you can duplicate it? I've fixed a few since 1.2.1, and I can't duplicate this one. Did you mean 3. Press OK to delete the history? The steps to duplicate are not clear to me. Thanks.

     
  • Ian

    Ian - 2021-11-19

    I started with 1.2.1, but can also reproduce with a fresh build.

    To reproduce, click OK to clear the history, then click OK to save the edited clipboard.

    Running this many times, I see that it doesn't always crash immediately. Sometimes there is an invalid pointer left and the crash occurs a little later.

    If I comment in some of the tracing, I see messages like:

    ele!null. Free 0x60f8973972a0 ''
    free(): invalid pointer
    
     
  • rickyrockrat

    rickyrockrat - 2021-11-19

    Your instructions still don't make sense to me. Generally, you open the history with a hot key, edit an entry, then click OK. At the point you edit the entry, the history dialog goes away.
    When you click OK after entering, you have to bring the history up, then clear it.

    Please give me a detailed, key-by-key sequence. I do not know of a way to
    Edit history, change the text, then while the edit dialog is up, clear the history. I do have a modal issue with the dialogs that I still need to fix in that parcellite will lock up if you have an edit window up and you hit the hot key for the history.

     
  • Ian

    Ian - 2021-11-21

    I can get the history menu up from the icon. Might depend on whether you have a generic trayicon or an appindicator, or maybe just luck. The hotkey does tend to lock up the whole application, generally not nice to try working with Gtk while the main loop is blocked by gtk_run_dialog(). The icon isn't a true Gtk widget so you can manage a few simple things, but opening too many menus will make it also lock up.

    1. Left click on the icon.
    2. Right click or alt-E to get the edit dialog.
    3. Left click on the icon again, history menu appears.
    4. alt-C, then click OK to clear the history.
    5. Modify the item in the edit dialog and click OK.
    6. Crash from invalid pointer as shown at line 875.
     
  • Ian

    Ian - 2021-11-23

    Still playing with this. If I shorten the clipboard entry in the edit dialog, it tends not to crash. Instead, I get messages with garbage such as:
    Try to add 'loa'
    ele!null. Free 0x5f04d0787140 '��l�_'

    If I make the entry in the edit dialog longer, then it seems like it always crashes when I hit OK to save it (after having cleared the history with the edit dialog open).

     
  • Ian

    Ian - 2021-11-28

    So I tried some other desktops this weekend. The only combination that let me get as far as clearing the history with the edit dialog open was openbox with tint2. Other desktops allow the right-click menu while the dialog is open, but hang almost immediately with any attempt to use the left-click history menu, including with the hotkey. I think trying to grab the focus in the menu popup particularly provokes gtk.

    So I tried the clear_all command through fifo_cmd. Despite the double-free when saving the edited clipboard, it was much more resilient and usually didn't immediately crash. Opening menus started to cause more corruptions. I see messages like this, and sometimes a crash:

    Try to add 'echo hello world'
    ele!null. Free 0x628851ad8980 ''
    double free or corruption (out)
    

    Taking it further, I could provoke the same crashes without any icon at all. Just use the hotkey to access the clipboard edit dialog. Using the hotkey in no-icon mode, it was almost impossible to open the history menu with the dialog open, even in openbox. Just an immediately lockup.

     

Log in to post a comment.