Apparently the #Slurpee machine displays run on #python and #PyGame #segmentationFault
#slurpee #python #pygame #SegmentationFault
Aha, #gdb uses #c syntax, not #assembly syntax.
print *(((long long *) $rsp) + 5)
works better.
But I still don't understand what caused that #SegmentationFault
#gdb #c #assembly #SegmentationFault
I generated a SIGSEGV for my #assembly program by typing
print (long long) 40($rsp)
in #gdb
Ok, I know I expected a #SegmentationFault near that point, and my code contains
mov 40(%rsp), %rax
but the SIGSEGV should be raised a few instructions after this movq, when dereferencing a derivative of this 40(%rsp) and at both points (this gdb print and the normal SIGSEGV point) the stack pointer looks ok.
#assembly #gdb #SegmentationFault #programming #doitmyself #bug
I made all words deferred for more convenient live coding, makes recursion easier too.
The left stack (for regular evaluation) is fine, but the right stack (for local variables) overflows. The crash is because the C stack in the interpreter overflows too. The negative numbers are from signed integer overflow.
```
: fibs { a b -- b a+b } a . cr b a b + fibs ;
0 1 fibs
0
1
1
2
3
5
8
13
...
5167068349195539697
5957444661174968386
-7322231063339043533
-1364786402164075147
-8687017465503118680
8394940206042357789
ERROR: stack overflow
ERROR: stack overflow
-292077259460760891
ERROR: stack overflow
ERROR: stack overflow
8102862946581596898
Segmentation fault
```
#forth #fibonacci #stackoverflow #SegmentationFault