TsLib *** stack smashing detected *** Qt 6.10.2/6.11
-
I have a BeagleBone Black with the 2026-02-12 13.3 which has gcc 14.3 and glibc enabled -fstack-protector and when I cross-compile Qt6.10.2 or Qt6.11 and I want to use LinuxFB with tslib after the first touch I have a crash with 'stack smashing detected' segfault.
I have found out that the problem is with the linker linking with a different version of tslib. But I can not prove that because my sysroot is up to date I am sure of that.
But after some investigation I have found out that in qtbase/src/platformsupport/input/tslib/qtslib.cpp:61 ther is a ts_sample sample; variable which causes the problem.
And after I moved this variable outside the function as:
static ts_sample sample; before the function declaration,
and stops being a stack variable.
The problem goes away.How can I determine that the compiled libtslibplugin.so is compiled with which libts library ?
If there is a way at all...Thank you!
-
It's for sure a
tslibmismatch between host and target.This should work to show the current version.
ts_print_raw --version dpkg -l libts* -
I made some more digging and I found that it helps
qtbase/src/platformsupport/input/tslib/qtslib.cpp:58void QTsLibMouseHandler::readMouseData() { static ts_sample sample; while (get_sample(m_dev, &sample, m_rawMode)) {and also works this:
void QTsLibMouseHandler::readMouseData() { ts_sample sample; qCDebug(qLcTsLib) << "hello"; while (get_sample(m_dev, &sample, m_rawMode)) {but why !?