discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Increase stack trace limit?

MH
Martin Herdieckerhoff
Tue, Jun 13, 2023 11:19 AM

Using slightly nested code I often get too shallow stack traces from
OpenSCAD (version 2021.01).

Example:

module m1(x) if(true) color("black") for(i=[0]) m2(x);
module m2(x) if(true) color("black") for(i=[0]) m3(x);
module m3(x) if(true) color("black") for(i=[0]) m4(x);
module m4(x) if(true) color("black") for(i=[0]) m5(x);
module m5(x) echo(f1());

function f1(x) = f2(x);
function f2(x) = f3(x);
function f3(x) = f4(x);
function f4(x) = f5(x);
function f5(x) = assert(x==0);

m1(0);
m1(1);

Resulting stack trace:

ERROR: Assertion '(x == 0)' failed in file stack_trace.scad, line 11
TRACE: called by 'f5' in file stack_trace.scad, line 10
TRACE: called by 'f4' in file stack_trace.scad, line 9
TRACE: called by 'f3' in file stack_trace.scad, line 8
TRACE: called by 'f2' in file stack_trace.scad, line 7
TRACE: called by 'f1' in file stack_trace.scad, line 5
TRACE: called by 'echo' in file stack_trace.scad, line 5
TRACE: called by 'm5' in file stack_trace.scad, line 4
TRACE: called by 'for' in file stack_trace.scad, line 4
TRACE: called by 'color' in file stack_trace.scad, line 4
TRACE: called by 'if' in file stack_trace.scad, line 4
TRACE: called by 'm4' in file stack_trace.scad, line 3
TRACE: called by 'for' in file stack_trace.scad, line 3

To trace down a related bug you would also need the lines 5 and 14 to be
included in the stack trace.
Is there a way to increase the number of lines in a stack trace?

Using slightly nested code I often get too shallow stack traces from OpenSCAD (version 2021.01). *Example:* module m1(x) if(true) color("black") for(i=[0]) m2(x); module m2(x) if(true) color("black") for(i=[0]) m3(x); module m3(x) if(true) color("black") for(i=[0]) m4(x); module m4(x) if(true) color("black") for(i=[0]) m5(x); module m5(x) echo(f1()); function f1(x) = f2(x); function f2(x) = f3(x); function f3(x) = f4(x); function f4(x) = f5(x); function f5(x) = assert(x==0); m1(0); m1(1); *Resulting stack trace:* ERROR: Assertion '(x == 0)' failed in file stack_trace.scad, line 11 TRACE: called by 'f5' in file stack_trace.scad, line 10 TRACE: called by 'f4' in file stack_trace.scad, line 9 TRACE: called by 'f3' in file stack_trace.scad, line 8 TRACE: called by 'f2' in file stack_trace.scad, line 7 TRACE: called by 'f1' in file stack_trace.scad, line 5 TRACE: called by 'echo' in file stack_trace.scad, line 5 TRACE: called by 'm5' in file stack_trace.scad, line 4 TRACE: called by 'for' in file stack_trace.scad, line 4 TRACE: called by 'color' in file stack_trace.scad, line 4 TRACE: called by 'if' in file stack_trace.scad, line 4 TRACE: called by 'm4' in file stack_trace.scad, line 3 TRACE: called by 'for' in file stack_trace.scad, line 3 To trace down a related bug you would also need the lines 5 and 14 to be included in the stack trace. Is there a way to increase the number of lines in a stack trace?
TP
Torsten Paul
Tue, Jun 13, 2023 11:26 AM

On 13.06.23 13:19, Martin Herdieckerhoff wrote:

Is there a way to increase the number of lines in a stack trace?

There's an entry in Preferences (Advanced) for that. I have not tried
it myself yet.

ciao,
Torsten.

On 13.06.23 13:19, Martin Herdieckerhoff wrote: > Is there a way to increase the number of lines in a stack trace? There's an entry in Preferences (Advanced) for that. I have not tried it myself yet. ciao, Torsten.
MH
Martin Herdieckerhoff
Tue, Jun 13, 2023 2:02 PM

Am 13.06.2023 um 13:26 schrieb Torsten Paul:

On 13.06.23 13:19, Martin Herdieckerhoff wrote:

Is there a way to increase the number of lines in a stack trace?

There's an entry in Preferences (Advanced) for that. I have not tried
it myself yet.

ciao,
  Torsten.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I can not find any related setting in my German OpenSCAD GUI:

Which is it? Was is incorrectly translated?

Am 13.06.2023 um 13:26 schrieb Torsten Paul: > On 13.06.23 13:19, Martin Herdieckerhoff wrote: >> Is there a way to increase the number of lines in a stack trace? > > There's an entry in Preferences (Advanced) for that. I have not tried > it myself yet. > > ciao, >   Torsten. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org I can not find any related setting in my German OpenSCAD GUI: Which is it? Was is incorrectly translated?
JB
Jordan Brown
Tue, Jun 13, 2023 2:21 PM

Must be in a later development snapshot.

It's in the "OpenSCAD Language Features" block.

Must be in a later development snapshot. It's in the "OpenSCAD Language Features" block.
MH
Martin Herdieckerhoff
Tue, Jun 13, 2023 3:19 PM

Am 13.06.2023 um 16:21 schrieb Jordan Brown:

Must be in a later development snapshot.

It's in the "OpenSCAD Language Features" block.


OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org

Thank you! I found the trace depth setting in the current development
snapshot OpenSCAD-2023.06.13 and it worked as expected.

Am 13.06.2023 um 16:21 schrieb Jordan Brown: > Must be in a later development snapshot. > > It's in the "OpenSCAD Language Features" block. > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org Thank you! I found the trace depth setting in the current development snapshot OpenSCAD-2023.06.13 and it worked as expected.