-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault when running native random.bf #4
Comments
Thanks for opening an issue, will investigate |
If it helps, I ran the BF file here (with "Memory overflow behaviour" set to "abort") The interpreter shows this
I also tried go run . --d-dump-ir examples/random.bf to see the generated C code, but couldn't find anything wrong |
Totally forgot this was here. I tried testing this using the interpreter, which doesn't do any preprocessing at all. Here's the output of
Go panics with the message: I run the following tests in all optimization options (
So it's most definitely an index out of bounds situation. The solutionI'm inclined to think doing a simple |
I agree with the latter patch. The wrapping behavior is "non-standard" so it should be chosen explicitly. If I have time, I'll try debugging the code once again, to find a fix rather than a patch. Perhaps ChatGPT could help. I've used CGPT on some other code, and it was kinda decent at finding bugs (except for something "simple", like properly handling |
Repro:
cd
into repo rootgo run . examples/random.bf
./random
This is the output on my sys:
I tried piping it to
xxd
but got no output. Tried redirecting to a file, still no output (but this time, it only prints "Segmentation fault (core dumped)")OS+DE: Linux Mint 21 Cinnamon
Device: Dell Inspiron 15R
Terminal: VScode built-in term (haven't tested in GNOME term)
The text was updated successfully, but these errors were encountered: