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

MultiMC freezes for about a minute when clicking a button or link leading outside of MultiMC #2529

Closed
ghost opened this issue Feb 3, 2019 · 25 comments · Fixed by #3919
Closed
Labels
bug external has-code Issues with code attached system: macOS Issues specific to macOS (Apple weirdness, UI glitches, broken SSL, etc.)

Comments

@ghost
Copy link

ghost commented Feb 3, 2019

System Information

MultiMC version:
0.6.5-develop-1238 (also occurs on 0.6.4-1232)

Operating System:
macOS Mojave (10.14.3)

Summary of the issue or suggestion:

When clicking a button that leads to an app that is not MultiMC (e.g. clicking the "Minecraft folder" button for an instance opens a folder in Finder, or clicking a link will lead to a web browser), MultiMC freezes for about a minute, then catches up and opens the desired destination. Once this happens MultiMC stops freezing. After this has happened one time, this no longer occurs until MultiMC is quit and reopened.

This also happens in-game if a link leading to a web browser is opened, but it will freeze the game instead of MultiMC. Again, this will only happen one time until MultiMC is quit and reopened.

Once this has happened either in MultiMC or in-game, it will not happen again in either MultiMC or in-game until MultiMC and the game are quit and reopened. For example, if you reproduce this issue in MultiMC, wait for it to recover, then open an instance, opening a link in-game will not reproduce the bug again.

What should happen:

MultiMC (or Minecraft launched from MultiMC) should not freeze when clicking a button leading out of the app.

Steps to reproduce the issue (Add more if needed):

(There are several ways to do so, as described above. This is just one way.)

  1. Click on any instance.

  2. Click the "Minecraft Folder" button.

Suspected cause:

This only seemed to occur on macOS Mojave and not High Sierra. Perhaps something changed in the OS in this time related to this?

Logs/Screenshots:

https://pastebin.com/raw/6mduUPFT

Additional Info:

This does not occur in any other app, including the vanilla Minecraft launcher and the game launched from the vanilla Minecraft launcher. This issue will only occur in MultiMC and any instances of Minecraft launched by MultiMC.

@peterix
Copy link
Member

peterix commented Apr 21, 2019

Well, I guess Apple broke something, again. I'll have to investigate this further.

@Chew
Copy link

Chew commented Jul 23, 2019

I'm getting this problem on 0.6.6-develop-1297 running macOS 10.14.5.

It looks like it's about to open (it highlights the destination window) but multimc just ends up freezing before anything else happens.

@ghost
Copy link
Author

ghost commented Oct 16, 2019

I believe this may be the result of the fact that MultiMC uses QT 5.6.3 (which is pretty old). See https://www.qt.io/blog/2018/11/08/qt-macos-10-14-mojave and qgis/QGIS#28201 (an issue from another QT based application). Updating to at least QT 5.12 may resolve the issue, if that is feasible.

Edit: Issue I linked above kind of looks similar to these issues as well:
#2784
#2598

@peterix
Copy link
Member

peterix commented Oct 17, 2019

That would mean dropping support for macOS up to 10.12.

I guess that's reasonable.

@Chew
Copy link

Chew commented Oct 17, 2019

Considering macOS 10.12 is 3 years old and the only major reason people aren't upgraded farther is because their computer can't support a higher OS, and therefore probably can't handle minecraft all that well anyway, it's a win-win.

@SuperOkazaki
Copy link

Does this issue also cause the system freeze upon opening MultiMC.app and a modpack? I can confirm these symptoms when doing the above stated actions, but it also happens when opening MultiMC as a whole and when launching a modpack.

@ghost
Copy link
Author

ghost commented Oct 27, 2019

Does this issue also cause the system freeze upon opening MultiMC.app and a modpack? I can confirm these symptoms when doing the above stated actions, but it also happens when opening MultiMC as a whole and when launching a modpack.

Personally, I do not see the issue where the entire system freezes, but I believe that the other issues I linked in my comment do seem to be about a system freeze, so if I had to guess, this would resolve that issue too.

@ghost
Copy link
Author

ghost commented Mar 21, 2020

I tried actually testing myself and building with an updated QT (5.14.1) and found that it actually doesn't solve this issue. Apologies for the false lead, I probably should have tested myself in the first place.

However, I found that moving the instances folder outside the application bundle and putting them somewhere else (like ~/Library/Application Support/) greatly reduced the freezing. Creating a symbolic link to move the assets and libraries folder somewhere else also reduced the freezing. I suppose that could be a workaround that may work for some unless they need the app and instances to be portable.

@ghost
Copy link
Author

ghost commented Mar 23, 2020

After a bit of research and testing (caveat: I've been using the latest QT5, not 5.6.3, although I don't believe the results would be different) I found that by opening the URLs in a separate thread (I've made a draft of that in Ghalid@eb1e832), the main window will no longer freeze. However this doesn't completely fix the issue, as the website or folder the user is attempting to open will still take a very long time to open.

I was unable to find the root cause of the URL taking a long time to open, unfortunately (especially considering that other QT apps I've seen don't show the same behavior, even on the same machine and when the application folder is quite large).

@magicus
Copy link

magicus commented Apr 1, 2020

I updated to 0.6.11 from 0.6.8 and just started experiencing this. However, I never found out that the freeze finally ended -- after some swearing and waiting what I thought was enough, I killed the process.

I never experience this on 0.6.8. I have not updated anything on macOS in the meantime. I did however try to install minecraft 1.13.2 with forge support (to install optifine, wanting to try out the marvellous Harry Potter map from Floo). I do not think doing any of this caused the freezing to begin.

I'm currently trying to reinstall 0.6.8 to see if the problem goes away. This turned out to be catastrohpical (!), I'll open a separate issue for that.

@magicus
Copy link

magicus commented Apr 1, 2020

Now I've tested with 0.6.8. I realize that what I saw in 0.6.11 was something different. With 0.6.8, if I press like "Instance Folder", the folder pops up in Finder immediately, but the MultiMC app becomes unresponsive (the spinning beach ball), for some time, probably less than a minute but around that. Future attempts to open the folder goes without a hitch.

What I saw in 0.6.11 was that the MultiMC app froze immediately and never even opened the folder (or the external editor when wanting to edit a json file). And, for as long as I waited, the app never recovered.

So that might in fact be a completely separate bug, but my gut feeling tells me they are likely related, and hopefully the commits between 0.6.8 and 0.6.11 might help shed some lights on what has changed that could affect this behavior, which can help pinpoint the issue.

@ghost
Copy link
Author

ghost commented Apr 3, 2020

I updated to 0.6.11 from 0.6.8 and just started experiencing this.

Personally, I've experienced this way back before 0.6.5 (I've also had this before even opening this very issue). Based on my testing, I think it might have something to do with the size of MultiMC's app bundle, as I was able to workaround this issue by moving the (large) instances and other assets into folders outside the application bundle.

Oddly enough, when I dragged these large folders into other, unrelated apps (including an unsigned QT app), I was not able to reproduce the issue with them. It is only MultiMC that I've seen this; I don't think it's some macOS security thing.

What I saw in 0.6.11 was that the MultiMC app froze immediately and never even opened the folder (or the external editor when wanting to edit a json file). And, for as long as I waited, the app never recovered.

But you mention 0.6.11 - I've been still using my self-built version with version number 0.6.9.

I've just updated my build to 0.6.11 (built it myself again), and my results were that it behaved the same way as in 0.6.9 (when the app bundle is large). It opened the external application (but not the intended location), froze, and eventually recovered and opened the intended location. When the app is smaller, the freeze is not as long or not noticeable. Same when I use the downloaded dev version from the website.

I think there's some sort of other variables at play here. @magicus, can you see if a fresh install (with no instances, or any other of your game data) reproduces the same behavior? On my end, when I do so, I see no freeze until I move the instances and other data back. Additionally, have any permissions for MultiMC been granted in the Security & Privacy pane of System Preferences? I have granted no extra permissions, but have seen something being thrown around about Accessibility permissions in a related issue (from my understanding, having it allowed supposedly causes a full system freeze instead).

@ScottoMotto
Copy link

I run 10.11.6 El Capitan and have zero problems with MultiMC and haven't for years. I run hundreds of instances from Classic to new Snapshots, every modpack imaginable, hacks etc..
It is something introduced in newer MacOS versions and it is fairly certain that it is Gatekeeper and/or notarization.

For those who want to help nail down the issue temporarily disable Gatekeeper and see if it fixes it.
sudo spctl --master-disable
Then after testing
sudo spctl --master-enable

Setting quarantine flags manually might be a thing too.

As stated I have no issues at all with my Mac and MultiMC but I do have an interest in improving the experience for Mac users and would like to help find a workable solution.

@ghost
Copy link
Author

ghost commented Apr 3, 2020

For those who want to help nail down the issue temporarily disable Gatekeeper and see if it fixes it.
sudo spctl --master-disable
Then after testing
sudo spctl --master-enable

Setting quarantine flags manually might be a thing too.

Doesn't look to be Gatekeeper related, or at least, it still occurs when Gatekeeper is disabled. Additionally, no quarantine flags are set on MultiMC: xattr /Applications/MultiMC.app shows no output (no com.apple.quarantine, probably because it was built from source). Doesn't look like the quarantine flag makes a difference here, at least on my end.

Thanks for your ideas, though, I hope a solution can eventually be reached. I'd like to add that back when I did use El Capitan, I definitely didn't have these issues with MultiMC - they were introduced with some major macOS update (10.13 High Sierra, if I recall correctly, but it has been a while so I don't really know 10.14 Sierra, doh, apparently I can't read my own original bug report :P).

@ScottoMotto
Copy link

What if you check the quarantine on the executable instead of the app bundle? Like (app path)/MultiMC.app/Contents/MacOS/MultiMC

@ghost
Copy link
Author

ghost commented Apr 3, 2020

What if you check the quarantine on the executable instead of the app bundle? Like (app path)/MultiMC.app/Contents/MacOS/MultiMC

Same thing, no quarantine flag (or any other flags).

@Chew
Copy link

Chew commented Apr 4, 2020

For some reason, this is intermittent. It appears to "fix" itself after a restart.

SOMETIMES, will it freeze MultiMC.
ALWAYS, does a link clicked in a Minecraft window freezes MINECRAFT (not MultiMC)

Edit: Important to note the target window (Finder, browser, etc) focuses, but Multi/MC freezes, so it does nothing. Could this be the external program returning something invalid Multi/MC can't parse?

@ghost
Copy link
Author

ghost commented Apr 6, 2020

I've figured out a solution with no compromises (i.e. portability of the app can be kept! But @peterix, if there is some drawback I've overlooked then please correct me) that resolves this issue on my end.

My previous idea, that the freezing of MultiMC was linked to the size of the application bundle, was close to correct. It is actually the size of the Contents folder inside the application bundle. macOS doesn't seem to like non-code things in those directories, from what I can tell (unsure why it only affects MultiMC though).

Thus, my solution is to move the user data directories into a separate folder that is still inside the application bundle (MultiMC.app/Data). Therefore, macOS doesn't complain that the Contents folder is too large, but the user can still move the application around to move their data.

I have done this in PR #3081.

@phit phit added bug system: macOS Issues specific to macOS (Apple weirdness, UI glitches, broken SSL, etc.) has-code Issues with code attached and removed needs-repro labels Mar 9, 2021
@hamarb123
Copy link
Contributor

Hi, I'm still having this problem (had it on catalina, just upgraded to big sur).
I'm not sure if it's meant to be fixed yet, I'm on 0.6.12, it's very annoying.
I experience it when I press the mod folder button or links. Also, occasionally, it doesn't open and is frozen and I have to force quit and open it from the command line for multiple times in a row.
I was wondering if when it was going to be fixed and if there is anything I can do to help the development of the fix @peterix.

@ghost
Copy link
Author

ghost commented Jul 1, 2021

I was wondering if when it was going to be fixed and if there is anything I can do to help the development of the fix

@hamarb123 Currently a partial solution is in PR #3081. Unfortunately, I haven't been able to work on it recently because other things have taken priority for me. If you are willing to help, that would be great - I encourage you (or anyone else willing to try their hand at this) to use my code and mine/others' notes on this issue/that PR as a base.

Please read through all the comments in #3081 to understand what is needed for the PR to be merged without major problems.

@hamarb123
Copy link
Contributor

Thanks @Ghalid, I've implemented a fix on the PR #3919 (I think)! Hopefully it gets approved :)

@45gfg9
Copy link

45gfg9 commented Jul 10, 2021

If the freeze is cause by .minecraft folder stored in Contents/Resources, then, I mean, why not just move the instance folders to somewhere else like Application Support or ~/.local? It may solve the problem, AND another problem that if you install MultiMC with Homebrew, then upon every update all your data are gone.

@kb-1000
Copy link
Contributor

kb-1000 commented Jul 10, 2021

Homebrew is an unsupported installation way.

@peterix
Copy link
Member

peterix commented Jul 10, 2021

And discouraged. Strongly.

@hamarb123
Copy link
Contributor

@peterix can you please review my PR #3919 when you have time and merge it? It fixes the slow startup on macOS, I currently use stable and usually have to wait multiple minutes, so I usually have to just run it from the command line.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug external has-code Issues with code attached system: macOS Issues specific to macOS (Apple weirdness, UI glitches, broken SSL, etc.)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants