diff options
Diffstat (limited to 'js/scripting-lang/baba-yaga-c/ROADMAP.md')
-rw-r--r-- | js/scripting-lang/baba-yaga-c/ROADMAP.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/js/scripting-lang/baba-yaga-c/ROADMAP.md b/js/scripting-lang/baba-yaga-c/ROADMAP.md index e827ff3..963c46f 100644 --- a/js/scripting-lang/baba-yaga-c/ROADMAP.md +++ b/js/scripting-lang/baba-yaga-c/ROADMAP.md @@ -75,6 +75,27 @@ All advanced features including partial application are now working. **Task 3.1**: Fix Test 22 parser edge case to achieve 26/27 tests passing **Task 3.2**: Fix Integration Test 02 file reading issue to achieve 27/27 tests passing +## **Integration Test 02 Segfault Investigation** + +### Findings So Far +- Recursive function calls (e.g., `factorial 5`) cause a segmentation fault **only when run from a file**, not when piped via `cat` or `echo`. +- Non-recursive function calls, arithmetic, and function definitions all work as expected. +- The segfault occurs instantly, not after deep recursion (not a stack overflow). +- The function is defined in the global scope, and recursive lookup should work. +- The bug is **not** in the recursion logic itself. + +### Hypothesis +- The root cause is likely a memory or buffer issue in file reading, string handling, or tokenization. +- There may be a difference in how the source buffer is loaded from a file vs. piped input (e.g., BOM, encoding, or invisible characters). + +### Next Steps +1. Add debug output to print the raw contents of the buffer loaded by `read_file()` for `tests/integration_02_pattern_matching.txt` before it is passed to the interpreter. +2. Compare the buffer content from file vs. piped input. +3. Check for buffer overflows, uninitialized memory, or off-by-one errors in file reading and tokenization. +4. Check for non-ASCII, BOM, or invisible characters in the test file. + +--- + ## Technical Notes ### **Partial Application Implementation** |