https://bugs.kde.org/show_bug.cgi?id=501816

            Bug ID: 501816
           Summary: Segmentation fault when viewing rooms that don't have
                    room aliases
    Classification: Applications
           Product: NeoChat
           Version: git master
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: General
          Assignee: fe...@posteo.de
          Reporter: alkalinethun...@gmail.com
                CC: c...@carlschwan.eu, j...@redstrate.com
  Target Milestone: ---

SUMMARY
NeoChat will segfault when viewing a room that doesn't have a room alias
assigned to it.

STEPS TO REPRODUCE
1. Create a new room.
2. Do not assign an alias, like "#roomname:homeserver.tld," to the room.
3. Switch to another room, or another view within the UI.
4. Switch back to the room you just created.

OBSERVED RESULT
Segmentation fault (core-dumped).

EXPECTED RESULT
There shouldn't be a segmentation fault.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.13.7-arch1-1 (64-bit)
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION
NeoChat is compiled from source, bug is reproducable in both the latest Arch
package and on latest git master. 

GDB backtrace:
#0  Quotient::eventCast<Quotient::RoomMessageEvent const,
std::unique_ptr<Quotient::RoomEvent, std::default_delete<Quotient::RoomEvent> >
> (eptr=<optimized out>) at
/home/ritchie/kde/src/libquotient/Quotient/events/event.h:521
#1  Quotient::EventItemBase::viewAs<Quotient::RoomMessageEvent>
(this=<optimized out>) at
/home/ritchie/kde/src/libquotient/Quotient/eventitem.h:54
#2  Quotient::Room::isEventNotable (this=0x5555583c05f0, ti=...) at
/home/ritchie/kde/src/libquotient/Quotient/room.cpp:1046
#3  0x00007ffff6a41836 in operator() (__closure=<synthetic pointer>, acc=...,
ti=...) at /home/ritchie/kde/src/libquotient/Quotient/eventstats.cpp:22
#4 
std::accumulate<std::reverse_iterator<std::_Deque_iterator<Quotient::TimelineItem,
const Quotient::TimelineItem&, const Quotient::TimelineItem*> >,
Quotient::EventStats, Quotient::EventStats::fromRange(const Quotient::Room*,
const Quotient::Room::rev_iter_t&, const Quotient::Room::rev_iter_t&, const
Quotient::EventStats&)::<lambda(Quotient::EventStats, const
Quotient::TimelineItem&)> > (__first=..., __last=..., __init=...,
__binary_op=...) at /usr/include/c++/14.2.1/bits/stl_numeric.h:169
#5  Quotient::EventStats::fromRange (room=room@entry=0x5555583c05f0, from=...,
to=..., init=...) at
/home/ritchie/kde/src/libquotient/Quotient/eventstats.cpp:20
#6  0x00007ffff6a41fda in Quotient::EventStats::updateOnMarkerMove
(this=this@entry=0x5555583c3898, room=0x5555583c05f0, oldMarker=...,
newMarker=...) at /home/ritchie/kde/src/libquotient/Quotient/eventstats.cpp:68
#7  0x00007ffff69ee646 in Quotient::Room::Private::setLocalLastReadReceipt
(this=this@entry=0x5555583c3720, newMarker=..., newReceipt=...,
deferStatsUpdate=deferStatsUpdate@entry=false) at
/home/ritchie/kde/src/libquotient/Quotient/room.cpp:843
#8  0x00007ffff69ee8b7 in Quotient::Room::Private::setFullyReadMarker
(this=this@entry=0x5555583c3720, eventId=...) at
/home/ritchie/kde/src/libquotient/Quotient/room.cpp:969
#9  0x00007ffff69ef525 in Quotient::Room::Private::updateStats
(this=0x5555583c3720, from=..., to=...) at
/home/ritchie/kde/src/libquotient/Quotient/room.cpp:883
#10 0x00007ffff69f8f52 in operator() (__closure=0x7fff380f02c0) at
/home/ritchie/kde/src/libquotient/Quotient/room.cpp:2413
#11 operator() (__closure=<optimized out>) at
/usr/include/qt6/QtCore/qobjectdefs_impl.h:141
#12 QtPrivate::FunctorCallBase::call_internal<void,
QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void,
Quotient::Room::Private::getPreviousContent(int, const QString&)::<lambda()>
>::call(Quotient::Room::Private::getPreviousContent(int, const
QString&)::<lambda()>&, void**)::<lambda()> > (args=<optimized out>,
fn=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:65
#13 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void,
Quotient::Room::Private::getPreviousContent(int, const QString&)::<lambda()>
>::call (f=..., arg=<optimized out>) at
/usr/include/qt6/QtCore/qobjectdefs_impl.h:140
#14 QtPrivate::FunctorCallable<Quotient::Room::Private::getPreviousContent(int,
const QString&)::<lambda()> >::call<QtPrivate::List<>, void> (f=...,
arg=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:362
#15 QtPrivate::QCallableObject<Quotient::Room::Private::getPreviousContent(int,
const QString&)::<lambda()>, QtPrivate::List<>, void>::impl(int,
QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized
out>, this_=0x7fff380f02b0, r=<optimized out>, a=<optimized out>,
ret=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:572
#16 0x00007ffff3fb1a49 in QtPrivate::QSlotObjectBase::call
(this=0x7fff380f02b0, r=0x5555583c05f0, a=0x7fffffffd9a0, this=<optimized out>,
r=<optimized out>, a=<optimized out>) at
/usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:486
#17 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>,
argv=<optimized out>) at
/usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4115
#18 0x00007ffff6954702 in Quotient::BaseJob::success (this=<optimized out>,
_t1=<optimized out>) at
/home/ritchie/kde/build/libquotient/QuotientQt6_autogen/T4CFEN5LXH/moc_basejob.cpp:537
#19 0x00007ffff6a68625 in Quotient::BaseJob::finishJob (this=0x555556516a00) at
/home/ritchie/kde/src/libquotient/Quotient/jobs/basejob.cpp:618
#20 0x00007ffff3fb1a49 in QtPrivate::QSlotObjectBase::call
(this=0x55555aee30a0, r=0x555556516a00, a=0x7fffffffdae8, this=<optimized out>,
r=<optimized out>, a=<optimized out>) at
/usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:486
#21 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>,
argv=<optimized out>) at
/usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4115
#22 0x00007ffff3fa2f4a in QObject::event (this=0x7fff38105e30,
e=0x7fff381147e0) at
/usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:1418
#23 0x00007ffff52ff0ca in QApplicationPrivate::notify_helper (this=<optimized
out>, receiver=0x7fff38105e30, e=0x7fff381147e0) at
/usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3296
#24 0x00007ffff3f55b00 in QCoreApplication::notifyInternal2
(receiver=0x7fff38105e30, event=event@entry=0x7fff381147e0) at
/usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1172
#25 0x00007ffff3f55edc in QCoreApplication::sendEvent (receiver=<optimized
out>, event=0x7fff381147e0) at
/usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1612
#26 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0,
data=0x555555ce6e70) at
/usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1946
#27 0x00007ffff41c859c in QCoreApplication::sendPostedEvents (receiver=0x0,
event_type=0) at
/usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1800
#28 postEventSourceDispatch (s=s@entry=0x555555d5f5c0) at
/usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:246
#29 0x00007ffff1706104 in g_main_dispatch (context=0x7fffe8000f00) at
../glib/glib/gmain.c:3398
#30 0x00007ffff1769d57 in g_main_context_dispatch_unlocked
(context=0x7fffe8000f00) at ../glib/glib/gmain.c:4249
#31 g_main_context_iterate_unlocked.isra.0
(context=context@entry=0x7fffe8000f00, block=block@entry=1,
dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4314
#32 0x00007ffff1705535 in g_main_context_iteration (context=0x7fffe8000f00,
may_block=1) at ../glib/glib/gmain.c:4379
#33 0x00007ffff41c575d in QEventDispatcherGlib::processEvents
(this=0x555555d60ba0, flags=...) at
/usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#34 0x00007ffff3f606a6 in QEventLoop::processEvents (this=0x7fffffffdfb0,
flags=...) at
/usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:103
#35 QEventLoop::exec (this=0x7fffffffdfb0, flags=...) at
/usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:185
#36 0x00007ffff3f591d6 in QCoreApplication::exec () at
/usr/src/debug/qt6-base/qtbase/src/corelib/global/qflags.h:74
#37 0x00007ffff52faf9a in QApplication::exec () at
/usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2564
#38 0x00005555555e7b42 in main (argc=<optimized out>, argc@entry=1,
argv=argv@entry=0x7fffffffe358) at
/home/ritchie/kde/src/neochat/src/main.cpp:309
#39 0x00007ffff3835488 in __libc_start_call_main
(main=main@entry=0x5555555e6660 <main(int, char**)>, argc=argc@entry=1,
argv=argv@entry=0x7fffffffe358) at ../sysdeps/nptl/libc_start_call_main.h:58
#40 0x00007ffff383554c in __libc_start_main_impl (main=0x5555555e6660
<main(int, char**)>, argc=1, argv=0x7fffffffe358, init=<optimized out>,
fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe348) at
../csu/libc-start.c:360
#41 0x0000555555714735 in _start ()

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to