Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.15.10
-
None
Description
I raised a question a while ago, https://bugreports.qt.io/browse/QTBUG-134402
The issue this time is its continuation
I found that the shared library cannot be hot updated because it is marked as NODELETE, use LD_DEBUG=files ./xxx , output like this,
mainwindow.cpp 101 loadone.m_ploader->loadHints() = QFlags<QLibrary::LoadHint>(ResolveAllSymbolsHint) plugin/qlibrary_unix.cpp 126 ============================================= plugin/qlibrary_unix.cpp 145 === dlFlags = 0 plugin/qlibrary_unix.cpp 149 === dlFlags = 2 plugin/qlibrary_unix.cpp 161 === dlFlags = 2 plugin/qlibrary_unix.cpp 167 === dlFlags = 2 plugin/qlibrary_unix.cpp 204 === plugin/qlibrary_unix.cpp 248 ===attempt = "/home/lzq/hot-plugin/testmain/libupgrade.so.avx2" dlFlags = 2 89768: 89768: file=/home/lzq/hot-plugin/testmain/libupgrade.so.avx2 [0]; dynamically loaded by /home/lzq/qt-src-5-15-10/qtbase-opensource-src-5.15.10+dfsg/lib/libQt5Core.so.5 [0] plugin/qlibrary_unix.cpp 248 ===attempt = "/home/lzq/hot-plugin/testmain/libupgrade.so" dlFlags = 2 89768: 89768: file=/home/lzq/hot-plugin/testmain/libupgrade.so [0]; dynamically loaded by /home/lzq/qt-src-5-15-10/qtbase-opensource-src-5.15.10+dfsg/lib/libQt5Core.so.5 [0] 89768: file=/home/lzq/hot-plugin/testmain/libupgrade.so [0]; generating link map 89768: dynamic: 0x00007fb9a8802dc8 base: 0x00007fb9a8600000 size: 0x000000000020a6b8 89768: entry: 0x00007fb9a8600000 phdr: 0x00007fb9a8600040 phnum: 9 89768: 89768: 89768: file=libQt5Sql.so.5 [0]; needed by /home/lzq/hot-plugin/testmain/libupgrade.so [0] 89768: file=libQt5Sql.so.5 [0]; generating link map 89768: dynamic: 0x00007fb9b8b30cd0 base: 0x00007fb9b8af0000 size: 0x00000000000416c8 89768: entry: 0x00007fb9b8af0000 phdr: 0x00007fb9b8af0040 phnum: 9 89768: 89768: activating NODELETE for /home/lzq/hot-plugin/testmain/libupgrade.so [0] 89768: 89768: calling init: /home/lzq/qt-src-5-15-10/qtbase-opensource-src-5.15.10+dfsg/lib/libQt5Sql.so.5 89768: 89768: 89768: calling init: /home/lzq/hot-plugin/testmain/libupgrade.so 89768: 89768: opening file=/home/lzq/hot-plugin/testmain/libupgrade.so [0]; direct_opencount=1 89768: plugin/qlibrary_unix.cpp 301 =============================================
then I wrote a demo myself, demo ran no problem,like this, no NODELETE
mainwindow.cpp 101 loadone.m_ploader->loadHints() = QFlags<QLibrary::LoadHint>(ResolveAllSymbolsHint) plugin/qlibrary_unix.cpp 126 ============================================= plugin/qlibrary_unix.cpp 145 === dlFlags = 0 plugin/qlibrary_unix.cpp 149 === dlFlags = 2 plugin/qlibrary_unix.cpp 161 === dlFlags = 2 plugin/qlibrary_unix.cpp 167 === dlFlags = 2 plugin/qlibrary_unix.cpp 204 === plugin/qlibrary_unix.cpp 248 ===attempt = "/home/lzq/hot-plugin/testmain/libqt-test-demo.so.avx2" dlFlags = 2 86828: 86828: file=/home/lzq/hot-plugin/testmain/libqt-test-demo.so.avx2 [0]; dynamically loaded by /home/lzq/qt-src-5-15-10/qtbase-opensource-src-5.15.10+dfsg/lib/libQt5Core.so.5 [0] plugin/qlibrary_unix.cpp 248 ===attempt = "/home/lzq/hot-plugin/testmain/libqt-test-demo.so" dlFlags = 2 86828: 86828: file=/home/lzq/hot-plugin/testmain/libqt-test-demo.so [0]; dynamically loaded by /home/lzq/qt-src-5-15-10/qtbase-opensource-src-5.15.10+dfsg/lib/libQt5Core.so.5 [0] 86828: file=/home/lzq/hot-plugin/testmain/libqt-test-demo.so [0]; generating link map 86828: dynamic: 0x00007f3842a0dd70 base: 0x00007f3842a09000 size: 0x00000000000050f0 86828: entry: 0x00007f3842a09000 phdr: 0x00007f3842a09040 phnum: 9 86828: 86828: 86828: calling init: /home/lzq/hot-plugin/testmain/libqt-test-demo.so 86828: 86828: opening file=/home/lzq/hot-plugin/testmain/libqt-test-demo.so [0]; direct_opencount=1 86828: plugin/qlibrary_unix.cpp 301 =============================================
I have uploaded the qlibrary_unix.cpp source code, which can be compared with the logs src.txt
I want to ask :
(1) What could cause NOELETE, now no use RTLD_NODELETE or QLIbrary::PreventUnloadHint in the code,which direction should I investigate from ? my idea is to investigate the dependency libraries, which could be the cause of the NODELETE
(2) base (1) , how to cancel NOELETE?
I hope to receive some guidance,thanks