Bug 484927 - Crash in LinkPreviewer
Summary: Crash in LinkPreviewer
Status: RESOLVED FIXED
Alias: None
Product: NeoChat
Classification: Applications
Component: General (show other bugs)
Version: git master
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Tobias Fella
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-02 13:40 UTC by Carl Schwan
Modified: 2024-07-02 15:26 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Crash (69.53 KB, text/vnd.kde.kcrash-report)
2024-07-02 15:06 UTC, Nate Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carl Schwan 2024-04-02 13:40:34 UTC
SUMMARY


STEPS TO REPRODUCE
1. No idea, just a random crash

OBSERVED RESULT

Backtrace:

#0  0x00007f7100e470d2 in long long indexOf<QLatin1String>(QExplicitlySharedDataPointer<QCborContainerPrivate> const&, QLatin1String, bool*) () at /lib64/libQt6Core.so.6
#1  0x00007f7100e4789d in QJsonObject::value(QLatin1String) const () at /lib64/libQt6Core.so.6
#2  0x00007f710457e8af in QJsonObject::operator[] (this=0x8d55fc8, key="event_id") at /usr/include/qt6/QtCore/qjsonobject.h:61
#3  0x00007f71046b1de0 in Quotient::RoomEvent::id (this=0x8d55fc0) at /home/carl/kde6/src/libquotient/Quotient/events/roomevent.cpp:24
#4  0x000000000080ceb7 in operator() (__closure=0x3277770, newEvent=0xc8335b0) at /home/carl/kde6/src/neochat/src/linkpreviewer.cpp:30
#5  0x000000000080e81d in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<const Quotient::RoomEvent*>, void, LinkPreviewer::LinkPreviewer(const NeoChatRoom*, const Quotient::RoomMessageEvent*, QObject*)::<lambda(const Quotient::RoomEvent*)> >::call(struct {...} &, void **) (f=..., arg=0x7ffeb4fccad0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:137
#6  0x000000000080e7b5 in QtPrivate::Functor<LinkPreviewer::LinkPreviewer(const NeoChatRoom*, const Quotient::RoomMessageEvent*, QObject*)::<lambda(const Quotient::RoomEvent*)>, 1>::call<QtPrivate::List<Quotient::RoomEvent const*>, void>(struct {...} &, void *, void **) (f=..., arg=0x7ffeb4fccad0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:339
#7  0x000000000080e6c0 in QtPrivate::QCallableObject<LinkPreviewer::LinkPreviewer(const NeoChatRoom*, const Quotient::RoomMessageEvent*, QObject*)::<lambda(const Quotient::RoomEvent*)>, QtPrivate::List<const Quotient::RoomEvent*>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1, this_=0x3277760, r=0xd4b8890, a=0x7ffeb4fccad0, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:522
#8  0x00007f7100e02011 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt6Core.so.6
#9  0x00007f7104623a26 in Quotient::Room::replacedEvent (this=0x98c8df0, _t1=0xc8335b0, _t2=0x8acd250) at /home/carl/kde6/src/libquotient/build/QuotientQt6_autogen/include/moc_room.cpp:3429
#10 0x00007f71046380a9 in Quotient::Room::Private::processReplacement (this=0x98c8ea0, newEvent=...) at /home/carl/kde6/src/libquotient/Quotient/room.cpp:2833
#11 0x00007f7104638a70 in Quotient::Room::Private::addNewMessageEvents (this=0x98c8ea0, events=...) at /home/carl/kde6/src/libquotient/Quotient/room.cpp:2917
#12 0x00007f710462f7e2 in Quotient::Room::updateData (this=0x98c8df0, data=..., fromCache=false) at /home/carl/kde6/src/libquotient/Quotient/room.cpp:1953
#13 0x00007f71045b0068 in operator() (__closure=0xe8fc2d0) at /home/carl/kde6/src/libquotient/Quotient/connection.cpp:553
#14 0x00007f71045c207c in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, Quotient::Connection::Private::consumeRoomData(Quotient::SyncDataList&&, bool)::<lambda()> >::call(struct {...} &, void **)
    (f=..., arg=0x7f6ffc1fc0a8) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:137
#15 0x00007f71045c166d in QtPrivate::Functor<Quotient::Connection::Private::consumeRoomData(Quotient::SyncDataList&&, bool)::<lambda()>, 0>::call<QtPrivate::List<>, void>(struct {...} &, void *, void **) (f=..., arg=0x7f6ffc1fc0a8)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:339
#16 0x00007f71045c05c2 in QtPrivate::QCallableObject<Quotient::Connection::Private::consumeRoomData(Quotient::SyncDataList&&, bool)::<lambda()>, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1, this_=0xe8fc2c0, r=0x98c8df0, a=0x7f6ffc1fc0a8, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:522
#17 0x00007f7100df3617 in QObject::event(QEvent*) () at /lib64/libQt6Core.so.6
#18 0x00007f71025c2b38 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt6Widgets.so.6
#19 0x00007f7100da0ba8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt6Core.so.6
#20 0x00007f7100da4aa5 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /lib64/libQt6Core.so.6
#21 0x00007f71010410bf in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () at /lib64/libQt6Core.so.6
#22 0x00007f7100b11e5c in g_main_dispatch (context=0x7f70e8000ef0) at ../glib/gmain.c:3476
#23 g_main_context_dispatch_unlocked (context=0x7f70e8000ef0) at ../glib/gmain.c:4284
#24 0x00007f7100b6cf18 in g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7f70e8000ef0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4349
#25 0x00007f7100b0fad3 in g_main_context_iteration (context=0x7f70e8000ef0, may_block=1) at ../glib/gmain.c:4414
#26 0x00007f710104096f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt6Core.so.6
#27 0x00007f7100dad9bb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt6Core.so.6
#28 0x00007f7100da97bd in QCoreApplication::exec() () at /lib64/libQt6Core.so.6
#29 0x000000000043835f in main (argc=1, argv=0x7ffeb4fceb38) at /home/carl/kde6/src/neochat/src/main.cpp:312

EXPECTED RESULT

No crash

SOFTWARE/OS VERSIONS
Lastest everything + NeoChat running work/nvrwhere/treemodel2

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2024-04-03 16:42:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/neochat/-/merge_requests/1670
Comment 2 James Graham 2024-04-09 18:35:20 UTC
Git commit 1a96899336f2f1a916207796b482ca4112909ebf by James Graham.
Committed on 09/04/2024 at 18:35.
Pushed by nvrwhere into branch 'master'.

Linkpreviewer Improvements

- Have LinkPreviewers stored in NeoChatConnection so that they don't have to be reloaded everytime the MessageContentModel is refreshed
- This means the link is never changed (it will be swiched for a new previewer with the new link)
- LinkPreviewers are stored by URL so they can be re-used by any event with the same URL

M  +2    -19   autotests/linkpreviewertest.cpp
M  +11   -23   src/linkpreviewer.cpp
M  +10   -12   src/linkpreviewer.h
M  +43   -15   src/models/messagecontentmodel.cpp
M  +2    -1    src/models/messagecontentmodel.h
M  +18   -0    src/neochatconnection.cpp
M  +6    -0    src/neochatconnection.h

https://invent.kde.org/network/neochat/-/commit/1a96899336f2f1a916207796b482ca4112909ebf
Comment 3 Nate Graham 2024-07-02 15:06:37 UTC
Created attachment 171286 [details]
Crash

I'm not sure this is fixed. I'm on git master and still seeing crashes with the same backtrace. One is attached.
Comment 4 Nate Graham 2024-07-02 15:26:40 UTC
My mistake, it's subtly different. Will open a new bug report.