-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gnome crashes on deletion of last entry #173
Comments
I'll be honest, those warnings have been there since forever and I have no idea what causes them. I couldn't repro the shell crash on Gnome 42.9, so maybe this is a Gnome bug? Might be worth filing a ticket with them to see what they say or at least if they know what could cause the PopupMenuItem warnings. |
Well I cannot reproduce the crash anymore, maybe this was a Gnome bug after all. Thanks for your quick response! The rest of the behavior is still weird though: Understanding that, I took a look at your database.log file: What does this file do anyway? Is it for clipboard persistence on restart? Seemingly this file is only flushed once I clear the clipboard history via the trash icon which than handles the extension unusable though as no new entries are added to the clipboard history. |
Hmmm, I think things might be very broken either on the Gnome 46 version of the extension or Gnome 46 itself. All of this works fine on my version.
That file is the entire database, so yeah persistant storage. Old strings are deleted eventually when you've hit a garbage collection threshold. To see this in action, favorite and unfavorite an entry like 500 times lol and it'll trigger. Or copy two entries back and forth. Or hit the space limit... Lots of reasons. Here's a detailed explanation: https://alexsaveau.dev/blog/projects/performance/clipboard/gnome/gch/gnome-clipboard-history |
Hm okay. I’ll keep an eye on updates. Until then, I’ll just use the clear item for the last entry.
Thanks for the explanation and the link to your blog entry. Interesting stuff! Anyways I expected the data to be gone if I deleted it from the entries table. If I copy passwords or alike I do not want to have them stored in a database somewhere after deletion. If I understand it correctly, this would be the case if we would trigger compaction manually. How about a setting to trigger compaction whenever an entry is deleted? How much would that impact performance? On another note, can I trigger the private mode toggle via a command as well or is this only possible via shortcut? If that’s possible maybe I could trigger the private mode automatically before copying an entry from my psw manager |
Yeah, my policy here is that you either need to turn on private mode before copying passwords or accept that whatever is in the clipboard doesn't have any security guarantees.
The problem is that I don't want somebody to be going through deleting multiple items with a large clipboard (say multiple MBs) and everytime they click the button the UI freezes for a bit because we're regenerating a muli MB file. I could add a button somewhere that does compaction. Or maybe if you Ctrl click delete an entry that'll run compaction?
Sadly only via shortcut, though maybe this would work? https://github.com/jordansissel/xdotool#sending-keys You trigger the shortcut via CLI before password copy, then trigger it again to reopen the clipboard. |
Ok, thanks for clarifying.
How about running compaction whenever the dialog / extension window has closed? This would be immediately enough but wouldn’t cause any freezes in the UI.
Thanks! I’ll try to come up with a way. I’m using Wayland so xdotool is not an option but apparently there is a tool called ydotool that does the same and supports Wayland. I’ll give it a try |
This is actually a neat idea. As a side note, when I say freeze the UI, I don't just mean that the extension will freeze: this is Gnome and JavaScript so literally the entire shell will freeze, meaning closing the UI and doing a compaction then will stutter the whole shell. That said, I think in 99% of cases it won't be that bad so I'd be open to a PR which runs compaction after the UI is closed if items were deleted. |
BTW, there's #170 which I totally forgot and neglected. Need to get back to it. |
Isn't there some way to do compaction on a different thread or do Gnome extensions only have access to one thread at a time?
I'm currently quite busy but I'll come back to this at the end of sommer I guess. Thanks for being open to changes! 👍
Sounds promising! KeePassXC is also what I'm using so that'd be great! I'll participate in the conversation over there. |
JavaScript is single threaded so no.
Sweet! |
In web development there are service worker for that case. I thought this might exist for gnome too |
Don't think so unfortunately. |
I’ve taken a look and apparently it is possible to push processes to another thread by using asynchronous methods:
https://gjs.guide/guides/gjs/asynchronous-programming.html#asynchronous-operations There is also a lot of explanation on this page how to prevent freezing of the UI by queuing a process with a low priority. |
I do use async, but that doesn't fix all the code to prepare reads or writes. |
I know that you use it extensively, I’m just trying to understand why it blocks the UI then. Do you have an example? Could this help to make more functions asynchronous? |
I/O is not the problem, compute is. Without a seperate thread at the OS level, there's no fixing it. Specifically, the extension has to parse the log which involves building up a linked list of entries, building forward and reverse maps, and hashing entry for deduplication. That's not cheap when you start pushing 10s of thousands of entries. This is the meat if you're curious: gnome-clipboard-history/store.js Line 114 in c62c89c
|
Describe the bug
When I manually clear all entries from the list, Gnome crashes and my session is restarted.
When deleting single entries errors are logged.
How To Reproduce
DEL
until no entries are left.Additional context (if a crash, provide stack trace)
Log after deletion of a single entry:
Log after deleting the last entries which resulted in a crash of gnome:
The text was updated successfully, but these errors were encountered: