Skip to content

consistent segmentation fault pforth #212

@BlameTroi

Description

@BlameTroi

Just working through learn x in y minutes for Forth. This is a build on an M2 Mac. The following consistently seg faults:

5 6 4 >r swap r> .s

No core dump that I can find. I attached to the pforth process from lldb and I got the following, but I suspect it's not very informative:

`pforth banner:

PForth V2.1.1, LE, built Nov 2 2025 12:50:11
pForth loading dictionary from file pforth.dic
File format version is 13
Name space size = 120000
Code space size = 300000
Entry Point = 0
Cell Size = 8
Little Endian Dictionary

lldb:

Process 69624 stopped

  • thread 1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x11ddffff8)
    frame #0: 0x0000000104a01a60 pforthpfCatch + 1944 pforthpfCatch:
    -> 0x104a01a60 <+1944>: str x24, [x20, #-0x8]!
    0x104a01a64 <+1948>: ldr x24, [x27], #0x8
    0x104a01a68 <+1952>: cbnz x22, 0x104a01374 ; <+172>
    0x104a01a6c <+1956>: b 0x104a01378 ; <+176>
    Target 0: (pforth) stopped.
    (lldb) bt
  • thread 1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x11ddffff8)
    • frame 0: 0x0000000104a01a60 pforthpfCatch + 1944 frame 1: 0x0000000104a06be8 pforthffInterpret + 104
      frame 2: 0x0000000104a070e0 pforthffOuterInterpreterLoop + 108 frame 3: 0x0000000104a00d1c pforthpfQuit + 40
      frame 4: 0x0000000104a01208 pforthpfDoForth + 828 frame 5: 0x0000000104a03350 pforthmain + 256
      frame 6: 0x0000000196d5eb98 dyldstart + 6076 (lldb)

Doing things over multiple lines, the segmentation fault occurs on >r.

I was able to use r@ to get a do loop's index value.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions