BrainfuckIDE icon indicating copy to clipboard operation
BrainfuckIDE copied to clipboard

Hangs when given non-halting programs

Open ghost opened this issue 7 years ago • 4 comments

The IDE will hang if told to "skip to end" with a non-halting program.

Example program:

+[>+]

Actions taken: Program input, run. IDE told to "skip to end."

Expected result: IDE stops after program runs too long or otherwise indicates that it cannot be "skipped to end."

Actual result: IDE runs program at high speed, using an entire CPU core. If user attempts to stop program using the "reset everything" button, IDE hangs.

ghost avatar May 28 '18 14:05 ghost

Pull requests welcome, but I probably won't look into this at the moment. There's a lot of improvements I'd like to make, but I haven't been doing much brainfuck development or tooling lately.

wmww avatar May 29 '18 03:05 wmww

It's on the line, but I guess it is a bug.

wmww avatar May 29 '18 03:05 wmww

Hmm... looks like reset hangs even on long programs, like:

load 1000 into position 2
++++++++++
[
    >++++++++++
    [
        >++++++++++
    <-]
<-]

move to position 2
>>

move 1000 spaces to the right
[[>+<-]>-]

wmww avatar Jul 30 '18 18:07 wmww

Ah, it's a memory issue, not a logic error (as can be seen by +[+] being resetable after clicking 'skip to end' and waiting, and +[>+] being resetable if you click reset within a few moments of 'skip to end' (before the tape gets too long). I tried a simple fix, but it just broke everything. You'll have to wait for #6.

wmww avatar Jul 30 '18 19:07 wmww