Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.0
-
None
-
Raspberry Pi 4 / Raspbian 10 / Xcb
Description
My application extensively uses QML WebEngineView components (and various other) to be instantiated on demand using `Loader`. On a long run application (actually less then 1 day on certain circumstances) crashes with:
[25627:25742:0613/181714.743607:FATAL:zygote_communication_linux.cc(91)] : Too many open files (24)
Trace/breakpoint trap (core dumped)
Following analysis reveals the fact that QML WebEngineView component doesn't clean up open file descriptors on destruction. I have prepared minimal test case to reproduce the issue, test case have 3 cases (switched via variable in `webleaks.qml` file) producing various scenarios and file descriptor leak patterns.
In order to run test, please use `qmlscene` utility because `qml` utility have no option to set AA_ShareOpenGLContext. Which in turn results into performance degradation. On the other hand descritors are not leaked (at least no so dramatically). Same behavior (poor performance/no leaks) could be achieved with `-disable-context-sharing` or `-software` options for `qmlscene` utility.
How to test:
- Modify `webleaks.qml` to set testcase.
- Run `qmlscene ./webleaks.qml`
- Check filedescriptors with: `ls -l /proc/$(pgrep -f webleaks)/fd`
There are various descriptor leaks but most of them introduced only once per application, however 2 types of descriptors leaked over time:
- /dev/shm/.org.chromium.Chromium.XXXXXX (deleted)
- anon_inode:sync_file