[Interest] can the QRegExpEngine cache acces objects belonging to an unloaded library during global destruction?

René J. V. Bertin rjvbertin at gmail.com
Mon Jan 29 19:49:21 CET 2018


Thiago Macieira wrote:

> Qt plugins aren't. KF5 may be doing something different.

This is a platform theme plugin, it uses KF5 libraries but is not a KDE plugin. 
It gets loaded automatically by Qt, and apparently also unloaded automatically. 
If you set a breakpoint in ~QPlatformThemePlugin you'll probably see (like I) 
that you get there from QFactoryLoaderPrivate::~QFactoryLoaderPrivate().

On Linux (Mac will do the same, with the equivalent platform theme plugin):

Breakpoint 1, 0x00007fffe8ee9350 in 
QPlatformThemePlugin::~QPlatformThemePlugin()@plt ()
   from /opt/local/share/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so
(gdb) bt
#0  0x00007fffe8ee9350 in QPlatformThemePlugin::~QPlatformThemePlugin()@plt ()
   from /opt/local/share/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so
#1  0x00007fffe8efbe83 in __base_dtor  ()
    at /opt/local/var/lnxports/build/_opt_local_site-ports_Linux_kf5_kf5-plasma-
integration/kf5-plasma-integration-devel/work/kf5-plasma-
integration-5/src/platformtheme/main.cpp:25
#2  __deleting_dtor  (this=0x7ba880)
    at /opt/local/var/lnxports/build/_opt_local_site-ports_Linux_kf5_kf5-plasma-
integration/kf5-plasma-integration-devel/work/kf5-plasma-
integration-5/src/platformtheme/main.cpp:25
#3  0x00007ffff68805d6 in QLibraryPrivate::unload (this=this at entry=0x67be30, 
    flag=flag at entry=QLibraryPrivate::UnloadSys)
    at /opt/local/var/lnxports/build/_opt_local_site-ports_aqua_qt5-kde-
devel/qt5-kde-devel/work/qt-everywhere-opensource-
src-5.9.3/qtbase/src/corelib/plugin/qlibrary.cpp:562
#4  0x00007ffff68716d2 in QFactoryLoaderPrivate::~QFactoryLoaderPrivate 
(this=0x796de0, __in_chrg=<optimised out>)
    at /opt/local/var/lnxports/build/_opt_local_site-ports_aqua_qt5-kde-
devel/qt5-kde-devel/work/qt-everywhere-opensource-
src-5.9.3/qtbase/src/corelib/plugin/qfactoryloader.cpp:86
#5  0x00007ffff6871819 in QFactoryLoaderPrivate::~QFactoryLoaderPrivate 
(this=0x796de0, __in_chrg=<optimised out>)
    at /opt/local/var/lnxports/build/_opt_local_site-ports_aqua_qt5-kde-
devel/qt5-kde-devel/work/qt-everywhere-opensource-
src-5.9.3/qtbase/src/corelib/plugin/qfactoryloader.cpp:89
#6  0x00007ffff68bfb83 in cleanup (pointer=<optimised out>)
    at /opt/local/var/lnxports/build/_opt_local_site-ports_aqua_qt5-kde-
devel/qt5-kde-devel/work/qt-everywhere-opensource-
src-5.9.3/qtbase/include/QtCore/../../src/corelib/tools/qscopedpointer.h:60
#7  ~QScopedPointer (this=0x7ffff7529278 
<_ZZN12_GLOBAL__N_112Q_QGS_loader13innerFunctionEvE6holder+8>, 
    __in_chrg=<optimised out>)
    at /opt/local/var/lnxports/build/_opt_local_site-ports_aqua_qt5-kde-
devel/qt5-kde-devel/work/qt-everywhere-opensource-
src-5.9.3/qtbase/include/QtCore/../../src/corelib/tools/qscopedpointer.h:107
#8  QObject::~QObject (this=<optimised out>, __in_chrg=<optimised out>)
    at /opt/local/var/lnxports/build/_opt_local_site-ports_aqua_qt5-kde-
devel/qt5-kde-devel/work/qt-everywhere-opensource-
src-5.9.3/qtbase/src/corelib/kernel/qobject.cpp:881
#9  0x00007ffff6e0bc19 in (anonymous namespace)::Q_QGS_loader::Holder::~Holder 
(this=<optimised out>, 
    __in_chrg=<optimised out>)
    at /opt/local/var/lnxports/build/_opt_local_site-ports_aqua_qt5-kde-
devel/qt5-kde-devel/work/qt-everywhere-opensource-
src-5.9.3/qtbase/src/gui/kernel/qplatformthemefactory.cpp:51
#10 0x00007ffff6e0bc19 in operator() (this=<optimised out>) from 
/opt/local/libexec/qt5/lib/libQt5Gui.so.5
#11 (anonymous namespace)::Q_QGS_loader::innerFunction()::Holder::~Holder ()
    at /opt/local/var/lnxports/build/_opt_local_site-ports_aqua_qt5-kde-
devel/qt5-kde-devel/work/qt-everywhere-opensource-
src-5.9.3/qtbase/src/gui/kernel/qplatformthemefactory.cpp:102
#12 0x00007ffff5d351a9 in __run_exit_handlers (status=0, listp=0x7ffff60bb6c8 
<__exit_funcs>, 
    run_list_atexit=run_list_atexit at entry=true) at exit.c:82
#13 0x00007ffff5d351f5 in __GI_exit (status=<optimised out>) at exit.c:104
#14 0x00007ffff5d1af4c in __libc_start_main (main=0x408030 <main(int, char**)>, 
argc=1, argv=0x7fffffffdca8, 
    init=<optimised out>, fini=<optimised out>, rtld_fini=<optimised out>, 
stack_end=0x7fffffffdc98)
    at libc-start.c:321
#15 0x00000000004097b5 in _start ()


R.





More information about the Interest mailing list