microsoft / malmo

Project Malmo is a platform for Artificial Intelligence experimentation and research built on top of Minecraft. We aim to inspire a new generation of research into challenging new problems presented by this unique environment. --- For installation instructions, scroll down to *Getting Started* below, or visit the project page for more information:
https://www.microsoft.com/en-us/research/project/project-malmo/
MIT License
4.1k stars 600 forks source link

Crashing on Resizing window: 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!' #907

Open hendryjwr opened 3 years ago

hendryjwr commented 3 years ago

Hi there, I'm running MacOS Big Sur 11.2.3 but using the adopt jdk8 as the docs suggest. A java applet runs with no issues, attempts to enter a world and then appears to crash out directly after the window resize. Error shown below, appreciate the help in advance.

DEBUG:minerl.env.malmo.instance.213274:[10:39:21] [Client thread/INFO]: [STDOUT]: ***Telling server we are ready - MineRLAgent
DEBUG:minerl.env.malmo.instance.213274:[10:39:22] [Client thread/INFO]: [STDOUT]: CLIENT request state: RUNNING
DEBUG:minerl.env.malmo.instance.213274:[10:39:22] [Client thread/INFO]: [STDOUT]: CLIENT enter state: RUNNING
DEBUG:minerl.env.malmo.instance.213274:[10:39:22] [Server thread/INFO]: [STDOUT]: SERVER request state: RUNNING
DEBUG:minerl.env.malmo.instance.213274:[10:39:22] [Client thread/INFO]: [STDOUT]: Resized the window
DEBUG:minerl.env.malmo.instance.213274:2021-04-06 10:39:22.098 java[57329:653051] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'
DEBUG:minerl.env.malmo.instance.213274:*** First throw call stack:
DEBUG:minerl.env.malmo.instance.213274:(
DEBUG:minerl.env.malmo.instance.213274: 0   CoreFoundation                      0x00007fff2066e6af __exceptionPreprocess + 242
DEBUG:minerl.env.malmo.instance.213274: 1   libobjc.A.dylib                     0x00007fff203a63c9 objc_exception_throw + 48
DEBUG:minerl.env.malmo.instance.213274: 2   CoreFoundation                      0x00007fff20696a9a -[NSException raise] + 9
DEBUG:minerl.env.malmo.instance.213274: 3   AppKit                              0x00007fff22e3d460 -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 321
DEBUG:minerl.env.malmo.instance.213274: 4   AppKit                              0x00007fff22e657db -[NSThemeFrame setStyleMask:] + 142
DEBUG:minerl.env.malmo.instance.213274: 5   AppKit                              0x00007fff22e65571 __25-[NSWindow setStyleMask:]_block_invoke + 2057
DEBUG:minerl.env.malmo.instance.213274: 6   AppKit                              0x00007fff22e64d0e NSPerformVisuallyAtomicChange + 132
DEBUG:minerl.env.malmo.instance.213274: 7   AppKit                              0x00007fff22e64c1b -[NSWindow setStyleMask:] + 170
DEBUG:minerl.env.malmo.instance.213274: 8   liblwjgl.dylib                      0x0000000129055ee2 Java_org_lwjgl_opengl_MacOSXDisplay_nSetResizable + 82
DEBUG:minerl.env.malmo.instance.213274: 9   ???                                 0x00000001127cc407 0x0 + 4605133831
DEBUG:minerl.env.malmo.instance.213274:)
DEBUG:minerl.env.malmo.instance.213274:libc++abi.dylib: terminating with uncaught exception of type NSException
DEBUG:minerl.env.comms:Pause before retry on 'NoneType' object has no attribute 'decode'
DEBUG:minerl.env.malmo.instance.213274::runClient FAILED
DEBUG:minerl.env.malmo.instance.213274:
DEBUG:minerl.env.malmo.instance.213274:FAILURE: Build failed with an exception.
DEBUG:minerl.env.malmo.instance.213274:
DEBUG:minerl.env.malmo.instance.213274:* What went wrong:
DEBUG:minerl.env.malmo.instance.213274:Execution failed for task ':runClient'.
DEBUG:minerl.env.malmo.instance.213274:> Process 'command '/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/java'' finished with non-zero exit value 134
DEBUG:minerl.env.malmo.instance.213274:
DEBUG:minerl.env.malmo.instance.213274:* Try:
DEBUG:minerl.env.malmo.instance.213274:Run with --info or --debug option to get more log output.
DEBUG:minerl.env.malmo.instance.213274:
DEBUG:minerl.env.malmo.instance.213274:* Exception is:
DEBUG:minerl.env.malmo.instance.213274:org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':runClient'.
DEBUG:minerl.env.malmo.instance.213274: at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)

Thanks!

hendryjwr commented 3 years ago

A further update to this. After looking into it a lot more, looks like this is where the issue lies.

File "/Users/jameshendry/Desktop/Bath_Modules/RL/rlcw3/.venv/lib/python3.7/site-packages/minerl/env/comms.py", line 39, in wrapper
    return func(*args, **kwargs)
  File "/Users/jameshendry/Desktop/Bath_Modules/RL/rlcw3/.venv/lib/python3.7/site-packages/minerl/env/core.py", line 510, in _start_up
    return self._peek_obs()
  File "/Users/jameshendry/Desktop/Bath_Modules/RL/rlcw3/.venv/lib/python3.7/site-packages/minerl/env/core.py", line 553, in _peek_obs
    info = comms.recv_message(self.client_socket).decode('utf-8')
AttributeError: 'NoneType' object has no attribute 'decode'
ForrestZeng1 commented 3 years ago

I had this exact problem; Download and use jdk-8u152 here https://mirrors.huaweicloud.com/java/jdk/8u152-b16/

This worked for me perfectly.