hardbyte / hardbyte/python-can

CANalyst-II can't reopen device

オープン
#1,294 コメント 6 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。