Page 1 of 2

how do I increase the stack limit

Posted: 10 Nov 2017 16:13
by mdosnov2016
I have reached the stack limit (with 64-bit build version!).
How do I increase the stack in VP8 environment?
this is example run that was passing from 5.2 version.

Posted: 10 Nov 2017 16:20
by mdosnov2016
Exception 0xC00000FD: Stack Overflow,
at address: 0x1401F03A4 First Chance Continuable

Posted: 10 Nov 2017 22:49
by Thomas Linder Puls
I am certain there is a bug/problem in your program. We have runned numerous of programs in decades on huge datasets and we never need to increase the stack size.

The best way to track down the problem is probably in the debugger.

Posted: 11 Nov 2017 7:20
by mdosnov2016
Dear Thomas,
I have turned all of the called predicates into determ and it went a bit further but I am really in a position
that I cannot improve it further in this way.
Please give me an example of code to increase the stack.

Posted: 11 Nov 2017 8:27
by mdosnov2016
The interesting think is that now within the debugger the test passes.
But when I execute the .exe it returns an error.

Posted: 13 Nov 2017 9:54
by Thomas Linder Puls
It is always frustrating when a program works in the debugger but not in the "real" life. This most often happen for multi-threated programs where the debugger changes some timing between the threads.

Anyways, if the problem cannot be reproduced with the debugger then you will have to use non-debugger methods.

First of all: do you get an exception trace/dump?

Have you tried using shift+F2 to see the corresponding positions in your program?

Posted: 13 Nov 2017 13:28
by mdosnov2016
This is the message that I get when it crashes.

C:\let\ccc\vp8ccc\backend\Exe64>backend
HLS CCC optimization started, please wait...
===== 2017-11-13 15:28:11 =======================


----------------------------------------
Non prolog exception

TraceId = 00007FF9B3165DA4
TraceId_value = 140710428171684
nonPrologException (exception) in exception::getDescriptor_nd

----------------------------------------
OS: Windows 10.0 Build 15063

Posted: 13 Nov 2017 15:27
by mdosnov2016
I don't get an exception dump, or trace neither shift-F2 doesn't show anything

Posted: 13 Nov 2017 19:07
by Thomas Linder Puls
So the exhaustion of the stack has disappeared.

This exception is a foreign exception, i.e. comes from some non-Visual Prolog code. Try running the 32bit version of the program and see how that behaves.

Posted: 13 Nov 2017 19:29
by mdosnov2016
The 32-bit version of exe passes the test, no problem!
But how do I make the 64-bit version program to succeed as well?

Posted: 14 Nov 2017 11:10
by Thomas Linder Puls
Well, it is a bit tricky, when it works in the debugger.

I guess you will have to locate the "problem spot" using logging messages in your program.

Posted: 18 Nov 2017 6:50
by mdosnov2016
I have turned ALL predicates in my program to determ, by introducing the ! (cut) call at the end of each
clause body.

However, all of my large tests hit "stack overflow" problem, and I am left without any options.
Does anybody know any way to increase the stack?

Thank you.

Posted: 18 Nov 2017 13:08
by mdosnov2016
===== 2017-11-18 15:07:10 =======================


----------------------------------------
System exception

error code = 1
ExtraInfo = Exception C00000FD: Stack overflow
systemException (runtime_exception) in runtime_exception::runtimeExceptionRaiser

----------------------------------------
main.pro(28725)
C:\ccctst\vipKernel.dll (0x14008ADC)
C:\ccctst\vipKernel.dll (0x140064E5)
C:\Windows\SYSTEM32\ntdll.dll (0x77E26212)
C:\Windows\SYSTEM32\ntdll.dll (0x77E261E4)
C:\Windows\SYSTEM32\ntdll.dll (0x77E14166)
main.pro(28739)
main.pro(28739)
main.pro(28739)
main.pro(28739)
main.pro(28739)

Posted: 19 Nov 2017 22:21
by Thomas Linder Puls
Notice:
main.pro(28739)
main.pro(28739)
main.pro(28739)
main.pro(28739)
main.pro(28739)
Same line again and again. There is most likely no progress in this part or your code.

Re: how do I increase the stack limit

Posted: 15 Dec 2017 0:07
by mdosnov2016
I have turned all my recursive predicates into tail recursive using wrappers to call the first recursive iteration.
However, now my program exhausts the stack earlier than before and I get the following message:
C:\let\ccc\vp8ccc\backend\Exe>backend
HLS CCC optimization started, please wait...
Synthesizing module 1: getblk

Synthesizing module 2: decode_mpeg2_non_intra_block

===== 2017-12-15 01:58:31 =======================


----------------------------------------
System exception

error code = 1
ExtraInfo = Exception C00000FD: Stack overflow
systemException (runtime_exception) in runtime_exception::runtimeExceptionRaiser

----------------------------------------
main.pro(28971)
C:\let\ccc\vp8ccc\backend\Exe\vipKernel.dll (0x14008ADC)
C:\let\ccc\vp8ccc\backend\Exe\vipKernel.dll (0x140064E5)
C:\WINDOWS\SYSTEM32\ntdll.dll (0x773B9D62)
C:\WINDOWS\SYSTEM32\ntdll.dll (0x773B9D34)
C:\WINDOWS\SYSTEM32\ntdll.dll (0x773A0BF6)
main.pro(26072)
main.pro(32280)
main.pro(27268)
main.pro(30882)
main.pro(32295)
main.pro(22555)
main.pro(29139)
main.pro(30935)
main.pro(32295)
main.pro(27242)
main.pro(30882)
main.pro(32295)
main.pro(26832)
main.pro(30844)
main.pro(32295)
main.pro(27485)
main.pro(30882)
main.pro(32295)
main.pro(22555)
main.pro(28187)
main.pro(30912)
main.pro(33476)
main.pro(27074)
main.pro(30864)
main.pro(33476)
main.pro(27409)
main.pro(30882)
main.pro(32295)
main.pro(26588)
main.pro(30821)
main.pro(32095)
main.pro(33380)
main.pro(29968)
main.pro(31015)
main.pro(32295)
main.pro(26832)
main.pro(30844)
main.pro(32295)
main.pro(26832)
main.pro(30844)
main.pro(32295)
main.pro(26832)
main.pro(30844)
main.pro(32295)
main.pro(26832)
OS: Windows 10.0 Build 16299 64-bit

C:\let\ccc\vp8ccc\backend\Exe>

How do I deal with this now?