Page 1 of 2
Problem with external debug console on Mac
Posted: Sat Jan 30, 2021 2:20 pm
by maik
I'm trying to mess with the debug build of Oolite and the included debug console, so far with limited success.
What I had to do to get it to run to some degree:
- Download the latest debug build of Oolite
- Install the python package manager pip, from Terminal:
sudo python -m ensurepip --default-pip
- Install the Twisted library for python, from Terminal:
sudo pip install twisted
- Install the Service Identity library for python, from Terminal:
sudo pip install service_identity
- Move the Debug.oxp that came in the AddOns folder from the downloaded debug version of Oolite to my local AddOns folder (which did not exist at first, I had to create it) at ~/Library/Application Support/Oolite/AddOns
- Edit the debugConfig.plist inside Debug.oxp to uncomment (remove the two leading forward slashes) the line that reads 'console-host = "127.0.0.1";'
Now I could run the simple debug console, from Terminal:
python pySimpleConsole.py
. It starts and waits for a connection. I start the Oolite debug build, and the python console tells me "Opened connection to Oolite version 1.90". Sounds good so far, but does not work. The Oolite window remains black, and after waiting some time the python console seems to lose interest, saying "Connection closed with no message." Only then the main screen from Oolite comes up, but Oolite is not connected to the debug console anymore.
I had no luck with with running
python DebugConsole.py
. It crashes python, giving the MacOS problem report, and writing "macOS 11 or later required ! Abort trap: 6" on Terminal. I am running MacOS 11.1, so no idea what it wants.
Any idea what I need to being doing differently or in addition?
Re: Problem with external debug console on Mac
Posted: Sat Jan 30, 2021 8:39 pm
by another_commander
Not sure I can help with troubleshooting on the Mac, but what happens if you pause the game while the console is running and press "c"? This is normally the alternative way to connect it to the external debug console.
Re: Problem with external debug console on Mac
Posted: Sat Jan 30, 2021 8:44 pm
by maik
Hmm, I started coding my own debug console. If I do not reply to the "Request Connection" message, Oolite starts in a reasonable time and keeps the connection to my debug console open. If I do reply with the "Approve Connection" message I get the same symptom as described earlier: the screen stays black for some time, eventually Oolite closes the connection, and then the main screen comes up.
latest.log says
Code: Select all
1:33:58.441 [debugTCP.connected]: Connected to debug console "Oolite Bridge".
21:35:13.457 [debugTCP.disconnect]: No connection to debug console: "Connection to debug console failed: 'The operation couldn’t be completed. Operation timed out' (outStream status: 7, inStream status: 7)."
Is there maybe a problem in the Oolite debug code? I will experiment further.
Re: Problem with external debug console on Mac
Posted: Sat Jan 30, 2021 8:52 pm
by maik
another_commander wrote: ↑Sat Jan 30, 2021 8:39 pm
Not sure I can help with troubleshooting on the Mac, but what happens if you pause the game while the console is running and press "c"? This is normally the alternative way to connect it to the external debug console.
Thanks, I just tried that: In-game I get the message "Disconnected from debug console". Pressing "c" again it says "Connected to debug console". Same result: I receive the "Request Connection" message, respond with "Approve Connection", and the game hangs (circling colour ball on MacOS) until something times out after 1:15 minutes. Then Oolite closes the connection again.
Re: Problem with external debug console on Mac
Posted: Sat Jan 30, 2021 8:54 pm
by maik
Is this actually a Mac problem? Is someone successfully using the simple Debug Console (pySimpleConsole)?
Re: Problem with external debug console on Mac
Posted: Sat Jan 30, 2021 9:10 pm
by another_commander
maik wrote: ↑Sat Jan 30, 2021 8:54 pm
Is this actually a Mac problem? Is someone successfully using the simple Debug Console (pySimpleConsole)?
Looks like a Mac problem. I am using the console without issues for years on Windows and I know at least one Linux Ooliter who uses the console, also without issues.
Re: Problem with external debug console on Mac
Posted: Sat Jan 30, 2021 9:12 pm
by another_commander
Idea: Could this be a firewall related issue? On Windows, I have to authorize operation of the debug console the very first time I run it because the firewall is complaining.
Re: Problem with external debug console on Mac
Posted: Sat Jan 30, 2021 9:21 pm
by maik
another_commander wrote: ↑Sat Jan 30, 2021 9:12 pm
Idea: Could this be a firewall related issue? On Windows, I have to authorize operation of the debug console the very first time I run it because the firewall is complaining.
Both Oolite and the debug console run on the same machine, no issue as far as I am aware.
another_commander wrote: ↑Sat Jan 30, 2021 9:10 pm
maik wrote: ↑Sat Jan 30, 2021 8:54 pm
Is this actually a Mac problem? Is someone successfully using the simple Debug Console (pySimpleConsole)?
Looks like a Mac problem. I am using the console without issues for years on Windows and I know at least one Linux Ooliter who uses the console, also without issues.
Just to double-check: pySimpleConsole.py (text based), or DebugConsole.py (graphical UI)?
But this might well be a red herring. I just replied with the same debug console identifier as DebugConsole, it did not make a difference. Will dig some more.
Thanks
Re: Problem with external debug console on Mac
Posted: Sat Jan 30, 2021 9:27 pm
by another_commander
maik wrote: ↑Sat Jan 30, 2021 9:21 pm
Just to double-check: pySimpleConsole.py (text based), or DebugConsole.py (graphical UI)?
Oh sorry, I was talking about DebugConsole.py, the graphical UI one and I just realized you were talking about the other one above.
Re: Problem with external debug console on Mac
Posted: Sat Jan 30, 2021 9:43 pm
by cbr
Spawned a few asteroids while paused inside the station
Yep, pySimpleConsole.py still works on this pc, trunk 1.91, linux...
Re: Problem with external debug console on Mac
Posted: Sat Jan 30, 2021 10:33 pm
by maik
cbr wrote: ↑Sat Jan 30, 2021 9:43 pm
Yep, pySimpleConsole.py still works on this pc, trunk 1.91, linux...
Good to hear, but still, bummer
I think I narrowed it down further: Oolite on Mac does not like to receive messages. When I send one, it hangs very shortly thereafter for 1:15 minutes and then closes the connection:
- If I send the Approve Connection message after receiving the Request Connection message, it hangs and then disconnects
- If I do not send the Approve Connection message, but give it a bit of time, and then send a Perform Command message (system.mainStation) after receiving the Request Connection message, it sends back the 2 Console Output messages with information about the mainStation object, then hangs then disconnects
Maybe noteworthy is that there is a deprecation warning in latest.log:
Code: Select all
23:19:54.969 [system]: Warning: +[NSStream getStreamsToHost:port:inputStream:outputStream:] is deprecated since OS X 10.10. Please use +[NSStream getStreamsToHostWithName:port:inputStream:outputStream] instead.
That should not prevent it from working, but maybe it gives a hint where in the code the hanging occurs.
PS: There is also always the Note Configuration message from Oolite directly after the Request Connection message, but I ignore it
Re: Problem with external debug console on Mac
Posted: Sat Jan 30, 2021 11:05 pm
by maik
Another observation: If I just happily continue sending messages (the same Perform Command) every 10 seconds, Oolite continues to hang, but answers the messages correctly, until I exit the debug console. Only then the main screen comes up. Does every message send it into a new waiting state?
And one more: if I only send the Approve Connection message and then exit the debug console, the main screen comes up immediately. So breaking the connection also breaks the hang.
Re: Problem with external debug console on Mac
Posted: Mon Feb 08, 2021 1:47 pm
by maik
maik wrote: ↑Sat Jan 30, 2021 11:05 pm
Another observation: If I just happily continue sending messages (the same Perform Command) every 10 seconds, Oolite continues to hang, but answers the messages correctly, until I exit the debug console. Only then the main screen comes up. Does every message send it into a new waiting state?
And one more: if I only send the Approve Connection message and then exit the debug console, the main screen comes up immediately. So breaking the connection also breaks the hang.
I'm using the Windows version of the Oolite Debug now, everything works fine there, so it is a bug in the MacOS implementation of the debug code.
Re: Problem with external debug console on Mac
Posted: Tue Apr 06, 2021 6:12 pm
by hiran
maik wrote: ↑Mon Feb 08, 2021 1:47 pm
maik wrote: ↑Sat Jan 30, 2021 11:05 pm
Another observation: If I just happily continue sending messages (the same Perform Command) every 10 seconds, Oolite continues to hang, but answers the messages correctly, until I exit the debug console. Only then the main screen comes up. Does every message send it into a new waiting state?
And one more: if I only send the Approve Connection message and then exit the debug console, the main screen comes up immediately. So breaking the connection also breaks the hang.
I'm using the Windows version of the Oolite Debug now, everything works fine there, so it is a bug in the MacOS implementation of the debug code.
Sounds a bit like a threading problem. But I am unfamiliar both with oolite and Objective C coding...
Re: Problem with external debug console on Mac
Posted: Tue Jan 04, 2022 5:03 am
by hiran
hiran wrote: ↑Tue Apr 06, 2021 6:12 pm
maik wrote: ↑Mon Feb 08, 2021 1:47 pm
maik wrote: ↑Sat Jan 30, 2021 11:05 pm
Another observation: If I just happily continue sending messages (the same Perform Command) every 10 seconds, Oolite continues to hang, but answers the messages correctly, until I exit the debug console. Only then the main screen comes up. Does every message send it into a new waiting state?
And one more: if I only send the Approve Connection message and then exit the debug console, the main screen comes up immediately. So breaking the connection also breaks the hang.
I'm using the Windows version of the Oolite Debug now, everything works fine there, so it is a bug in the MacOS implementation of the debug code.
Sounds a bit like a threading problem. But I am unfamiliar both with oolite and Objective C coding...
Zlorfik!
I ran into the exact same problem:
https://bb.oolite.space/viewtopic.php?p=281694#p281694