Menu

#22 Infinite Loop Halting

closed
5
2003-01-21
2003-01-20
Anonymous
No

Is there a way to stop execution in the case of an
infinite loop or just something that runs too long?

I'm using WinXP and right now I'm using task manager
and killing Dr.Java, and then killing the javaw.exe
process when this happens.

Discussion

  • Eric E. Allen

    Eric E. Allen - 2003-01-21

    Logged In: YES
    user_id=429660

    You can stop execution during an infinite loop by resetting interactions, via the "reset" button or menu command.

    -- Eric

     
  • Eric E. Allen

    Eric E. Allen - 2003-01-21
    • assigned_to: nobody --> eallen
    • status: open --> closed
     
  • Robert Cartwright

    Logged In: YES
    user_id=430590

    The interactions pane runs in a separate JVM. As Eric stated,
    executing the "reset" command breaks infinite loops in the
    interactions JVM. It accomplishes this task by killing the
    interactions JVM and starting a new interactions JVM.

    -- Corky

     
  • dying3000

    dying3000 - 2005-09-14

    Logged In: YES
    user_id=1344656

    How to reset a program like following??? We cannot press the
    "reset" button while the programming is waiting for input.

    import java.util.*;

    public class test {
    public static void main(String[] args) {
    int count = 0;
    Scanner in = new Scanner(System.in);
    while (true) {
    System.err.println(count++);
    in.nextLine();
    }
    }
    }

     
  • Robert Cartwright

    Logged In: YES
    user_id=430590

    This is a new bug (introduced when we refactored DrJava to
    support highlighting in the interactions pane) which we hope
    to fix soon. We were not aware of this bug until recently
    because we never use console input in our courses.
    Resetting the interactions pane will break non-terminating
    computations but the console I/O sets a lock which prevents
    resetting from working.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.