linux-surface / iptsd

Userspace daemon for Intel Precise Touch & Stylus
GNU General Public License v2.0
86 stars 39 forks source link

Possible race condition suspicion that cause new instance of iptsd failed instantly #97

Closed NP-chaonay closed 1 year ago

NP-chaonay commented 1 year ago

https://github.com/quo/ithc-linux/issues/20#issuecomment-1324708779

This is cause why I created this issue Brief: StollD wonder if race condition cause the problem that: when ithc is restarted, why the new instance of iptsd (which instanced when ithc is inserted to kernel and found the ithc device) is failed (when ithc restarted, it seem that old iptsd is exited itself normally) , but ithc is working but seem have something locking thus making touch don't work.

StollD commented 1 year ago

Please add the following line to the bottom of the iptsd service file (/usr/lib/systemd/system/iptsd@.service):

LimitCORE=infinity

Then reboot, and reproduce the crash by reloading the module when iptsd is active. After it has crashed, coredumpctl list iptsd should show an entry. Export it by running coredumpctl dump iptsd > iptsd.core and upload the iptsd.core file.

NP-chaonay commented 1 year ago

oh I for got to mention that not only that heppn on suspen related stuff problem

but when I do rmmod ithc >> modprobe ithc

ithc work + iptsd crashed like before

I have to attmpet re start iptsd.

Please add the following line to the bottom of the iptsd service file (/usr/lib/systemd/system/iptsd@.service):

ok I will do that on normal rmmod / modprobe of ithc

no any suspend related action to reduce problem debugging complexity

NP-chaonay commented 1 year ago

Test result will appeared here in-place (test done)

Result: done see here and below

btw I found that it is not always that it making problem but instead having iptsd running normally

this confirm that race condition may possible

NP-chaonay commented 1 year ago

iptsd-core.zip

ok since I have make it failed, I found that coredumpctl is not installed as Ubuntu using apport (install coredumpctl required me to temporary unsintall apport / apport-gtk)

so I install it but when I list coredump, it not found that failure so...

and then when I try >5x rmmod ithc >> modprobe ithc; it dont fail iptsd

but when run command sudo libinput debug-gui multiple time

it failed and having this core dump

IMO: I think about buffer stuff overflow/underrun idk and may also same for the first failure I mentioned in this comment

StollD commented 1 year ago

Dammit, I forgot one critical step: You need to build and install iptsd with debug symbols. Otherwise the coredump wont be compatible with the debug build on my machine.

apt uninstall iptsd
meson build -Dbuildtype=debugoptimized
ninja -C build
sudo meson install -C build --skip-subprojects
StollD commented 1 year ago

Alternatively you could try the packages that are building right now. These should hopefully make the packaged binaries compatible with my local builds.

NP-chaonay commented 1 year ago

@StollD it is possible that I using older version somewhere in commit Nov?

and cause the problem, but fixed later in recent commit

NP-chaonay commented 1 year ago

cannot reproduce at this moment and I give up

so If I found symptom then I will reopen

PS: I leave coredump and debug symbol iptsd remainning for keep core dump