Open bill88t opened 1 year ago
Got backtrace:
? 0x420968c6:0x3fceaf60 0x420976a1:0x3fceaf80 0x420992f6:0x3fceafb0 0x4209e32a:0x3fceb020 0x420a1fee:0x3fceb050 0x42093d91:0x3fceb070
0x420968c6: tcp_pcb_num_cal at /home/bill88t/git/circuitpython/ports/espressif/esp-idf/components/lwip/lwip/src/core/tcp.c:1875
0x420976a1: tcp_pcb_num_cal at /home/bill88t/git/circuitpython/ports/espressif/esp-idf/components/lwip/lwip/src/core/tcp.c:1888
(inlined by) tcp_alloc at /home/bill88t/git/circuitpython/ports/espressif/esp-idf/components/lwip/lwip/src/core/tcp.c:1896
0x420992f6: tcp_listen_input at /home/bill88t/git/circuitpython/ports/espressif/esp-idf/components/lwip/lwip/src/core/tcp_in.c:663
(inlined by) tcp_input at /home/bill88t/git/circuitpython/ports/espressif/esp-idf/components/lwip/lwip/src/core/tcp_in.c:380
0x4209e32a: ip4_input at /home/bill88t/git/circuitpython/ports/espressif/esp-idf/components/lwip/lwip/src/core/ipv4/ip4.c:803
0x420a1fee: ethernet_input at /home/bill88t/git/circuitpython/ports/espressif/esp-idf/components/lwip/lwip/src/netif/ethernet.c:186
0x42093d91: tcpip_thread_handle_msg at /home/bill88t/git/circuitpython/ports/espressif/esp-idf/components/lwip/lwip/src/api/tcpip.c:180
(inlined by) tcpip_thread at /home/bill88t/git/circuitpython/ports/espressif/esp-idf/components/lwip/lwip/src/api/tcpip.c:154
I will try to debug it.
This is not something I can do much with.
I think blocking .bind()
on an already bound socket is the only way around this.
On standard Python, the 2nd bind call is an exception, because a socket can only be bound to one address:
>>> s.bind(("0.0.0.0", 20000))
>>> s.bind(("0.0.0.0", 20001))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument
Can I go ahead and implement the bind lock?
If a bind goes thorough, set the lock at true. If the lock is true, raise OSError(22) on another bind.
With the new bind logic this no longer produces a safemode but just irregular behavior.
CircuitPython version
Code/REPL
Behavior
Connect on p20 with telnet telnet: Unable to connect to remote host: Connection refused Connect on p21 with telnet board safemodes 50% of the time, if you ^C and retry the telnet connection it crashes 100% though telnet: Unable to connect to remote host: Connection refused
Description
No response
Additional information
No response