Previous Up Next

C.2  Stack Overflows

When a stack overflows, the system performs an exit_block/1 with an appropriate exit tag, ie.
global_trail_overflow
for overflows of the global/trail stack that holds all the program's data structures.
local_control_overflow
for overflows of the local/control stack that holds information related to the control flow.
These exits can be caught by wrapping a goal that is likely to overflow the stacks into an appropriate block/3, e.g.
..., block(big_goal(X), global_trail_overflow, react_to_overflow), ...
In the debugger, you can locate the overflow by jumping to a LEAVE port (z command). See chapter 19 for more details on memory usage.


Previous Up Next