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

Infinite "Waiting for Tor circuits" popups #1788

Open
micahflee opened this issue Oct 20, 2023 · 8 comments
Open

Infinite "Waiting for Tor circuits" popups #1788

micahflee opened this issue Oct 20, 2023 · 8 comments
Assignees
Labels
Milestone

Comments

@micahflee
Copy link
Collaborator

I haven't figured out what triggers this yet, but sometimes when I close OnionShare, the "Waiting for Tor circuits to close to be sure your files have transferred" dialog pops up, and then more dialogs continue to pop up in an infinite loop until I force quit OnionShare.

Screen Shot 2023-10-20 at 4 19 29 PM
@micahflee micahflee added the bug label Oct 20, 2023
@mig5
Copy link
Collaborator

mig5 commented Oct 23, 2023

I reproduce it on macOS. If I comment out alert.exec() then the problem goes away for me.

Do you know why we are explicitly calling the .exec method on the Alert() class? We don't do that with other Alert widgets elsewhere (Update Checker, Autostop timer alerts, etc). Maybe we don't need it?

Also, I couldn't figure out how to make this Alert functionality only fire if not in local-only mode. Not super important (maybe harmless) but wondered if it was skippable entirely for local mode (maybe not).

@mig5
Copy link
Collaborator

mig5 commented Oct 23, 2023

Actually, commenting it out doesn't fix it, I quit OnionShare while downloading a share and I didn't see the dialog box appear and got a crash (Destroyed while thread is still running).

I've tried using show() as well but it doesn't help.

The "Dialog is not top level modal window" I am not sure is a side-effect or a root cause. Googling it gives me nothing.

The fact that it is reproducible on macOS but not Linux suggests something up with QTWidgets that is OS specific, or something to do with the event loop.

@SaptakS
Copy link
Member

SaptakS commented Dec 13, 2023

I am actually not able to reproduce this issue in Mac OS any longer. Can you test once more? I wonder if it got fixed as part of #1790

@mig5
Copy link
Collaborator

mig5 commented Dec 13, 2023

@SaptakS @micahflee unfortunately I still reproduce it on latest main branch.

I find that it is easier to reproduce if you actually start a share (in Tor mode e.g non-local-only) and visit the share in Tor Browser. You don't need to download the share. Just once you've loaded the page, stop the share in OnionShare and then command-quit the app entirely. This seems to invoke the infinite 'Waiting for circuits to close'.

I think the reason this influences the test is that OnionShare's tor client knows there are 'active' circuits that have been built. Whereas often otherwise, it closes straight away as there is nothing to do.

We must have some sort of loop that is creating an infinite number of OnionCleanupThreads or something.. maybe to do with the main event loop? (no idea)

@SaptakS
Copy link
Member

SaptakS commented Dec 14, 2023

@mig5 I will try reproducing this again and debugging.

@SaptakS SaptakS self-assigned this Dec 14, 2023
@SaptakS SaptakS added this to the 2.6.1 milestone Dec 14, 2023
@mig5
Copy link
Collaborator

mig5 commented Jan 2, 2024

I know @SaptakS had trouble reproducing this but I feel like it's a really impacting bug, I nearly always reproduce it on a 2017 Macbook Pro.

I wonder if we should just remove the thread that tries to 'wait' for tor circuit activity to close? We introduced that because closing OnionShare too soon after it 'stops' (and thereby severing the tor circuits) caused downloads to be incomplete on the client side. The original PR: #1236 and associated issue #929

Maybe we should check if that is still required..

@SaptakS
Copy link
Member

SaptakS commented Jan 3, 2024

I definitely agree that this is an impacting bug and we should find some solution to this. I am able to get the popup, but just one and not infinite. I wonder if it's somehow fixed in Mac silicon but not in Intel Macs.

@mig5
Copy link
Collaborator

mig5 commented Mar 5, 2024

Definitely still get this on 2.6.1 on my Intel Mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants