hardbyte / hardbyte/python-can

CANalyst-II can't reopen device

Abierto
#1,294 6 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Python
Estrellas
1.6k
Forks
697
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hello! I use your library with CANalyst-II device and it works pretty well, thank you!
But I have one problem, first run of program is fully successful, but when I quit it and start again it throws error like:

```
msg = self.bus.recv(1)
File "/home/anton/.local/lib/python3.8/site-packages/can/bus.py", line 94, in recv
msg, already_filtered = self._recv_internal(timeout=time_left)
File "/home/anton/.local/lib/python3.8/site-packages/can/interfaces/canalystii.py", line 177, in _recv_internal
self.poll_received_messages()
File "/home/anton/.local/lib/python3.8/site-packages/can/interfaces/canalystii.py", line 157, in poll_received_messages
(channel, raw_msg) for raw_msg in self.device.receive(channel)
File "/home/anton/.local/lib/python3.8/site-packages/canalystii/device.py", line 259, in receive
assert len(rx_data) % self.MESSAGE_BUF_LEN == 0
AssertionError
free(): double free detected in tcache 2
```
If I replug device everything is Ok again.
In code it is looks like:
```python
self.bus = can.interface.Bus(bustype="canalystii", channel="0", bitrate=125000)
...
while True:
msg = self.bus.recv(1)
...
self.bus.shutdown()
```

OS and version: Kubuntu 20.04
Python version: 3.8.10
python-can version: 4.0.0
python-can interface/s: canalystii==0.1

Any ideas?

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.