Skip to content
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

Copying search result filenames causes crash #2781

Closed
metaisfacil opened this issue Dec 9, 2023 · 9 comments
Closed

Copying search result filenames causes crash #2781

metaisfacil opened this issue Dec 9, 2023 · 9 comments
Labels
Milestone

Comments

@metaisfacil
Copy link

metaisfacil commented Dec 9, 2023

Nicotine+ version: Latest unstable
Operating System/Distribution:
Windows 10

Describe the bug

Selecting a file in downloads, uploads, or searches and pressing Ctrl+C to copy the file name to clipboard will immediately crash the program.

Expected behavior

Filename should be copied to clipboard. The program should not crash.

Steps to reproduce the bug

  1. Perform any search, or switch to either the "Downloads" or "Uploads" tab.
  2. Expand any folder in the chosen list, then select one of its files.
  3. Press Ctrl+C.

Additional context

Screenshots, logs, stacktraces or relevant information.

@metaisfacil metaisfacil added the bug label Dec 9, 2023
@slook
Copy link
Member

slook commented Dec 10, 2023

Cannot replicate on Linux (GTK3) using the reproducer steps provided.

What sort of crash is it silent or is there a Critical Error dialog with a stack trace?

@metaisfacil
Copy link
Author

Silent crash, nothing in debug logs. Turned all plugins off to retry and still occurs.

@mathiascode
Copy link
Member

Does it only happen when filtering? What about other lists such as downloads/uploads, does Ctrl-C work fine there?

@metaisfacil
Copy link
Author

Hmm, I thought for sure it was only happening during filters, but on a secondary check Ctrl+C'ing files appears to be crashing even without a filter. Seems to also affect both uploads and downloads aside from searches.

To emphasize, Ctrl+C'ing folders does NOT crash the program.

@metaisfacil metaisfacil changed the title Copying search result filenames with filters active causes crash Copying search result filenames active causes crash Dec 11, 2023
@metaisfacil metaisfacil changed the title Copying search result filenames active causes crash Copying search result filenames causes crash Dec 11, 2023
@mathiascode
Copy link
Member

mathiascode commented Dec 12, 2023

Can you try the latest unstable build? I made some small clipboard-related changes. I can't get Nicotine+ to crash on my Windows 11 machine at least (don't have Windows 10 to test right now).

If it still crashes:

  • What is your system language set to?
  • Do you have any clipboard-related programs installed?
  • Does it crash after restarting Windows, when the clipboard is empty?
  • Do context menu items such as "Copy URL" result in a crash?

I could also prepare a build of Nicotine+ with console output enabled, to see if there's any useful information logged.

@metaisfacil
Copy link
Author

metaisfacil commented Dec 12, 2023

I installed this build. Copying files no longer crashes the program, however it's not copying the file name to clipboard, just "0". It now appears to be working properly, no idea why it was only copying "0" before.

  • System language is English (United States).
  • I do not have any programs dedicated to clipboard-related tasks installed. I have certain programs installed which have tools that can provide statistics about clipboard data, but this does not happen in the background. I can't think of anything that could interfere with Nicotine+ here.
  • I will check this later when I am in the position to do so.
  • "Copy URL" does not crash, they all work as expected.

@mathiascode
Copy link
Member

I installed this build. Copying files no longer crashes the program,

Thanks for testing. Could you try this build (before the clipboard-related changes were made) and the newer build back-to-back, to confirm if the bug is actually fixed, or if it happened to go away temporarily.

however it's not copying the file name to clipboard, just "0". It now appears to be working properly, no idea why it was only copying "0" before.

"0" would be one of the empty numerical columns.

@metaisfacil
Copy link
Author

Alright, I've realized Ctrl+C will copy whichever specific part of the line was last clicked. I was not aware of this nuance, is it intended behavior? If I click on the filename, Ctrl+C copies the filename, if I click the music icon, Ctrl+C copies "audio-x-generic-symbolic", and previously if I clicked any blank areas under the "Folder" column to the left of the filename, Ctrl+C would cause the crash. I can't get the newer build to crash this way.

@mathiascode
Copy link
Member

Alright, I've realized Ctrl+C will copy whichever specific part of the line was last clicked. I was not aware of this nuance, is it intended behavior?

That's intended. The exact value of the focused cell is copied. You can see which cell is focused by holding Alt, and move focus to another cell by either clicking it or using the arrow keys.

if I click the music icon, Ctrl+C copies "audio-x-generic-symbolic"

Thanks for mentioning this, it should now copy the tooltip text instead.

and previously if I clicked any blank areas under the "Folder" column to the left of the filename, Ctrl+C would cause the crash. I can't get the newer build to crash this way.

Ah, that would explain it. An empty string used to be copied to the clipboard, which must've caused a crash for some reason.

Since the crash no longer occurs, I'll close this issue. Let me know if you run into any other issues.

@mathiascode mathiascode added this to the 3.3.0 milestone Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants