Stack smashing in gamatronic driver
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nut (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
The gamatronic UPS driver in nut 2.7.4-14ubuntu2 randomly crashes after a memory violation attempt. This usually happens after many hours of operation, typically after 20h or more, and started after the update to jammy. No similar problems happened on focal.
116159.602986 UPS<--PC: "0,599,
116159.603047 PC-->UPS: "^P003ST5"
116159.603130 send returned: 8
116160.836034 UPS<--PC: "0,0,0,
116160.836062 PC-->UPS: "^P003ST1"
116160.836143 send returned: 8
116162.085828 UPS<--PC: "0,0,0,
116162.085881 PC-->UPS: "^P003ST4"
116162.085973 send returned: 8
116163.308513 UPS<--PC: "600,1,
116163.308537 PC-->UPS: "^P003ST2"
116163.308614 send returned: 8
116164.513013 UPS<--PC: "000,1,
116164.513076 PC-->UPS: "^P003ST3"
116164.513159 send returned: 8
116165.785520 UPS<--PC: "0,599,
*** stack smashing detected ***: terminated
Aborted
Broadcast message from nut@hiccup (somewhere) (Mon May 30 16:49:10 2022):
Communications with UPS nhs@localhost lost
The driver is being used with the following device:
device.mfr: NHS Sistemas de Energia
device.model: PDV SENOIDAL 1400 VA
device.type: ups
driver.name: gamatronic
driver.
driver.
driver.
driver.version: 2.7.4
driver.
Additional contextual information:
Description: Ubuntu 22.04 LTS
Release: 22.04
nut-server:
Installed: 2.7.4-14ubuntu2
Candidate: 2.7.4-14ubuntu2
Version table:
*** 2.7.4-14ubuntu2 500
500 http://
100 /var/lib/
What you expected to happen: process not crashing
What happened instead: process crashed (boo)
Thanks for reporting this bug Claudio.
As you might have expected I was not able to reproduce it locally. After checking the the core dump, we can see the crash happened when executing the sec_poll function in drivers/ gamatronic. c file. I went through the upstream history of this file and I found some commits in the latest version (2.8.0) which might fix this issue for you.
Since version 2.8.0 is not even in Debian yet, I prepared a "dirty" package (removed some docs and manpages) and put it in this PPA:
https:/ /launchpad. net/~lucaskanas hiro/+archive/ ubuntu/ nut
Could you please try to test it and see if it fixes this issue for you? If yes, we can try to dig into those upstream commits and then find what is needed to SRU to jammy.