MCJack123 / craftos2

A fast, modern, and feature-filled ComputerCraft emulator written in C++.

Home Page:https://www.craftos-pc.cc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Repeated Websocket.close calls crash the computer thread

MineRobber9000 opened this issue · comments

Describe the bug
As the title indicates, repeatedly attempting to close a websocket crashes the computer thread.

To Reproduce
Steps to reproduce the behavior:

  1. Create a websocket pointing to some URL (example: wss://ccws.skystuff.cc/connect/foobar)
  2. Close it.
  3. Repeat from step 2.

Expected behavior
Nothing should happen. The close method in actual CC:Tweaked 1.106.1 (the version CraftOS-PC claims to be) never calls checkOpen so the attempt to use a closed file error should never appear, and the computer thread should certainly not crash.

Actual behavior
The first time, it closes cleanly. The second time, an error is raised for an operation on a closed file. The third time, the computer thread crashes with the exception "Exception on computer thread: device or resource busy: device or resource busy".

Environment (please complete the following information):

  • OS: Windows 11 Home
  • OS Version: 22H2
  • CraftOS-PC Version: v2.7.5
  • Compiled from source? No