cseiler · @cs
416 followers · 7711 posts · Server mastodon.sdf.org

Apparently the machine displays run on and

#slurpee #python #pygame #SegmentationFault

Last updated 1 year ago

Aha, uses syntax, not syntax.
print *(((long long *) $rsp) + 5)
works better.
But I still don't understand what caused that

#gdb #c #assembly #SegmentationFault

Last updated 2 years ago

I generated a SIGSEGV for my program by typing
print (long long) 40($rsp)
in

Ok, I know I expected a 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

Last updated 2 years ago

claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

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

Last updated 5 years ago