Bug 497211

Summary: Segmentation fault on opening a book
Product: [Applications] Arianna Reporter: Andreas Merl <merl.andreas>
Component: generalAssignee: Carl Schwan <carl>
Status: REPORTED ---    
Severity: crash CC: jalijal251990, nicolas.fella, vpavels
Priority: NOR    
Version First Reported In: 24.08.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: gdb backtrace

Description Andreas Merl 2024-12-08 18:11:36 UTC
Created attachment 176444 [details]
gdb backtrace

SUMMARY


STEPS TO REPRODUCE
1.  start arianna
2.  open a book from your library

OBSERVED RESULT
arianna crashes with a segmentation fault

EXPECTED RESULT
arianna opens the book for reading

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.1
Kernel Version: 6.12.3-arch1-1 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
As I am neither a software engineer nor familiar with C++ / Qt I can't tell what exactly is going on,
but it seems the problem is in bookserver.cpp. In line 28
return std::move(resp);
it seems the std::move() call creates the segmentation fault trying to move the resp pointer.
Comment 1 Nicolas Fella 2024-12-09 14:21:10 UTC
#0  QHttpHeaders::QHttpHeaders (this=<optimized out>, other=..., this=<optimized out>, other=...) at /usr/src/debug/qt6-base/qtbase/src/network/access/qhttpheaders.cpp:934
#1  0x00007ffff7f4dff6 in QHttpServerResponder::sendResponse (this=this@entry=0x7ffff7f4dff6 <QHttpServerResponder::sendResponse(QHttpServerResponse const&)+70>, response=...)
    at /usr/src/debug/qt6-httpserver/qthttpserver/src/httpserver/qhttpserverresponder.cpp:339
#2  0x00007ffff7f4e199 in QHttpServer::sendResponse (this=this@entry=0x7fffffffd560, response=..., request=..., responder=...) at /usr/src/debug/qt6-httpserver/qthttpserver/src/httpserver/qhttpserver.cpp:324
#3  0x0000555555575213 in QHttpServer::responseImpl<QHttpServerRouterViewTraits<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, false>, std::function<QHttpServerResponse(const QHttpServerRequest&)> > (
    this=0x7fffffffd560, boundViewHandler=..., request=..., responder=...) at /usr/include/qt6/QtHttpServer/qhttpserver.h:206
#4  operator() (__closure=<optimized out>, match=..., request=..., responder=...) at /usr/include/qt6/QtHttpServer/qhttpserver.h:170
#5  operator() (__closure=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:141
#6  QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<const QRegularExpressionMatch&, const QHttpServerRequest&, QHttpServerResponder&>, void, QHttpServer::createRouteHandler<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, QHttpServerRouterViewTraits<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, false> >(const QtPrivate::ContextTypeForFunctor<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, void>::ContextType*, BookServer::BookServer()::<lambda(const QHttpServerRequest&)>&&)::<lambda(const QRegularExpressionMatch&, const QHttpServerRequest&, QHttpServerResponder&)> >::call(QHttpServer::createRouteHandler<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, QHttpServerRouterViewTraits<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, false> >(const QtPrivate::ContextTypeForFunctor<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, void>::ContextType*, BookServer::BookServer()::<lambda(const QHttpServerRequest&)>&&)::<lambda(const QRegularExpressionMatch&, const QHttpServerRequest&, QHttpServerResponder&)>&, void**)::<lambda()> > (args=<optimized out>, fn=...) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:65
#7  QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<const QRegularExpressionMatch&, const QHttpServerRequest&, QHttpServerResponder&>, void, QHttpServer::createRouteHandler<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, QHttpServerRouterViewTraits<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, false> >(const QtPrivate::ContextTypeForFunctor<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, void>::ContextType*, BookServer::BookServer()::<lambda(const QHttpServerRequest&)>&&)::<lambda(const QRegularExpressionMatch&, const QHttpServerRequest&, QHttpServerResponder&)> >::call (f=..., arg=<optimized out>)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:140
#8  QtPrivate::FunctorCallable<QHttpServer::createRouteHandler<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, QHttpServerRouterViewTraits<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, false> >(const QtPrivate::ContextTypeForFunctor<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, void>::ContextType*, BookServer::BookServer()::<lambda(const QHttpServerRequest&)>&&)::<lambda(const QRegularExpressionMatch&, const QHttpServerRequest&, QHttpServerResponder&)>, const QRegularExpressionMatch&, const QHttpServerRequest&, QHttpServerResponder&>::call<QtPrivate::List<QRegularExpressionMatch const&, QHttpServerRequest const&, QHttpServerResponder&>, void> (
    f=..., arg=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:362
#9  QtPrivate::QCallableObject<QHttpServer::createRouteHandler<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, QHttpServerRouterViewTraits<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, false> >(const QtPrivate::ContextTypeForFunctor<BookServer::BookServer()::<lambda(const QHttpServerRequest&)>, void>::ContextType*, BookServer::BookServer()::<lambda(const QHttpServerRequest&)>&&)::<lambda(const QRegularExpressionMatch&, const QHttpServerRequest&, QHttpServerResponder&)>, QtPrivate::List<const QRegularExpressionMatch&, const QHttpServerRequest&, QHttpServerResponder&>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>,
    this_=<optimized out>, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:572
#10 0x00007ffff7f57a9e in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:486
#11 QHttpServerRouterRule::exec (this=0x555555d12150, request=..., responder=...) at /usr/src/debug/qt6-httpserver/qthttpserver/src/httpserver/qhttpserverrouterrule.cpp:246
#12 0x00007ffff7f57b17 in QHttpServerRouter::handleRequest (this=<optimized out>, request=..., responder=...) at /usr/include/c++/14.2.1/bits/unique_ptr.h:193
#13 0x00007ffff7f4fc52 in QHttpServer::handleRequest (this=<optimized out>, request=..., responder=...) at /usr/src/debug/qt6-httpserver/qthttpserver/src/httpserver/qhttpserver.cpp:345
#14 QHttpServerHttp1ProtocolHandler::handleReadyRead (this=0x555557a4f200) at /usr/src/debug/qt6-httpserver/qthttpserver/src/httpserver/qhttpserverhttp1protocolhandler.cpp:363
#15 0x00007ffff55b1b29 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:486
#16 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4124
#17 0x00007ffff5cc97f8 in QAbstractSocketPrivate::emitReadyRead (channel=0, this=0x555558bd4010) at /usr/src/debug/qt6-base/qtbase/src/network/socket/qabstractsocket.cpp:1221
#18 QAbstractSocketPrivate::canReadNotification (this=0x555558bd4010) at /usr/src/debug/qt6-base/qtbase/src/network/socket/qabstractsocket.cpp:656
#19 0x00007ffff5cd47b2 in QAbstractSocketEngine::readNotification (this=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/network/socket/qabstractsocketengine.cpp:120
#20 QReadNotifier::event (this=<optimized out>, e=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/network/socket/qnativesocketengine.cpp:1238
#21 0x00007ffff76fe78a in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x555556dc9ed0, e=0x7fffffffd120) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3296
#22 0x00007ffff5557ac8 in QCoreApplication::notifyInternal2 (receiver=0x555556dc9ed0, event=0x7fffffffd120) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1168
#23 0x00007ffff57c4c71 in QCoreApplication::sendEvent (receiver=<optimized out>, event=0x7fffffffd120) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1612
#24 socketNotifierSourceDispatch (source=0x55555569fce0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:77
#25 0x00007fffe9f9f559 in g_main_dispatch (context=0x7fffd0000f30) at ../glib/glib/gmain.c:3357
#26 0x00007fffea002157 in g_main_context_dispatch_unlocked (context=0x7fffd0000f30) at ../glib/glib/gmain.c:4208
#27 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7fffd0000f30, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4273
#28 0x00007fffe9f9ea55 in g_main_context_iteration (context=0x7fffd0000f30, may_block=1) at ../glib/glib/gmain.c:4338
#29 0x00007ffff57c22fd in QEventDispatcherGlib::processEvents (this=0x5555555fc030, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#30 0x00007ffff5561ee6 in QEventLoop::processEvents (this=0x7fffffffd440, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:103
#31 QEventLoop::exec (this=0x7fffffffd440, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:194
#32 0x00007ffff5558f4f in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qflags.h:74
#33 0x00005555555664ba in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/arianna/arianna-24.08.3/src/main.cpp:159