fix crash in webenginepart on konqueror shutdown
ClosedPublic

Authored by jhirte on Jun 3 2019, 2:32 PM.

Details

Summary

konqueror crash on shutdown in webenginepart:

#7 GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#8 0x00007f78aa499535 in
GI_abort () at abort.c:79
#9 0x00007f78aa4f4d6f in libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7f78aa609345 "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#10 0x00007f78aa4fc8c8 in malloc_printerr (str=str@entry=0x7f78aa607491 "free(): invalid pointer") at malloc.c:5352
#11 0x00007f78aa4fe1bc in _int_free (av=<optimized out>, p=<optimized out>, have_lock=<optimized out>) at malloc.c:4181
#12 0x00007f78723ff8ec in WebEnginePartCookieJar::~WebEnginePartCookieJar (this=0x7f7872443d20 <WebEnginePart::WebEnginePart(QWidget*, QObject*, QByteArray const&, QStringList const&)::s_cookieJar>,
in_chrg=<optimized out>) at /var/tmp/portage/kde-apps/konqueror-9999/work/konqueror-9999/webenginepart/src/webenginepartcookiejar.cpp:82
#13 0x00007f78aa8bf3bc in QObjectPrivate::deleteChildren (this=this@entry=0x558557f2b6c0) at kernel/qobject.cpp:2010
#14 0x00007f78aa8c0278 in QObject::~QObject (this=<optimized out>, in_chrg=<optimized out>) at kernel/qobject.cpp:1032
#15 0x00007f7872769539 in QWebEngineProfile::~QWebEngineProfile (this=0x55855812ea70,
in_chrg=<optimized out>) at api/qwebengineprofile.cpp:321
#16 0x00007f78aa8bf3bc in QObjectPrivate::deleteChildren (this=this@entry=0x55855805dc90) at kernel/qobject.cpp:2010
#17 0x00007f78aa8c0278 in QObject::~QObject (this=<optimized out>, in_chrg=<optimized out>) at kernel/qobject.cpp:1032
#18 0x00007f78aa8c0459 in QObject::~QObject (this=0x55855805dc70,
in_chrg=<optimized out>) at kernel/qobject.cpp:891
#19 0x00007f7865995d45 in std::default_delete<QObject>::operator() (this=0x558558056118, ptr=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/include/g++-v9/bits/unique_ptr.h:75
#20 std::unique_ptr<QObject, std::default_delete<QObject> >::reset (
p=<optimized out>, this=0x558558056118) at /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/include/g++-v9/bits/unique_ptr.h:399
#21 QtWebEngineCore::WebEngineContext::destroy (this=0x5585580560f0) at /var/tmp/portage/dev-qt/qtwebengine-5.12.3/work/qtwebengine-everywhere-src-5.12.3/src/core/web_engine_context.cpp:278
#22 0x00007f7865995eb6 in QtWebEngineCore::WebEngineContext::destroyContextPostRoutine () at /var/tmp/portage/dev-qt/qtwebengine-5.12.3/work/qtwebengine-everywhere-src-5.12.3/src/core/web_engine_context.cpp:350
#23 0x00007f78aa8938b2 in qt_call_post_routines () at kernel/qcoreapplication.cpp:350
#24 0x00007f78a9c2e1f6 in QApplication::~QApplication (this=0x7ffecc49ab80, in_chrg=<optimized out>) at kernel/qapplication.cpp:795
#25 0x00007f78a397ef7c in KonquerorApplication::~KonquerorApplication (this=0x7ffecc49ab80,
in_chrg=<optimized out>) at src/kdeinit_konqueror_autogen/EWIEGA46WW/../../../../konqueror-9999/src/konqapplication.h:28
#26 0x00007f78a3a2ebcb in kdemain (argc=1, argv=0x55855778c9e0) at /var/tmp/portage/kde-apps/konqueror-9999/work/konqueror-9999/src/konqmain.cpp:158
#27 0x00005585569692ef in launch (argc=1, _name=0x558557794568 "konqueror", args=<optimized out>, cwd=<optimized out>, envc=0, envs=<optimized out>, reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x55855696badf "0") at /var/tmp/portage/kde-frameworks/kinit-9999/work/kinit-9999/src/kdeinit/kinit.cpp:706
#28 0x000055855696a430 in handle_launcher_request (sock=<optimized out>, who=<optimized out>) at /var/tmp/portage/kde-frameworks/kinit-9999/work/kinit-9999/src/kdeinit/kinit.cpp:1146
#29 0x000055855696ad04 in handle_requests (waitForPid=0) at /var/tmp/portage/kde-frameworks/kinit-9999/work/kinit-9999/src/kdeinit/kinit.cpp:1339
#30 0x0000558556965f37 in main (argc=5, argv=<optimized out>) at /var/tmp/portage/kde-frameworks/kinit-9999/work/kinit-9999/src/kdeinit/kinit.cpp:1785

fixing this by not setting QWebEngineProfile *prof = QWebEngineProfile::defaultProfile(); as parent of s_cookieJar

see also https://bugs.kde.org/show_bug.cgi?id=407454

Test Plan

start and shutdown konqueror without crash

Diff Detail

Repository
R226 Konqueror
Lint
Lint Skipped
Unit
Unit Tests Skipped
jhirte requested review of this revision.Jun 3 2019, 2:32 PM
jhirte created this revision.
dfaure requested changes to this revision.Jun 3 2019, 3:53 PM
This revision now requires changes to proceed.Jun 3 2019, 3:53 PM
jhirte added a comment.Jun 3 2019, 6:28 PM

need a hint, how I can do the requested changes

The change is correct to me.

cfeck added a subscriber: cfeck.Jun 3 2019, 7:34 PM

Please read https://community.kde.org/Infrastructure/Phabricator#Formatting_your_patch

We do not add backtraces in commit messages, but describe the change and why it is needed.

cfeck added a comment.Jun 25 2019, 5:24 PM

Any update?

dfaure accepted this revision.Jun 25 2019, 5:38 PM

Oops sorry I must have misclicked. I meant to click on approve!! Probably smartphone misuse...

Trim bt from commit log, but OK otherwise. Sorry again.

This revision is now accepted and ready to land.Jun 25 2019, 5:38 PM
This revision was automatically updated to reflect the committed changes.