racket / drracket

DrRacket, IDE for Racket
http://www.racket-lang.org/
Other
455 stars 93 forks source link

DrRacket sequence-contract-violation: negative: method insert cannot be called #522

Open wilbowma opened 3 years ago

wilbowma commented 3 years ago

What version of Racket are you using? Racket 8.1 CS

What program did you run? I cannot reproduce the bug, and cannot share the student's code.

A student somehow triggered this error in DrRacket, after which DrRacket would not close, would not force quit, would not allow the laptop to restart, and had to be killed with kill -9.

It appears to have been triggered while saving the file.

What should have happened? The file should have saved, or at least, not completely borked DrRacket.

If you got an error message, please include it here.

#| DrRacket Internal Error
sequence-contract-violation: negative: method insert cannot be called, except in states (unlocked), args ";; The first three lines of this file were inserted by DrRacket. They record metadata\n;; about
the language level of this file in a form that our tools can easily process.\n#reader(lib \"htdp-intermediate-reader.ss\" \"lang\")((modname pset-08-starter... 0 0
  context...:
   /Applications/Racket v8.1/share/pkgs/drracket/drracket/private/unit.rkt:581:10: on-save-file method in ...ket/private/unit.rkt:556:8
   /Applications/Racket v8.1/share/pkgs/gui-lib/mred/private/editor.rkt:274:6: save-file method in make-editor-buffer%
   /Applications/Racket v8.1/share/pkgs/drracket/drracket/private/unit.rkt:2981:8
   /Applications/Racket v8.1/share/pkgs/drracket/drracket/private/unit.rkt:2980:6: save-all-unsaved-files method in frame-mixin
   /Applications/Racket v8.1/share/pkgs/drracket/drracket/private/unit.rkt:3388:6: on-activate method in frame-mixin
   /Applications/Racket v8.1/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:435:6
   /Applications/Racket v8.1/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:486:32
   /Applications/Racket v8.1/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:634:3
|#

Please include any other relevant details macOS

rfindler commented 3 years ago

I've transerred this to the DrRacket repo. The actual bug may be in htdp or gui but putting it here seems better for now.

rfindler commented 3 years ago

I'm having trouble seeing how this can happen from this amount of information. My best guess is that there was another thread somewhere else that was doing something to the editor (or maybe something that raised an error earlier leaving the editor in a bad state). If this was the case it would that other code that would need to be fixed, not the code that's showing up in the stack trace here.

wilbowma commented 3 years ago

I've tried to get more details from the students. They have multiple tabs open, and in one of them (but maybe not the same one as the file that was being saved), they were using the stepper. The stepper encountered an error, which was "displayed in red". After trying to reuse the stepper, the above error happened in DrRacket.

Will try to get more details.

rfindler commented 3 years ago

@jbclements can you point me to the code that the stepper uses to get ahold of the program that's in the definitions window?