The bug
When the host of a singleplayer world which was opened to LAN tries to close the world their game (client) may freeze.
The log shows that the server was successfully stopped though.
[17:42:54] [Server thread/INFO]: BartZeroSix left the game
[17:42:54] [Server thread/INFO]: Stopping singleplayer server as player logged out
[17:42:54] [Server thread/INFO]: Stopping server
[17:42:54] [Server thread/INFO]: Saving players
[17:42:54] [Server thread/INFO]: Saving worlds
[17:42:54] [Server thread/INFO]: Saving chunks for level 'Freebuild 1.8'/Overworld
[17:42:54] [Server thread/INFO]: Saving chunks for level 'Freebuild 1.8'/Nether
[17:42:54] [Server thread/INFO]: Saving chunks for level 'Freebuild 1.8'/The End
How to reproduce
Open a world
Open it to LAN
Try to close the world
Note: Since this bug seems to be caused by a race condition it could be possible that you cannot reproduce this bug with some computers.
Code analysis and debugging results
JStack, WhatIsHang, and debug logs related to this issue
This bug seems to have the same cause like MC-92255, which is caused by the method IntegratedServer.initiateShutdown
being called twice.
Related issues
is duplicated by
relates to
Attachments
Comments


How long did you wait after 17:42:54 ?

I have waited more than 15 min the first time. After that only 5 minuts or so, but this time only 30 secondes just to have launcher's log.
It probably doesn't come from my PC (i mean not from RAM or something like that), because i have a pretty good PC (not a single problem even on huge modpack).

Is there a crash report generated in .minecraft/crash-reports?

It does not look like. The folder isn't even there. (I cleaned my .minecraft folder for the 1.8 release though.)

I can confirm this.
Here is a link MC-73057 to the bug report I submitted (marked duplicate .. sorry didn't think it was reported) anyways there is more info in my report that might help reproduce this bug.
To me it appears maybe the network stream is not being closed every time.
P.S. I have personally left the client open for hours after it hangs and it never goes back to main menu.

Closely related to MC-63802 - same issue for dedicated server

I can confirm this on 1.8 through 1.8.1-pre2 on Ubuntu 14.04 LTS 32-bit. I get this a lot when I need to use a cheat command, like to switch to clear weather when rain lags my slow laptop. Same log output; looks like nothing happened.

Is this still an issue in 1.8.1-pre3 ? The related MC-72806 got fixed in that version.

1.8.1-pre4 - Nope. Still there. Not resolved. :'(

This happens on 1.8.1 & 1.8.2-pre4
OS X 10.10.1 Java 8u25
The game gives no log info from the actual freeze.
Players need not join the game after opening to LAN for the freeze to occur.
I have waited over an hour before and we came back and it was still doing nothing. If the game is in fullscreen, I must force restart the computer.
Game music is still playing after clicking Save and Quit. Game log ends here:
[17:59:04] [Server thread/INFO]: Stopping singleplayer server as player logged out
[17:59:04] [Server thread/INFO]: Stopping server
[17:59:04] [Server thread/INFO]: Saving players
[17:59:04] [Server thread/INFO]: Saving worlds
[17:59:04] [Server thread/INFO]: Saving chunks for level 'LAN test'/Overworld
[17:59:04] [Server thread/INFO]: Saving chunks for level 'LAN test'/Nether
[17:59:04] [Server thread/INFO]: Saving chunks for level 'LAN test'/The End
No Launcher log entries after Save and Quit.
I forced the client to quit and got these log entries:
Game
[18:09:54] [Client Shutdown Thread/INFO]: Stopping server
[18:09:54] [Client Shutdown Thread/INFO]: Saving players
AL lib: (EE) alc_cleanup: 1 device not closed
Launcher
[18:09:54 ERROR]: java.io.IOException: Stream closed
[18:09:54 ERROR]: Game ended with bad state (exit code 143)
[18:09:54 INFO]: Ignoring visibility rule and showing launcher due to a game crash

I have the same problem. Also on launcher log it said "game ended with bad state" and gives an error number but I can't remember the namer and find the launcher log... I googled that number, it's an "out of memory" error but I already allocated more memory and still have the same problem.

Cannot reproduce on 1.8.2-pre6
OS X 10.10.2 Java 8u31
Can't reproduce in 1.8.2-pre5, so I think that's the fix version.
EDIT: seems like everyone has this issue only sporadically. In any case, it has happened to me in 1.8.5. Java 8u45 OS X 10.10.3.

Oh wow this actually just happened to me!! I thought it was just lag from the internet <-- which it could very well be, for me at least. Yeah it just froze and usually the window says (not responding) but it didn't I had to close via task manager<--which said java said not repsonding. The log said nothing suspicious so I thought it was just normal but I have noticed that ANYTIME minecraft is closed that their is a slight 'freezing' (you get the loading screen but without the words) and then it goes to the title screen. Sometimes it says not responding but it usually fixes itself within a minute.
EDIT: and I am currently using 1.8.2pre6

Same issue. Vanilla 1.8.3 on Ubuntu 12.04 64-bit. Has occurred 1/1 time played on one world created in 1.8.3 and 1/2 times played on another world created in 1.8.3. So it has occurred 2 times of the 3 total times I have played a LAN world. First time it happened I left overnight and it did not self-correct.

I have same issue too, but it may corrupt the save 😞

I note that if you have had a LAN user join your game, then when you quit, it doesn't hang.

Same issue on Vanilla Minecraft 1.8.3 on Windows 7 SP1 64-bit. Happens every time I try to exit a LAN world in 1.8.3. Java version 1.8.0_40.

Same issue on Vanilla 1.8.4, Mac OS. Happens every time I exit a LAN world. Java version 1.8.0_45. This doesn't correct itself overnight. 😞 Think this'll corrupt any data? ARE MY FARM ANIMALS OKAY?!?

Confirmed for
1.8.4 same error message as above (I was the only player on the LAN world)

confirmed for 1.8.5
Java 8u45
OS X 10.10.3
I also just commented on numerous other reports that are identical to this. This ticket is not the oldest one, but I guess it's the only currently open one and it has a decent amount of attention.
Linking them all up would really help though. Especially for older users who now have fellow players in the same boat as them. It's good to know you shouldn't have been brushed off.

This just happened to me on 1.8.7 with a brand new download of the launcher, v1.6.11. I had been playing with it opened to LAN and one other person (who had logged off before I exited). I had to kill the window forcefully.
latest.log file attached. This has been happening to me ever since I can remember on 1.8+
OS: Windows 7 x64 SP1 Professional
Proc: Intel Core i7 940
Motherboard: EVGA x58 SLI
VGA: MSI AMD 6950
RAM: 12GB
Java: 8 Update 31 (64-bit)

Has this seriously not been fixed yet? Opened October of 2014 and still no resolution?
Confirmed this bug still exists in 1.8.7 because it happens to me almost 100% of the time I play on LAN. Force close is the only way to close Minecraft. Leaving it open for hours doesn't matter.

Froze on my first test on 15w31a. Still no unique or interesting log entries. World still saves fine before the freeze. The freeze still occurs on the pause screen while the "Save and Quit to Title" button is depressed.

Wellllllllllll, this doesn't always happen, usually only when left open for an extended period of time, (including when I'm not AFK), and only like 30-45% of the time. :\
It just happened to me on stream in 15w40b. So I can confirm for 15w40b.

Check my log on MC-71357, it will show you what happens.
I have the same problem as well.
Are they duplicates?

Confirmed on MC 1.8.8, still unresolved?

Confirmed. Also to note, the game freezes only for the host.

This is my second freeze
Check the log with this name:
mc_freeze_03_10_2015.txt

Confirmed for 15w41b.

Confirmed for 15w46a

Confirm for 15w47a

Confirm for 15w50a.

This problem is happening for me too now my kids have two accounts and have been running Open to LAN games.
Host Computer: OS X 10.11.1, Minecraft 1.8, Launcher 1.6.44
This is the one usually running as the host when it hangs.

I am running Ubuntu 14.04 LTS and notice that if I have top running in a shell and use the "Open to LAN" feature of Minecraft in single player world, running in OpenJDK/JRE 7, launcher version 1.6.44, MC Version 1.8.9, then the game will exit normally and not freeze up. I usually set other players mode as spectator, but there are no other players on my LAN, and set the cheats on because I use the gamemode command to change mode. I have tried this twice, and it has worked fine both times. I do not know the intricacies of top, but understand that it is like the task manager in MS Windows. I hope this helps to resolve the isssue.

Very likely the same reason as for MC-92255.
The client is calling initiateShutdown()
for the server twice.

Confirmed for 16w02a

Confirmed for 16w03a.

After my fullscreen Minecraft session froze in Win10, I am unable to alt-tab away from Minecraft or recover my system. CTRL-Alt-Delete doesn't pull up the task manager, and Alt-F4 has no effect. Does anyone have any other tips for killing the Minecraft session short of a hard reboot?
Edit: Nevermind. If you wait long enough (20 mins??), ctrl-alt-delete will kick in.

Confirmed for 16w04a. Made sure not to be in fullscreen this time. Windows is much better at ending the frozen program if you can click the X on the window chrome. Hope this bug gets fixed!

Confirmed for 16w05a.

Confirmed for 16w05b.

Confirm for 1.9-pre1

Confirm for 1.9-pre2

Confirm for 1.9-pre3

Confirm for 1.9-pre4

Confirm for 1.9

I also have this problem. Minecraft 1.9 (on Win10x64.) Final messages: Stopping singleplayer server; Stopping server; Saving players; Saving worlds; Saving chunks .../Overworld; then /Nether; then /The End. No players had left the Overworld.

I got around this problem by enabling cheats at world generation time. Since I am playing only singleplayer, I do not need to open to LAN and just wanted to be able to enter command to change game mode and difficulty. I do not like to cheat but view cheats as just a way for a singleplayer to access some additional functionality. CAVEAT: Anything with great potential has an equal likelihood of great exploitation by others.

From the start of 1.8 to 1.9. Wow. This bug has sure been overlooked.
EDIT: Just happened to me. Kinda annoying.

@TheRSC it certainly seems like it's been overlooked. I reported it back in 1.8 and at each update when it still happened came back to re-report, but other people kept beating me to it. Been following it the whole time and the only updates I ever see are more reports of it. No one ever comments on fixing it... 😞

@Bryan I don't think its that. They still have no idea what it causing this bug. Like for example, mine has been working great since the 1.9 snapshots and I think since 1.8.8 I have personally dealt with this bug myself and I can tell you that it is very strange considering it still effects you among others. Since it does not effect me anymore and probably others as well, Just keep trying to duplicate it and if you think it will definitely do it again, just before you press save and quit hold f3 + C for a few seconds to force a crash report then attach it this ticket. If anything, this might help Mojang fix this, if they can find anything strange in the reports. It's a shot.
ALSO: Make sure the internet connection isn't going in and out while you have it open to lan. Mine froze when the internet went down and I tried to save and quit.

Confirm for 16w14a

Confirm for 16w15a

Confirm for 1.9.2

That's already marked as affected.

Happens to me as well on 1.9.2.

Was already marked as affected. (for the second time)

Confirm for 1.9.4

Confirm 16w20a.

Confirmed in 1.10.2.

I am tweeting some people at Mojang about this. Hopefully then it will get some attention.
Because they said:
1.10.2 release notes:
This is a smaller update taking care of some of the most annoying reported bugs. We are also planning to release another update for 1.10.x in a few weeks that takes care of some less critical but still annoying issues.
This better be one of them.

Not sure if this bug might be "one of them", but I don't think it'd help to tweet it randomly or specifically.
This bugpost got a decent amount of votes and has been noticed.
But some other bugs might have still priority, I could name at least 2 dozens of them from my perspective rightaway.
This is not a really "critical", but admittedly "annoying" bug.
If you want to get this bug being fixed maybe faster (if possible) try to collect some votes from the community by opening a Redditpost or tweet it or make a YT video about it etc. }=)
That being said, it's not a guarantee of course, sometimes some bugs are not easy to fix, despite them looking easy at first glance, so who knows.

I really just want to make sure they know about it. Though, yes, some more votes will help. I might make a Reddit post.

Reproduced in 1.10.2 successfully. I grabbed some info using WhatIsHang and also with jstack:
And I also had debug logging enabled:
Hopefully some of this information is useful. I'm not completely sure how to interpret it, but it looks like the integrated server is hanging on the call to Futures.getUnchecked
in IntegratedServer.initiateShutdown
.

Still freeze up after lan exit on all my computers. Mac Os x, Ubuntu and Windows 3 different machines 3 different OS Versions all same results. Running 1.10.2 Minecraft

@unknown, I assumed as well that the initiateShutdown
method is the cause. Please link from the description to your comment.

please fix this it's been 30 minutes for me
This might be fixed in our upcoming snapshot, due to another fix. It would be great if you can test it when the snapshot is released and see if you can get a repeat. Thanks much! 🙂

Please see if it still occures in the next snapshot.

Still present and still hanging on Futures.getUnchecked
. I've attached a report generated by jstack -l <pid>
:
.

Confirm for 1.11

Using version 1.11.2 the 'Save and Quit to Title' always states 'Not Responding' after a Open to LAN game. The machine that joins the LAN game is able to gracefull quit first but when the machine that opened to LAN quits we always get Not responding / greyed out window.
When forcing close with the big X JAVA error is reported
Description: A problem caused this program to stop interacting with Windows.
Problem signature:
Problem Event Name: AppHangB1
Application Name: javaw.exe
Application Version: 8.0.25.18
Application Timestamp: 54345ca0
Hang Signature: faa2
Hang Type: 0
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 2057
Additional Hang Signature 1: faa2972dfdc2cfbd3f39770e45243ed0
Additional Hang Signature 2: 1db5
Additional Hang Signature 3: 1db56fbfdd30d2bb0ea1ba4130d6ee8c
Additional Hang Signature 4: faa2
Additional Hang Signature 5: faa2972dfdc2cfbd3f39770e45243ed0
Additional Hang Signature 6: 1db5
Additional Hang Signature 7: 1db56fbfdd30d2bb0ea1ba4130d6ee8c
Hope this helps solve what seems like an excessively long remediation for a very frustrating problem.

This has been happening since the 1.9 snapshot at least. It even happens on occasion in the full releases of the updates, not just snapshots.

I can confirm this happens to me
I have one mod installed and that is Optifine, could it be a problem with that?

It's already confirmed.
Modded games are not supported.

Happens on vanilla 1.11.2, also. Java 1.8.0_131, macos 10.12.4.

This happens to me as well. No mods. Version information below:
ENGLISH - US
Version information: 1.12
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) Client VM (build 25.131-b11, mixed mode)
Bootstrap
1321
Tue, 13 Jun 2017 13:11:00 GMT
4005b6211e14ead830b632f0a9c414b17aefee20
Launcher
2.0.934
Tue, 13 Jun 2017 13:09:23 GMT
4eb27a28e9e7639e25b55b93cfc30ea053131ff8
UI
17
Tue, 13 Jun 2017 13:08:36 GMT
c863d29b0506ee89d29cf14d2301b5dc7ded65af
Third-party libraries
AngularJS
1.5.8
three.js
0.79.0
utf8 cpp library
2.3.4
ngAnimate
1.5.8
sha1
1.0
ngSanitize
1.5.8
angular-ui-router
1.0.0-beta.1
angular-recaptcha
4.1.0
MiniZip64
1.1 Show license
LZMA SDK
15.05 beta
JsonCpp
0.6.0
Chromium Embedded Framework
3.2840.1511.gb345083
Boost
1_60
Angular YouTube Embed
1.3.1

Confirmed for 1.12.1, behavior as described in title.
Windows 8.1, Java "1.8.0_141"
Java(TM) SE Runtime Environment (build 1.8.0_141-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.141-b15, mixed mode)
EDIT: Just saw it was already described as affected. Nevermind.
Can confirm for 17w47b.

Confirm for 17w50a

Confirming this issue for 1.12.2 with forge running many mods. I believe this issue happens much more often with mods, though I am unaware whether it is a specific mod or forge itself.

As I understand it, it's a race condition, and having a bunch of mods will usually lead to slowdown, which can exacerbate the issue.
Has anyone experienced this in recent snapshots? I think it might be fixed, in that I haven't been able to reproduce it, but I've also changed my setup a bit and it may be that it just doesn't happen as often on my machine.

I just had this happen to my girlfriend. I'm not sure how to find out which snapshot that we are running. But we just installed the game a few days ago, so it should be on the newest version (1.12.2 I believe)

Snapshots are the development builds, which need to manually be enabled in the launcher (and aren't completely stable); they have names like 18w11a (year 2018 week 11, build a). If you haven't changed anything, then you're on release 1.12.2. You can check just by looking at the window title (or pressing F3 in-game).

Appears to have been fixed in 18w01a. IntegratedServer.initiateShutdown
is only called once (from the client thread) in 18w01a, while it was called on both the server and client threads in prior versions. Checked with JDB, by setting an appropriate breakpoint; in 1.12.2 it is chd.x
; in 17w50a it is (per forge's MCPInfo) clm.q
; and in 18w01a it is cmd.q
. Unfortunately I'm not entirely sure why it's not getting called twice anymore, as I don't see what changed.

This just happened to me on 1.13 Pre-Release 1.

Hm, my earlier testing made it seem like it was fixed in 18w01a. Will double-check and see if the same debug stuff I did earlier still shows it as fixed or not.

Can definitely confirm that the issue has returned. It was not present in 18w19b (dhm.q
), but is definitely present in 18w20a (dhq.q
) (and 18w20c (dhr.q
)).

Why the status of the issue is resolved? It remains in almost every update. Cannot say it is critical though. While the game I play with my wife, crashes almost every time, it does not corrupt save data as it seems. But it became VERY annoying when we started playing with big modpacks like Sevtech, as changing the world is a pain, because loading the game again takes 5 minutes on my high end PC, and 15 minutes on my wife's laptop.

It's been fixed in 1.13. If you're using modpacks, you're almost certainly running an older (and now unsupported, though mods haven't been released for newer versions yet) version, where this has not yet been fixed.

Happened to me on a ModPack , Version 1.10.2 , LAN with my brother , Waited 20 minutes , Still Happening , Can't access my old world though , Anyone found a solution ?

We do not support modded versions of the game, nor do we support modified launchers, nor do we support outdated versions of the game.
This bug is fixed by updating to a current version of the game; at least 1.13.