Discussion:
[OpenSCAD] Error running openscad from command line
NathanA
2018-10-13 06:18:30 UTC
Permalink
Hi, I am running openscad in AWS lambda. It works often but some times it
randomly crashes. When it crashes I get return code: -4.

output: Could not initialize localization.
ECHO: "Starting up ..."

The echo statement is the first line in the openscad file. The error about
localization occurs even when it works fine so that doesn't seem to be the
problem. The code and environment doesn't change as far as I can tell
between the times it works or when it doesn't. How can I troubleshoot it?
What could cause code -4 to be returned? Is there any way I can get any more
output on why it is crashing and what I can do about it?

I am using OpenSCAD version 2017.07.31.

Thank you



--
Sent from: http://forum.openscad.org/
Marius Kintel
2018-10-13 06:30:54 UTC
Permalink
Much can go wrong with native code on Lambda.
I would look at these things:
* Build OpenSCAD yourself!
* Are you certain that OpenSCAD is built compatible with the Lambda runtime? e.g. are you linking the correct libstdc++?
* It looks like Lambda killed your process. Are you staying within your configured memory and time limits for process execution?
* You can set up docker containers for simulating lambda environments, in which you can extract more info about what’s going on. See https://github.com/lambci/docker-lambda
* Doing the last using a debug build should give you stack traces when something fails.

-Marius
NathanA
2018-10-13 19:56:07 UTC
Permalink
It works fine most of the time so it must be compatible, the problem only
happens occasionally. Lambda did not kill the process - the execution of
openscad returns "-4", quite quickly and then continues executing my code.
Lambda shows me the memory used and it is not close to the max, increasing
the memory doesn't help. What does a return value of "-4" mean?

I can't recall if I built the binary myself or downloaded a prebuilt - I did
that a while ago. The debug build with a stack trace sounds like the way to
go.

Thank you



--
Sent from: http://forum.openscad.org/
Marius Kintel
2018-10-13 20:25:14 UTC
Permalink
Post by NathanA
What does a return value of "-4" mean?
We don’t use negative return values.
A negative value usually means that the process was killed from the outside.

-Marius

Loading...