Problem with external debug console on Mac

Discussion and announcements regarding the Mac port… er, original version of Oolite.

Moderators: another_commander, winston

User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2020
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Problem with external debug console on Mac

Post 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:
  1. Download the latest debug build of Oolite
  2. Install the python package manager pip, from Terminal: sudo python -m ensurepip --default-pip
  3. Install the Twisted library for python, from Terminal: sudo pip install twisted
  4. Install the Service Identity library for python, from Terminal: sudo pip install service_identity
  5. 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
  6. 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?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6547
Joined: Wed Feb 28, 2007 7:54 am

Re: Problem with external debug console on Mac

Post 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.
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2020
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Problem with external debug console on Mac

Post 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.
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2020
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Problem with external debug console on Mac

Post 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.
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2020
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Problem with external debug console on Mac

Post by maik »

Is this actually a Mac problem? Is someone successfully using the simple Debug Console (pySimpleConsole)?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6547
Joined: Wed Feb 28, 2007 7:54 am

Re: Problem with external debug console on Mac

Post 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.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6547
Joined: Wed Feb 28, 2007 7:54 am

Re: Problem with external debug console on Mac

Post 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.
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2020
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Problem with external debug console on Mac

Post 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 :)
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6547
Joined: Wed Feb 28, 2007 7:54 am

Re: Problem with external debug console on Mac

Post 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.
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1377
Joined: Thu Aug 27, 2015 4:24 pm

Re: Problem with external debug console on Mac

Post by cbr »

Spawned a few asteroids while paused inside the station ;)
Image

Yep, pySimpleConsole.py still works on this pc, trunk 1.91, linux...
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2020
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Problem with external debug console on Mac

Post 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 :)
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2020
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Problem with external debug console on Mac

Post 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.
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2020
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Problem with external debug console on Mac

Post 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.
User avatar
hiran
Theorethicist
Posts: 2027
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Problem with external debug console on Mac

Post 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...
Sunshine - Moonlight - Good Times - Oolite
User avatar
hiran
Theorethicist
Posts: 2027
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Problem with external debug console on Mac

Post 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
Last edited by hiran on Tue Jan 04, 2022 11:56 am, edited 1 time in total.
Sunshine - Moonlight - Good Times - Oolite
Post Reply