7ca82250e0
We know that all lines from /proc/<PID>/maps end in a newline, so we trim exactly that one byte, then we put it all back together with .join('\n') to check if we've read the entire file. Linux virtual files are usually served in 4 kB increments; tst_qfile's maps file is about 16000 bytes for me, just short of the QIODevice buffer: [pid 414315] read(5, "55c6afe04000-55c6afe11000 r--p 0"..., 16384) = 4049 [pid 414315] read(5, "7f215fd25000-7f215fd26000 r--p 0"..., 12335) = 4038 [pid 414315] read(5, "7f2160800000-7f21608c7000 r--p 0"..., 8297) = 4072 [pid 414315] read(5, "7f216119f000-7f21611a0000 rw-p 0"..., 4225) = 3994 It is not a coincidence that the reads are at line boundaries, though it's not a guarantee from the kernel. We appear to have accidentally fixed the QEMU emulation bug by reading another process' /proc/<PID>/maps (hypothesis: QMU emulates the target system in /proc/self, hiding itself in maps, but makes no translation for other process map files. Change-Id: Ifbf974a4d10745b099b1fffd1777ac919b12dc90 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> |
||
---|---|---|
.github/workflows | ||
bin | ||
cmake | ||
coin | ||
config.tests | ||
dist | ||
doc | ||
examples | ||
lib | ||
libexec | ||
LICENSES | ||
mkspecs | ||
qmake | ||
src | ||
tests | ||
util | ||
.cmake.conf | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.tag | ||
CMakeLists.txt | ||
config_help.txt | ||
configure | ||
configure.bat | ||
configure.cmake | ||
dependencies.yaml | ||
qt_cmdline.cmake |