Console app in Xojo Cloud exits with segmentation fault

Greetings all,

My Web app which launches a Shell to start a Console app (under Xojo Cloud) continues on its merry way.

It now works, thanks to Greg and Jason’s input.

However the Console app exits with a Segmentation fault at the end of its life (as reported by the Shell which launched it).

My own log of events which are of interest to me indicate the app ends normally.

The relevant last lines of the Run event in the Console app are here:-

[code]
success = writeToLog(“PretendParse End normal.”) //yes, this entry is found in the log afterwards.
return 0

Exception err as IOException
return 1 + errorCode

Exception err as NilObjectException
return 2 + errorCode

Exception err as PlatformNotSupportedException
return 3 + errorCode

Exception err as RuntimeException

If err IsA EndException Or err IsA ThreadEndException Then
  Raise err  //Re-raise the exception
else
  return 9 + errorCode
End If[/code]

I receive the following lines from the Shell at application end:-

bash: line 1: 13193 Segmentation fault ./PretendParse
Completed: error code 139

This is probably not an optimal ending.

Any thoughts ? I can send on the code for the Console app if required.

Regards,
Tony Barry
Sydney, Australia

Is your console app running out of RAM?

Hi Greg,

How would I know this ?

The app sends one smtps email. And then quits.

OK the shell command free -m will do for a start. I’ll see what happens.

Regards,
Tony Barry
Sydney, Australia

Hi Tony - I will email you an app that lets you watch memory usage.

You can use the CloudTop project included with the Xojo examples:

Examples/Xojo Cloud/CloudTop

Just Deploy it to Xojo cloud and it displays memory (as shown in this blog post).

Thank you Jason, Paul. Very good.

Regards,
Tony Barry
Sydney, Australia

Some further news on this issue.

It turns out that
IF you have a chunk of code that sends stuff through the Xojo Firewall
AND you open the firewall via a subroutine where the FW is foolishly declared locally
THEN the FW may indeed open for a little while (time not specified, probably some few seconds)

Your code may have a short time window in which to send stuff through the FW, leading you to think your port is properly open

AND when you eventually close the firewall, via another subroutine where the FW is (again) foolishly declared locally
THEN the Linux console app at exit dies with a segmentation fault instead of exiting normally.

The Firewall port opening behaviour is documented; i.e. that the FWP must remain in scope for the duration of interest, or the port will self close and cause grief.

The segmentation fault on exit is not documented as far as I can see. However, it is evident that there are many ways to kill things, and only a few to allow them to live and work in peace. A list of things not to do would be very large, and perhaps not be of use to anyone except the morbidly curious.

Thanks to Greg O’Lone, Jason Parsley, Christian Schmitz, and others for suggestions.

Regards,
Tony Barry

[quote=300882:@Tony Barry]
THEN the Linux console app at exit dies with a segmentation fault instead of exiting normally.[/quote]
I’d like to see an example of this in a feedback case because this should not be happening.

46081 - Console app in Xojo Cloud exits with segmentation fault

Project attached.

Regards,
Tony Barry
Sydney, Australia