hardbyte / hardbyte/python-can

CANalyst-II can't reopen device

未关闭
#1,294 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Python
星标
1.6k
派生
697
PR 合并指标
30 天内没有已合并 PR

描述

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?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。