Crash on EGLFS Platform After Qt 6.5 Migration During Instant Resume(App Background/Foreground Transition)
-
wrote 14 days ago last edited by
Hi all,
We're encountering a crash after migrating our Qt-based application from Qt 5.15.1 to Qt 6.5, specifically when using the EGLFS platform on an ARM device.
Background:
We have implemented a feature called "instant resume". The idea is to simulate a seamless background-to-foreground transition by hiding the application and bringing it back later—providing a smooth resume experience.Due to the EGLFS platform limitation of supporting only a single surface, we cannot keep the surface alive when the app goes to the background. As a result, we are required to release the surface and related resources, which means we must call QWindow::close() instead of QWindow::hide() when putting the app in the background, and QWindow::show() (or re-create the window) when bringing it back to the foreground.
To support this, we implemented a custom EGLFS hook that overrides the default destroyNativeWindow() behavior:
#include "private/qeglfshooks_p.h"
#include <stdio.h>QT_BEGIN_NAMESPACE
class QEglFSCustomHooks : public QEglFSHooks
{
public:
void destroyNativeWindow(EGLNativeWindowType window) override;
};void QEglFSCustomHooks::destroyNativeWindow(EGLNativeWindowType window)
{
Q_UNUSED(window);
eglTerminate(EGL_NO_DISPLAY);
}QEglFSCustomHooks eglFSCustomHooks;
QEglFSHooks *platformHooks = &eglFSCustomHooks;QT_END_NAMESPACE
With this setup, everything worked fine on Qt 5.15.1.Issue After Migration to Qt 6.5:
After upgrading to Qt 6.5, the app crashes when trying to resume (bring the app back to the foreground). Here's the backtrace:Searching frame 0 (FP=b55afd7c, PC=4201ff60)
Failed to find prior stack frame; terminating backtrace.
/usr/lib/libmali.so41db0000[4201ff60]And this message appears in the GPU logs:
[rtk][gpu] eglp_window_surface_specific_initialization: use the same native window descriptor to create egl surface!
Questions:
Is overriding destroyNativeWindow() still supported in Qt 6.5, or is there a better/recommended way to release surface resources for EGLFS?How should we safely implement "instant resume" behavior under EGLFS in Qt 6.5?
Any help, insights, or directions would be greatly appreciated!