StackThreads/MP: version 0.77 User's Guide
Q: When I ran a program compiled via stgcc
, I got a segmentation
fault. Why?
A: Ninty nine times out of hundred, it is not my fault :-) Here is some possible ways to isolate the problem.
gcc
if possible (by commenting out all StackThreads/MP primitives).
M-x gdb
command, because an arrow displays the location of the
offending instruction).
If this is the case, you can increase the stack size by giving -ss S
option to your program, where S specifies a stack size in bytes
(-ss S
is automatically recognized by StackThreads/MP
runtime. See Command Line Options Common for All StackThreadsMP Programs for details). S can be a number or a number followed by a
k
(for Kbytes) or m
(for Mbytes). For example, -ss 4m
sets the stack size of each worker to 4Mbytes.
Also See Stacks and Contexts for examining stack size at various program points.