Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QWebEngineProfile causes Valgrind Crash
Forum Updated to NodeBB v4.3 + New Features

QWebEngineProfile causes Valgrind Crash

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
3 Posts 2 Posters 538 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Integrate-IT
    wrote on last edited by
    #1

    Hi, Hoping someone can help or at least point me in the right direction.
    I've got a complex program that I've created and I have a memory leak somewhere in the code. The software heavily uses QWebEngine. However I want to use Valgrind to locate any potential memory leaks I've probably coded in somewhere.

    However whenever I run Valgrind it starts and then says "The program has unexpectedly finished". I know this can be an issue so I started hunting around to find out why this was happening. Where I've got to is the following, a simple 4 line program that crashes valgrind.

    main.cpp

    #include <QDebug>
    #include <QApplication>
    #include <QWebEngineProfile>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QWebEngineProfile p;
        
    
        qDebug() << "Running";
        app.exec();
    
    }
    

    test.pro

    QT += core gui
    QT += widgets webengine webenginewidgets network webchannel sql concurrent
    LIBS += -lssl -lcrypto
    
    CONFIG += c++11
    CONFIG += use_gold_linker
    CONFIG -= qml_debug
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    SOURCES += \
            main.cpp
    
    

    If I run this program I get to see the word "Running" in the console window.
    However when I do "Analyze > Valgrind Memory Analzer" from the menu.

    I get

    20:21:07: /usr/bin/valgrind --child-silent-after-fork=yes --xml-socket=127.0.0.1:39091 --log-socket=127.0.0.1:39389 --xml=yes --smc-check=stack --tool=memcheck --gen-suppressions=all --track-origins=yes --leak-check=summary --num-callers=25 /home/dan.integrate-it.network/Documents/build-ezrentalValgrindTest-Desktop_Qt_5_15_2_GCC_64bit-Debug/ezrentalValgrindTest
    20:21:24: The program has unexpectedly finished.
    20:21:24: Process exited with return value Process crashed
    20:21:24: Analyzing finished.
    
    

    Any help anyone can give would be great. Not sure if it's a QT issue or a Valgrid issue.

    Regards

    raven-worxR 1 Reply Last reply
    0
    • I Integrate-IT

      Hi, Hoping someone can help or at least point me in the right direction.
      I've got a complex program that I've created and I have a memory leak somewhere in the code. The software heavily uses QWebEngine. However I want to use Valgrind to locate any potential memory leaks I've probably coded in somewhere.

      However whenever I run Valgrind it starts and then says "The program has unexpectedly finished". I know this can be an issue so I started hunting around to find out why this was happening. Where I've got to is the following, a simple 4 line program that crashes valgrind.

      main.cpp

      #include <QDebug>
      #include <QApplication>
      #include <QWebEngineProfile>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
      
          QWebEngineProfile p;
          
      
          qDebug() << "Running";
          app.exec();
      
      }
      

      test.pro

      QT += core gui
      QT += widgets webengine webenginewidgets network webchannel sql concurrent
      LIBS += -lssl -lcrypto
      
      CONFIG += c++11
      CONFIG += use_gold_linker
      CONFIG -= qml_debug
      
      # Default rules for deployment.
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /opt/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target
      
      SOURCES += \
              main.cpp
      
      

      If I run this program I get to see the word "Running" in the console window.
      However when I do "Analyze > Valgrind Memory Analzer" from the menu.

      I get

      20:21:07: /usr/bin/valgrind --child-silent-after-fork=yes --xml-socket=127.0.0.1:39091 --log-socket=127.0.0.1:39389 --xml=yes --smc-check=stack --tool=memcheck --gen-suppressions=all --track-origins=yes --leak-check=summary --num-callers=25 /home/dan.integrate-it.network/Documents/build-ezrentalValgrindTest-Desktop_Qt_5_15_2_GCC_64bit-Debug/ezrentalValgrindTest
      20:21:24: The program has unexpectedly finished.
      20:21:24: Process exited with return value Process crashed
      20:21:24: Analyzing finished.
      
      

      Any help anyone can give would be great. Not sure if it's a QT issue or a Valgrid issue.

      Regards

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Integrate-IT
      what are the specs (especially RAM) of the machine you are on?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      I 1 Reply Last reply
      0
      • raven-worxR raven-worx

        @Integrate-IT
        what are the specs (especially RAM) of the machine you are on?

        I Offline
        I Offline
        Integrate-IT
        wrote on last edited by
        #3

        @raven-worx Hi thanks for the question.
        So a reasonable machine really.
        16gb Ram on 8 core Intel i7-9700 @ 3.00mhz

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved