Crashes when using QObject::tr("") on Android
-
Hello,
For several years now, bugs have been appearing in the play console involving text translations when I use QObject::tr("")
I get the same backtraces every time:
backtrace: #00 pc 0x0000000000209cc0 /data/app/~~ZnUYoB85TnSFH3Y1dW-WlA==/net.winstars3-k4o4SxuKgg98bAOFXihUxA==/lib/arm64/libQt5Core_arm64-v8a.so (match(unsigned char const*, unsigned int, char const*, unsigned int)) #01 pc 0x0000000000209ba0 /data/app/~~ZnUYoB85TnSFH3Y1dW-WlA==/net.winstars3-k4o4SxuKgg98bAOFXihUxA==/lib/arm64/libQt5Core_arm64-v8a.so (QTranslatorPrivate::do_translate(char const*, char const*, char const*, int) const) #02 pc 0x0000000000209ba0 /data/app/~~ZnUYoB85TnSFH3Y1dW-WlA==/net.winstars3-k4o4SxuKgg98bAOFXihUxA==/lib/arm64/libQt5Core_arm64-v8a.so (QTranslatorPrivate::do_translate(char const*, char const*, char const*, int) const) #03 pc 0x00000000001e35fc /data/app/~~ZnUYoB85TnSFH3Y1dW-WlA==/net.winstars3-k4o4SxuKgg98bAOFXihUxA==/lib/arm64/libQt5Core_arm64-v8a.so (QCoreApplication::translate(char const*, char const*, char const*, int)+188) #04 pc 0x000000000015afe0 /data/app/~~ZnUYoB85TnSFH3Y1dW-WlA==/net.winstars3-k4o4SxuKgg98bAOFXihUxA==/lib/arm64/libWinStars3_arm64-v8a.so (render3D::Objets2D()+36112) #05 pc 0x00000000002896c4 /data/app/~~ZnUYoB85TnSFH3Y1dW-WlA==/net.winstars3-k4o4SxuKgg98bAOFXihUxA==/lib/arm64/libWinStars3_arm64-v8a.so (QWinStars3View::render()+3316) #06 pc 0x00000000002e16d8 /data/app/~~ZnUYoB85TnSFH3Y1dW-WlA==/net.winstars3-k4o4SxuKgg98bAOFXihUxA==/lib/arm64/libWinStars3_arm64-v8a.so (QWinStars3View::paintGL()+272) #07 pc 0x00000000001d95dc /data/app/~~ZnUYoB85TnSFH3Y1dW-WlA==/net.winstars3-k4o4SxuKgg98bAOFXihUxA==/lib/arm64/libQt5Widgets_arm64-v8a.so (QOpenGLWidgetPrivate::render())
Crashes happen rarely (<1%) but always on QObject::tr lines.
This seems to affect mainly devices running Android12 & 13...Any ideas?
Thanks!
PS: I'm using Qt 5.15.10 and NDK 21.4.7075529
-
Hi,
It's a good question but, sorry, I don't have an answer for it. However I am curious: why you are using an empty string with tr ?
-
@SGaist Hello !
Oh no, sorry, that was just an (incorrect) way of formulating the question... I always use QOject:tr with a non-empty string of course.
Here, I'm giving it a try by modifying the qtranslator.cpp file
and more specifically the function
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)
I've just added the condition
if (!found || !target) return false;
I'll let you know if I see a difference...
Thanks a lot!