← index #8005Issue #3145
Related · high · value 2.918
QUERY · ISSUE

ussl.wrap_socket causes esp32-s2 board to crash

openby rajeeeopened 2021-11-17updated 2021-11-17

Here is a minimal reproducible code:

import usocket
import ussl
s = usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM, 0)
s.connect( ('34.196.233.7', 443))
new_s = ussl.wrap_socket(s)  # crashes

This causes a crash in ESP32-S2. It however works in ESP32.

micropython version: v1.17 on 2021-09-02.

The crash results in the following error on REPL:

Traceback (most recent call last):
  File "c:\users\rajen\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\rajen\anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\rajen\anaconda3\Scripts\mpremote.exe\__main__.py", line 7, in <module>
  File "c:\users\rajen\anaconda3\lib\site-packages\mpremote\main.py", line 414, in main
    pyb.enter_raw_repl()
  File "c:\users\rajen\anaconda3\lib\site-packages\mpremote\pyboard.py", line 337, in enter_raw_repl
    data = self.read_until(1, b"raw REPL; CTRL-B to exit\r\n>")
  File "c:\users\rajen\anaconda3\lib\site-packages\mpremote\pyboard.py", line 310, in read_until
    elif self.serial.inWaiting() > 0:
  File "c:\users\rajen\anaconda3\lib\site-packages\serial\serialutil.py", line 594, in inWaiting
    return self.in_waiting
  File "c:\users\rajen\anaconda3\lib\site-packages\serial\serialwin32.py", line 259, in in_waiting
    raise SerialException("ClearCommError failed ({!r})".format(ctypes.WinError()))
serial.serialutil.SerialException: ClearCommError failed (PermissionError(13, 'The device does not recognize the command.', None, 22))
CANDIDATE · ISSUE

esp8266: Crash on ussl.wrap_socket(None)

closedby alex-robbinsopened 2017-06-14updated 2017-06-26
import ussl
ussl.wrap_socket(None)

causes a reset. Of course, callers probably shouldn't pass None here, but I assume that it isn't supposed to be possible to crash the interpreter like this (and a TypeError should be thrown instead).

On unix, the same code causes a segfault.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied