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

Crash on NSProgress data race when using CLI #37

Open
NBaLogn opened this issue Sep 22, 2024 · 3 comments
Open

Crash on NSProgress data race when using CLI #37

NBaLogn opened this issue Sep 22, 2024 · 3 comments

Comments

@NBaLogn
Copy link

NBaLogn commented Sep 22, 2024

Here's the relevant settings for the app.
SCR-20240922-quhd
SCR-20240922-qtmu
SCR-20240922-qvwx

I just downloaded the app for a few days, and was using it to optimize a few folders of mixed files (PDF and videos). Since there's a lot of files, I used the CLI command "clop optimize -garn *" to optimize aggressively for all files in the folder and subfolders, no progress bar in the terminal but in the GUI instead.

However, sometimes while optimizing a video, the terminal shows this error
SCR-20240922-oauu which indicates process exit, while the GUI shows the process still works in the background, just that it skips that (those) item(s).

After waiting for a while, it'd show that subsequent items in the folders would not be optimized, so I clicked on "Stop and clear", but then some items would be missing, not appearing anywhere. There appears to be attempts to recover from the app itself, but it still lost a lot of videos.

I don't know if this is mainly a CLI bug, or just an app bug in general; I've mainly only used the CLI, and the majority of that bug appeared there. It could be that it's an app bug that could appear during background/clipboard optimization but I didn't encounter/notice.

I was able to restore them from Time Machine, but it seems this is a notable bug. If there's some workaround or some settings I set that lead to this result, please inform me.

@alin23
Copy link
Collaborator

alin23 commented Sep 23, 2024

Have you checked the backups folder? You can open it from the Clop menu bar icon. The videos should be there even if the operation failed.

About the error, please have a look in ~/Library/Logs/DiagnosticReports and see if you have any Clop related crash log. Send me any you can find.

@NBaLogn
Copy link
Author

NBaLogn commented Sep 23, 2024

I checked a few times, there were a lot of files there, but weirdly most of the files I lost are not there. When I tried searching system-wide using Onyx, just before I used Time Machine, I actually got a few files from the hidden "private/var/folders/t6/[some-keys]/T/TemporaryItems" folder tho.
SCR-20240923-prfs-3

And here's the zip of the reports, tho it's in a folder called "Retired", so I just zipped it up like that.
Retired.zip

@alin23
Copy link
Collaborator

alin23 commented Sep 25, 2024

Looks like a thread safety issue on fetching and showing progress on the terminal:

Thread 2 Crashed:
0   libobjc.A.dylib               	       0x18e84bb78 objc_retain + 16
1   Foundation                    	       0x190883810 -[NSProgress localizedAdditionalDescription] + 60
2   ClopCLI                       	       0x1021382ac ProgressPrinter.printProgress() (in ClopCLI) (main.swift:1292) + 98988
3   ClopCLI                       	       0x102136d88 closure #1 in closure #1 in ProgressPrinter.addProgressSubscriber(url:progress:) (in ClopCLI) (main.swift:1246) + 93576
4   ClopCLI                       	       0x102163e69 thunk for @escaping @isolated(any) @callee_guaranteed @async () -> (@out A)specialized partial apply (in ClopCLI) + 1 + 278121
5   ClopCLI                       	       0x10213dfe9 specialized thunk for @escaping @isolated(any) @callee_guaranteed @async () -> (@out A) (in ClopCLI) (/<compiler-generated>:0) + 122857
6   ClopCLI                       	       0x102163e69 thunk for @escaping @isolated(any) @callee_guaranteed @async () -> (@out A)specialized partial apply (in ClopCLI) + 1 + 278121
7   libswift_Concurrency.dylib    	       0x2683c1035 completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*) + 1

Adding --no-progress should fix this until I find the underlying problem and I release a new version.

@alin23 alin23 changed the title Lost videos bug Crash on NSProgress data race when using CLI Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants