Bug 479170 - valgrind output
Summary: valgrind output
Status: RESOLVED NOT A BUG
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-12-29 17:37 UTC by Tom Max
Modified: 2024-02-20 13:29 UTC (History)
2 users (show)

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


Attachments
full valgrind output (68.63 KB, text/plain)
2023-12-29 17:37 UTC, Tom Max
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Max 2023-12-29 17:37:39 UTC
Created attachment 164548 [details]
full valgrind output

SUMMARY

running valgrind on plasma-systemmonitor a lot of trouble are showed. this bug report is to keep trace of them

STEPS TO REPRODUCE
1. build plasma-systemmonitor on your machine
2. create this script: $ cat run.sh
#!/bin/bash

LD_PRELOAD="/home/tom1/kde/build/libksysguard/bin/libFacesPlugin.so /home/tom1/kde/build/libksysguard/bin/libKSysGuardSensorFaces.so /home/tom1/kde/build/kconfig/bin/libKF6ConfigCore.so.6 " valgrind /home/tom1/kde/build/plasma-systemmonitor/bin/plasma-systemmonitor

3. chmod +x && ./run

OBSERVED RESULT
a lot of issue

EXPECTED RESULT
no issue

SOFTWARE/OS VERSIONS
Linux/KDE Plasma neon unstable developer 25-12-2023
KDE Plasma Version 5.91.90
KDE Frameworks Version: 5.248.0
Qt Version: 6.6.1
Kernel version: 6.2.0-39-generic (64-bit)
Graphic Platform: Wayland

ADDITIONAL INFORMATION
full valgring output attached, cannot stay here

tom1@tom-neon:~/kde$ ./run.sh
==24605== Memcheck, a memory error detector
==24605== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==24605== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==24605== Command: /home/tom1/kde/build/plasma-systemmonitor/bin/plasma-systemmonitor
==24605==


    *** I suppose Ubuntu ldd problem, not always present


==24605== Invalid read of size 8
==24605==    at 0x40286A8: strncmp (strcmp.S:172)
==24605==    by 0x400668D: is_dst (dl-load.c:216)
==24605==    by 0x400810E: _dl_dst_count (dl-load.c:253)
==24605==    by 0x400810E: expand_dynamic_string_token (dl-load.c:395)
==24605==    by 0x40082B7: fillin_rpath.isra.0 (dl-load.c:483)
==24605==    by 0x4008602: decompose_rpath (dl-load.c:654)
==24605==    by 0x400ABF5: cache_rpath (dl-load.c:696)
==24605==    by 0x400ABF5: cache_rpath (dl-load.c:677)
==24605==    by 0x400ABF5: _dl_map_object (dl-load.c:2165)
==24605==    by 0x4003494: openaux (dl-deps.c:64)
==24605==    by 0x6B458A7: _dl_catch_exception (dl-error-skeleton.c:208)
==24605==    by 0x4003C7B: _dl_map_object_deps (dl-deps.c:248)
==24605==    by 0x400EA0E: dl_open_worker_begin (dl-open.c:592)
==24605==    by 0x6B458A7: _dl_catch_exception (dl-error-skeleton.c:208)
==24605==    by 0x400DF99: dl_open_worker (dl-open.c:782)
==24605==  Address 0xcf5ae19 is 9 bytes inside a block of size 15 alloc'd
==24605==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==24605==    by 0x40271DF: malloc (rtld-malloc.h:56)
==24605==    by 0x40271DF: strdup (strdup.c:42)
==24605==    by 0x4008594: decompose_rpath (dl-load.c:629)
==24605==    by 0x400ABF5: cache_rpath (dl-load.c:696)
==24605==    by 0x400ABF5: cache_rpath (dl-load.c:677)
==24605==    by 0x400ABF5: _dl_map_object (dl-load.c:2165)
==24605==    by 0x4003494: openaux (dl-deps.c:64)
==24605==    by 0x6B458A7: _dl_catch_exception (dl-error-skeleton.c:208)
==24605==    by 0x4003C7B: _dl_map_object_deps (dl-deps.c:248)
==24605==    by 0x400EA0E: dl_open_worker_begin (dl-open.c:592)
==24605==    by 0x6B458A7: _dl_catch_exception (dl-error-skeleton.c:208)
==24605==    by 0x400DF99: dl_open_worker (dl-open.c:782)
==24605==    by 0x6B458A7: _dl_catch_exception (dl-error-skeleton.c:208)
==24605==    by 0x400E34D: _dl_open (dl-open.c:883)
==24605==
==24605== Invalid read of size 8
==24605==    at 0x40286A8: strncmp (strcmp.S:172)
==24605==    by 0x400668D: is_dst (dl-load.c:216)
==24605==    by 0x4007F79: _dl_dst_substitute (dl-load.c:295)
==24605==    by 0x40082B7: fillin_rpath.isra.0 (dl-load.c:483)
==24605==    by 0x4008602: decompose_rpath (dl-load.c:654)
==24605==    by 0x400ABF5: cache_rpath (dl-load.c:696)
==24605==    by 0x400ABF5: cache_rpath (dl-load.c:677)
==24605==    by 0x400ABF5: _dl_map_object (dl-load.c:2165)
==24605==    by 0x4003494: openaux (dl-deps.c:64)
==24605==    by 0x6B458A7: _dl_catch_exception (dl-error-skeleton.c:208)
==24605==    by 0x4003C7B: _dl_map_object_deps (dl-deps.c:248)
==24605==    by 0x400EA0E: dl_open_worker_begin (dl-open.c:592)
==24605==    by 0x6B458A7: _dl_catch_exception (dl-error-skeleton.c:208)
==24605==    by 0x400DF99: dl_open_worker (dl-open.c:782)
==24605==  Address 0xcf5ae19 is 9 bytes inside a block of size 15 alloc'd
==24605==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==24605==    by 0x40271DF: malloc (rtld-malloc.h:56)
==24605==    by 0x40271DF: strdup (strdup.c:42)
==24605==    by 0x4008594: decompose_rpath (dl-load.c:629)
==24605==    by 0x400ABF5: cache_rpath (dl-load.c:696)
==24605==    by 0x400ABF5: cache_rpath (dl-load.c:677)
==24605==    by 0x400ABF5: _dl_map_object (dl-load.c:2165)
==24605==    by 0x4003494: openaux (dl-deps.c:64)
==24605==    by 0x6B458A7: _dl_catch_exception (dl-error-skeleton.c:208)
==24605==    by 0x4003C7B: _dl_map_object_deps (dl-deps.c:248)
==24605==    by 0x400EA0E: dl_open_worker_begin (dl-open.c:592)
==24605==    by 0x6B458A7: _dl_catch_exception (dl-error-skeleton.c:208)
==24605==    by 0x400DF99: dl_open_worker (dl-open.c:782)
==24605==    by 0x6B458A7: _dl_catch_exception (dl-error-skeleton.c:208)
==24605==    by 0x400E34D: _dl_open (dl-open.c:883)



    *** QML warning



==24605==
qt.qml.typeresolution.cycle: Cyclic dependency detected between "qrc:/qt/qml/org/kde/desktop/private/TextFieldContextMenu.qml" and "qrc:/qt/qml/org/kde/desktop/MenuItem.qml"



    *** invalid read type "HASH"



==24605== Invalid read of size 16
==24605==    at 0x668FAF7: ??? (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x48BDB05: calculateHash<QStringView> (qhash.h:57)
==24605==    by 0x48BDB05: QHashPrivate::Data<QHashPrivate::Node<QStringView, QHashDummyValue> >::findBucket(QStringView const&) const [clone .isra.0] (qhash.h:683)
==24605==    by 0x48C0F43: findOrInsert (qhash.h:718)
==24605==    by 0x48C0F43: QHash<QStringView, QHashDummyValue>::iterator QHash<QStringView, QHashDummyValue>::emplace_helper<QHashDummyValue>(QStringView&&, QHashDummyValue&&) [clone .isra.0] (qhash.h:1335)
==24605==    by 0x48C2E89: emplace<QHashDummyValue> (qhash.h:1321)
==24605==    by 0x48C2E89: insert (qset.h:158)
==24605==    by 0x48C2E89: operator() (kconfig.cpp:325)
==24605==    by 0x48C2E89: forEachEntryWhoseGroupStartsWith<KConfigPrivate::groupList(const QString&) const::<lambda(KEntryMapConstIterator)> > (kconfigdata_p.h:252)
==24605==    by 0x48C2E89: KConfigPrivate::groupList(QString const&) const (kconfig.cpp:320)
==24605==    by 0x48D2089: KConfigGroup::groupList() const (kconfiggroup.cpp:1147)
==24605==    by 0x1B94F929: PageDataObject::load(KConfigBase const&, QString const&) (PageDataObject.cpp:235)
==24605==    by 0x1B95705E: PagesModel::componentComplete() (PagesModel.cpp:99)
==24605==    by 0x5449876: QQmlObjectCreator::finalize(QQmlInstantiationInterrupt&) (in /usr/lib/x86_64-linux-gnu/libQt6Qml.so.6.6.1)
==24605==    by 0x54D09AC: QQmlComponentPrivate::complete(QQmlEnginePrivate*, QQmlComponentPrivate::ConstructionState*) (in /usr/lib/x86_64-linux-gnu/libQt6Qml.so.6.6.1)
==24605==    by 0x54D0CAB: QQmlComponentPrivate::completeCreate() (in /usr/lib/x86_64-linux-gnu/libQt6Qml.so.6.6.1)
==24605==    by 0x54D2C88: QQmlComponentPrivate::createWithProperties(QObject*, QMap<QString, QVariant> const&, QQmlContext*, QQmlComponentPrivate::CreateBehavior) (in /usr/lib/x86_64-linux-gnu/libQt6Qml.so.6.6.1)
==24605==    by 0x54C80DF: QQmlApplicationEnginePrivate::finishLoad(QQmlComponent*) (in /usr/lib/x86_64-linux-gnu/libQt6Qml.so.6.6.1)
==24605==  Address 0xabfc37a is 26 bytes inside a block of size 38 alloc'd
==24605==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==24605==    by 0x65A5677: QArrayData::allocate(QArrayData**, long long, long long, long long, QArrayData::AllocationOption) (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x657DCFE: QString::QString(long long, Qt::Initialization) (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x6589D97: QString::fromUtf8(QByteArrayView) (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x48DEA4E: fromUtf8<> (qstring.h:588)
==24605==    by 0x48DEA4E: KConfigIniBackend::parseConfig(QByteArray const&, KEntryMap&, QFlags<KConfigBackend::ParseOption>, bool) (kconfigini.cpp:157)
==24605==    by 0x48C1C68: KConfigPrivate::parseConfigFiles() (kconfig.cpp:798)
==24605==    by 0x48E5E81: KSharedConfig::KSharedConfig(QString const&, QFlags<KConfig::OpenFlag>, QStandardPaths::StandardLocation) (ksharedconfig.cpp:123)
==24605==    by 0x48E64E0: KSharedConfig::openConfig(QString const&, QFlags<KConfig::OpenFlag>, QStandardPaths::StandardLocation) (ksharedconfig.cpp:88)
==24605==    by 0x1B957006: PagesModel::componentComplete() (PagesModel.cpp:96)
==24605==    by 0x5449876: QQmlObjectCreator::finalize(QQmlInstantiationInterrupt&) (in /usr/lib/x86_64-linux-gnu/libQt6Qml.so.6.6.1)
==24605==    by 0x54D09AC: QQmlComponentPrivate::complete(QQmlEnginePrivate*, QQmlComponentPrivate::ConstructionState*) (in /usr/lib/x86_64-linux-gnu/libQt6Qml.so.6.6.1)
==24605==    by 0x54D0CAB: QQmlComponentPrivate::completeCreate() (in /usr/lib/x86_64-linux-gnu/libQt6Qml.so.6.6.1)






   *** if expression on uninitialised byte(s)



==24605==
==24605== Conditional jump or move depends on uninitialised value(s)
==24605==    at 0x1EAA0C39: ???
==24605==    by 0xCDA4DAF: ???
==24605==





   *** if expression on uninitialised byte(s) on wayland






==24605== Conditional jump or move depends on uninitialised value(s)
==24605==    at 0xB5E8116: QtWaylandClient::QWaylandInputDevice::Keyboard::keyboard_key(unsigned int, unsigned int, unsigned int, unsigned int) (in /usr/lib/x86_64-linux-gnu/libQt6WaylandClient.so.6.6.1)
==24605==    by 0xB620E2D: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.8.1.0)
==24605==    by 0xB61D492: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.8.1.0)
==24605==    by 0x4A6EB1F: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.22.0)
==24605==    by 0x4A6F322: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.22.0)
==24605==    by 0x4A6F5DB: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.22.0)
==24605==    by 0xB5D21B1: QtWaylandClient::QWaylandDisplay::flushRequests() (in /usr/lib/x86_64-linux-gnu/libQt6WaylandClient.so.6.6.1)
==24605==    by 0x662295A: ??? (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x65007CA: QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x665CFBA: QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x665EBEB: QCoreApplication::exec() (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x114C81: main (main.cpp:116)

   *** Invalid read  type "SensorFaceControllerPrivate"


==24605== Invalid read of size 16
==24605==    at 0x1EA9F9B0: ???
==24605==    by 0x1CDB759F: ???
==24605==  Address 0x1cdb75be is 46 bytes inside a block of size 58 alloc'd
==24605==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==24605==    by 0x65A5677: QArrayData::allocate(QArrayData**, long long, long long, long long, QArrayData::AllocationOption) (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x6583C52: QString::fromLatin1(QByteArrayView) (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x645D5BF: ??? (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x65F167E: ??? (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x66094FF: QJsonValueConstRef::concreteString(QJsonValueConstRef, QString const&) (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x487B40F: toString (qjsonvalue.h:143)
==24605==    by 0x487B40F: toString (qjsonvalue.h:252)
==24605==    by 0x487B40F: KSysGuard::SensorFaceControllerPrivate::readSensors(KConfigGroup const&, QString const&) (SensorFaceController.cpp:252)
==24605==    by 0x487B7CD: KSysGuard::SensorFaceControllerPrivate::readAndUpdateSensors(KConfigGroup&, QString const&) (SensorFaceController.cpp:272)
==24605==    by 0x4884591: KSysGuard::SensorFaceController::SensorFaceController(KConfigGroup&, QQmlEngine*) (SensorFaceController.cpp:391)
==24605==    by 0x1B947D96: FaceLoader::setDataObject(PageDataObject*) (FaceLoader.cpp:64)
==24605==    by 0x542C917: ??? (in /usr/lib/x86_64-linux-gnu/libQt6Qml.so.6.6.1)
==24605==    by 0x54C3197: ??? (in /usr/lib/x86_64-linux-gnu/libQt6Qml.so.6.6.1)
==24605==



==24605== Conditional jump or move depends on uninitialised value(s)
==24605==    at 0x1F7B0EB4: ???
==24605==    by 0x1C1051DF: ???
==24605==
^C

*** manually stopped

==24605==
==24605== Process terminating with default action of signal 2 (SIGINT)
==24605==    at 0x6AE99DF: poll (poll.c:29)
==24605==    by 0x7B161F5: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7200.4)
==24605==    by 0x7ABE3E2: g_main_context_iteration (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7200.4)
==24605==    by 0x650078F: QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x665CFBA: QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x6597E37: QThread::exec() (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x6182E6D: ??? (in /usr/lib/x86_64-linux-gnu/libQt6DBus.so.6.6.1)
==24605==    by 0x655A6EC: ??? (in /usr/lib/x86_64-linux-gnu/libQt6Core.so.6.6.1)
==24605==    by 0x6A65AC2: start_thread (pthread_create.c:442)
==24605==    by 0x6AF6813: clone (clone.S:100)
==24605==
==24605== HEAP SUMMARY:
==24605==     in use at exit: 36,706,370 bytes in 204,555 blocks
==24605==   total heap usage: 1,726,898 allocs, 1,522,343 frees, 265,080,514 bytes allocated
==24605==
==24605== LEAK SUMMARY:
==24605==    definitely lost: 3,984 bytes in 442 blocks
==24605==    indirectly lost: 368 bytes in 7 blocks
==24605==      possibly lost: 1,229,060 bytes in 5,423 blocks
==24605==    still reachable: 35,472,958 bytes in 198,683 blocks
==24605==                       of which reachable via heuristic:
==24605==                         length64           : 96 bytes in 3 blocks
==24605==                         newarray           : 1,335,336 bytes in 2,661 blocks
==24605==                         multipleinheritance: 18,336 bytes in 70 blocks
==24605==         suppressed: 0 bytes in 0 blocks
==24605== Rerun with --leak-check=full to see details of leaked memory
==24605==
==24605== Use --track-origins=yes to see where uninitialised values come from
==24605== For lists of detected and suppressed errors, rerun with: -s
==24605== ERROR SUMMARY: 130 errors from 72 contexts (suppressed: 0 from 0)
Comment 1 Tom Max 2023-12-30 10:52:05 UTC
Probably found from where these strange valgrind notes are coming from, qt regular expression:

==114405== Conditional jump or move depends on uninitialised value(s)
==114405==    at 0x486AC39: ???
==114405==    by 0x7A648C7: ???
==114405== 


file PageDataObject.cpp, function 
QVariant converted(const QVariant &variant, QMetaType::Type type),

this line:
            auto match = boolTrueExpression.match(variant.toString());

I have reproduced the problem with this example:

========8<=======
#include <QRegularExpression>
#include <QDebug>

int main(int argc, char *argv[])
{
    const QString qs("section-0");
    const QVariant variant (qs);

    static const QRegularExpression boolTrueExpression(QStringLiteral("^[yY][eE][sS]|[tT][rR][uU][eE]$"));
    qDebug() << __FILE__ << __LINE__;
    auto match = boolTrueExpression.match(variant.toString());
    qDebug() << __FILE__ << __LINE__;
    if (!match.hasMatch()) {
        qDebug() << __FILE__ << __LINE__;
        return 0;//QVariant{};
    }
}
========8<=======

running it I can see:
tom1@tom-neon:~/projects/test_regexp/build$ valgrind ./test_regexp
==114405== Memcheck, a memory error detector
==114405== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==114405== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==114405== Command: ./test_regexp
==114405== 
/home/tom1/projects/test_regexp/src/main.cpp 10
==114405== Conditional jump or move depends on uninitialised value(s)
==114405==    at 0x486AC39: ???
==114405==    by 0x7A648C7: ???
==114405== 
/home/tom1/projects/test_regexp/src/main.cpp 12
/home/tom1/projects/test_regexp/src/main.cpp 14
==114


NB: I have built the example with qt5, as Kdevelop is not configured for qt6 (or I'm unable to use it) on the neon machine.
Can somebody test this code with qt6 or pass me a link to configure KDevelop for qt6?

thanks
Comment 2 Tom Max 2023-12-30 18:20:25 UTC
reproduced also with qt6 on neon unstable. 

Looking for this bug in Qt's bug system, I found it:

https://bugreports.qt.io/browse/QTBUG-116866

but the problem seems to be in NEON, a missing flag building Qt with PCRE.

I think  I should create a separate bug report for each issue, correct?
Comment 3 Arjen Hiemstra 2024-02-02 16:09:15 UTC
If it's in Qt and already tracked upstream, there isn't much to do here. Did you find anything system monitor specific?
Comment 4 Tom Max 2024-02-03 13:21:59 UTC
On Fri, Feb 2, 2024 at 5:09 PM Arjen Hiemstra <bugzilla_noreply@kde.org> wrote:
>
> https://bugs.kde.org/show_bug.cgi?id=479170
>
> --- Comment #3 from Arjen Hiemstra <ahiemstra@heimr.nl> ---
> If it's in Qt and already tracked upstream, there isn't much to do here.

that Qt bug says the fix is in enabling a compilation flag, it seems
Neon is missing it. I reported it here:

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

> Did you find anything system monitor specific?

No, I have a discussion still pending about kconfig,  but I have lost
2 times my NEON VM during updates, and that stopped my tests.
I'll made my third VM soon
Comment 5 Arjen Hiemstra 2024-02-20 13:29:49 UTC
Since this is more about KConfig than System Monitor, I'll close this. If you find something concrete for KConfig, please create a new bug report for it under the frameworks-kconfig product.