-
Notifications
You must be signed in to change notification settings - Fork 970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async serial crc check may hang #2606
Comments
Please add a debug log as pr issue template, so we can see the frame causing the problem. Without knowing the frame, we have no idea what the problem might be...there are no infinite loops in the crc calculation. |
This is the loop:
it is hard to see how that can cause a system to freeze, unless there was some really big data was received. Also you are using an old version v3.8.6 is the latest, but I am not sure there are no changes relevant to your problem. |
It is more likely that the problem is not in the crc calculation but that pymodbus receives data continuously, a debug log will show thst clearly. |
i never send another request before a response or timeout is received. |
pymodbus have a simple call to activate the debug log the rest is just redirecting the output. And if it's the first and only request, it should be easy to catch. Anyhow without a debug log it is quite impossible to help. Did you try to run the spy multiple times fast, to see if pymodbus is really stuck in crc or it's a bigger loop. |
ubuntu 20.4 on arm, python3.9, pymodbus 3.8.2
got stuck into CRC calculation (pymodbus/framer/rtu.py)? 100% CPU, everything frozen. happens daily under heavy load.
(venv_pymodbus3) root@K20kyte:~/pyapp# py-spy dump --pid 82492
Process 82492: python3 /root/pyapp/iomain3.py
Python v3.9.5 (/usr/bin/python3.9)
Thread 0x7F7D26E010 (active+gil): "MainThread"
compute_CRC (pymodbus/framer/rtu.py:156)
check_CRC (pymodbus/framer/rtu.py:142)
decode (pymodbus/framer/rtu.py:122)
_processIncomingFrame (pymodbus/framer/base.py:94)
processIncomingFrame (pymodbus/framer/base.py:76)
callback_data (pymodbus/transaction/transaction.py:187)
datagram_received (pymodbus/transport/transport.py:338)
data_received (pymodbus/transport/transport.py:304)
intern_read_ready (pymodbus/transport/serialtransport.py:134)
_run (asyncio/events.py:80)
_run_once (asyncio/base_events.py:1890)
run_forever (asyncio/base_events.py:596)
run_until_complete (asyncio/base_events.py:629)
(iomain3.py:345)
Thread 0x7F6E05A1E0 (active): "asyncio_0"
_worker (concurrent/futures/thread.py:75)
run (threading.py:892)
_bootstrap_inner (threading.py:954)
_bootstrap (threading.py:912)
The text was updated successfully, but these errors were encountered: