Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Looks like the SIGNAL loadFinished(bool) is not emitted anymore with Qt 6.8.1
Forum Updated to NodeBB v4.3 + New Features

Looks like the SIGNAL loadFinished(bool) is not emitted anymore with Qt 6.8.1

Scheduled Pinned Locked Moved Solved General and Desktop
67 Posts 5 Posters 6.6k Views
  • 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.
  • V Offline
    V Offline
    Volker75
    wrote on last edited by Volker75
    #21

    Ok. Sorry. ChrisW67. Thank you for your help. It helped us to locate the bug a bit closer. Yes. That is true. My header is wrong. My code is fine and also your code is fine. My and your applications (binaries/executables) are wrong, because there is at least one bug in Qt or in libxcb.so.1.1.0.
    Sadly that is out of my scope and skill level. Can anyone report this well and hunt it down?
    I bet that this or a very similar bug is also the reason for the other bug I reported some time ago:
    https://forum.qt.io/topic/160116/qtwebenginecore-dll-sometimes-not-found?_=1736677825304

    JonBJ 1 Reply Last reply
    0
    • V Volker75

      Ok. Sorry. ChrisW67. Thank you for your help. It helped us to locate the bug a bit closer. Yes. That is true. My header is wrong. My code is fine and also your code is fine. My and your applications (binaries/executables) are wrong, because there is at least one bug in Qt or in libxcb.so.1.1.0.
      Sadly that is out of my scope and skill level. Can anyone report this well and hunt it down?
      I bet that this or a very similar bug is also the reason for the other bug I reported some time ago:
      https://forum.qt.io/topic/160116/qtwebenginecore-dll-sometimes-not-found?_=1736677825304

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #22

      @Volker75 said in Looks like the SIGNAL loadFinished(bool) is not emitted anymore with Qt 6.8.1:

      My header is wrong.

      Don't know what this means.

      because there is at least one bug in Qt or in libxcb.so.1.1.0.

      Don't know what you are referring to. Don't think anyone can act on this. My understanding is that you reported signal not working, now you acknowledge it works, so don't know what bug you are referring to.

      Can anyone report this well and hunt it down?

      I don't see what others have to hunt down which is wrong, or why they would do so.

      https://forum.qt.io/topic/160116/qtwebenginecore-dll-sometimes-not-found?_=1736677825304

      I don't see why, whatever that turned out to be about, it is particularly related to anything else here. Especially if it is "intermittent".

      To report a bug you need to have a small, complete piece of code which illustrates a problem. I think two other people have reported something like @ChrisW67's code seems to run fine, and you may be in that situation now, I don't know. I am not sure anyone will be interested in reports from valgrind necessarily counting as bugs, only if results in bad behaviour,

      1 Reply Last reply
      0
      • V Offline
        V Offline
        Volker75
        wrote on last edited by Volker75
        #23

        "My header" = not in the code. Header of this topic/post in the forum.

        I am refereeing to the valgrind logfile that i added. Did you ever used valgrind? It is a very nice tool and you can hunt down bugs in your code very well. It shows you where the bug is located.
        If you watch the logfile, then you can see where the bug is located. Sadly valgrind refer to files that are out of my scope. The bug is not in my source. The bug is in functions that I call only.

        As far as i can see and understand it, there is a wrong pointer (Quote from the log file: "vector[0]) points to uninitialized byte(s)".). It points to a wrong place and that is why the function doesn't do what it should do. It was only luck that is was running fine. Similar to the other bug that I report. It is the same software and the same code and there it crashes with Windows 10 Citrix and Qt 6.7.2 even the exact code is running fine on 10 other computers with Qt 6.7.2 (Windows, Linux, Windows 10 local, MacOS, ...). So there it was only just luck.

        JonBJ 1 Reply Last reply
        0
        • V Volker75

          "My header" = not in the code. Header of this topic/post in the forum.

          I am refereeing to the valgrind logfile that i added. Did you ever used valgrind? It is a very nice tool and you can hunt down bugs in your code very well. It shows you where the bug is located.
          If you watch the logfile, then you can see where the bug is located. Sadly valgrind refer to files that are out of my scope. The bug is not in my source. The bug is in functions that I call only.

          As far as i can see and understand it, there is a wrong pointer (Quote from the log file: "vector[0]) points to uninitialized byte(s)".). It points to a wrong place and that is why the function doesn't do what it should do. It was only luck that is was running fine. Similar to the other bug that I report. It is the same software and the same code and there it crashes with Windows 10 Citrix and Qt 6.7.2 even the exact code is running fine on 10 other computers with Qt 6.7.2 (Windows, Linux, Windows 10 local, MacOS, ...). So there it was only just luck.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #24

          @Volker75
          Yes, I have used valgrind many times. Yes, it can be a useful tool. Yes, it can always return false positives. No, I don't think anyone particularly will look into this, especially with QWebEngine, unless some behaviour is demonstrably wrong. Which as I understand it you do not have. You still say "why the function doesn't do what it should do" but I haven't seen a consistent report of something going wrong, else the other guys would have said so, valgrind report apart. Maybe I'm mistaken and someone else will look into this, but I wouldn't hold your breath.

          1 Reply Last reply
          0
          • V Offline
            V Offline
            Volker75
            wrote on last edited by Volker75
            #25

            In my source it crashes every time under Linux 6.8.1!
            Sadly it is large and so you want to have a smaller file of course, but then he bug doesn't occur.
            It is like if I use a Qt function like this:
            qt_foo(myCode.size());

            And in this Qt function is source like this: (This is not the real source. Only a bad example):
            a[10];
            ...
            for(int i=0; i<x; i++)
            sum+=a[i];
            }

            and you tell me: "Ohh... Wait: Your example code is too large. You must do a smaller sample code and prove that it doesn't work. Nobody will check such a large example. Your sample code is only allowed to have a small example that doesn't work."
            My source code is sadly large. I can't make my source code smaller. If I make my source code smaller, then it is just higher luck that the bug doesn't occur.

            JonBJ 1 Reply Last reply
            0
            • V Offline
              V Offline
              Volker75
              wrote on last edited by
              #26

              I pay 50€ to the guy that fix this bug.

              1 Reply Last reply
              0
              • V Volker75

                In my source it crashes every time under Linux 6.8.1!
                Sadly it is large and so you want to have a smaller file of course, but then he bug doesn't occur.
                It is like if I use a Qt function like this:
                qt_foo(myCode.size());

                And in this Qt function is source like this: (This is not the real source. Only a bad example):
                a[10];
                ...
                for(int i=0; i<x; i++)
                sum+=a[i];
                }

                and you tell me: "Ohh... Wait: Your example code is too large. You must do a smaller sample code and prove that it doesn't work. Nobody will check such a large example. Your sample code is only allowed to have a small example that doesn't work."
                My source code is sadly large. I can't make my source code smaller. If I make my source code smaller, then it is just higher luck that the bug doesn't occur.

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by JonB
                #27

                @Volker75
                This forum is a user from, for users of Qt just like yourself. It is not a The Qt Company forum. If you want to report a bug that is done at TQtC https://bugreports.qt.io/. I think you will find they want a small program which reproduces bad behaviour. I don't know that they will look at your larger existing application, but up to you.

                In my source it crashes every time under Linux 6.8.1!

                I agree that is problematic. You might supply them with the stack trace on crash, which you have not shown us.

                I pay 50€ to the guy that fix this bug.

                LOL :)

                V 1 Reply Last reply
                0
                • JonBJ JonB

                  @Volker75
                  This forum is a user from, for users of Qt just like yourself. It is not a The Qt Company forum. If you want to report a bug that is done at TQtC https://bugreports.qt.io/. I think you will find they want a small program which reproduces bad behaviour. I don't know that they will look at your larger existing application, but up to you.

                  In my source it crashes every time under Linux 6.8.1!

                  I agree that is problematic. You might supply them with the stack trace on crash, which you have not shown us.

                  I pay 50€ to the guy that fix this bug.

                  LOL :)

                  V Offline
                  V Offline
                  Volker75
                  wrote on last edited by
                  #28

                  Well, I am not the only one that will be thankful is this bug will be fixed. If every Qt webengine users spent only 1€, it will be pretty much.
                  I am only a math and physic teacher that codes in his spare time. I am not a professional coder.

                  1 Reply Last reply
                  0
                  • V Offline
                    V Offline
                    Volker75
                    wrote on last edited by Volker75
                    #29

                    Maybe am am not skilled enough with gdb.
                    I used gdb and used "r". And tried to get the crash.
                    Then I get this error:

                    Thread 1 "Test" received signal SIGSEGV, Segmentation fault.
                    Downloading source file /home/qt/work/qt/qtwebengine/src/webenginewidgets/api/qwebengineview.cpp
                    QWebEngineView::page (this=0x555556a22710) at /home/qt/work/qt/qtwebengine/src/webenginewidgets/api/qwebengineview.cpp:1058                                                                    
                    Warnung: 1058   /home/qt/work/qt/qtwebengine/src/webenginewidgets/api/qwebengineview.cpp: Datei oder Verzeichnis nicht gefunden
                    
                    

                    It is translated: File or Folder not found
                    So similar to the bug that i descriped in the other topic that i linked a few posts ago.

                    Please give me more advice what I can do to locate the bug.

                    1 Reply Last reply
                    0
                    • V Offline
                      V Offline
                      Volker75
                      wrote on last edited by
                      #30

                      Sorry, I forgot the bt stuff. I hope anyone understand it:

                      [Thread 0x7fff7cc006c0 (LWP 13329) exited]
                      
                      Thread 1 "Test" received signal SIGSEGV, Segmentation fault.
                      Downloading source file /home/qt/work/qt/qtwebengine/src/webenginewidgets/api/qwebengineview.cpp
                      QWebEngineView::page (this=0x555556a22710) at /home/qt/work/qt/qtwebengine/src/webenginewidgets/api/qwebengineview.cpp:1058                                                                    
                      Warnung: 1058   /home/qt/work/qt/qtwebengine/src/webenginewidgets/api/qwebengineview.cpp: Datei oder Verzeichnis nicht gefunden
                      (gdb) bt
                      #0  QWebEngineView::page (this=0x555556a22710) at /home/qt/work/qt/qtwebengine/src/webenginewidgets/api/qwebengineview.cpp:1058
                      #1  0x00007ffff7f50f26 in QWebEngineView::setHtml (this=<optimized out>, html=<Fehler beim Lesen der Variable: Cannot access memory at address 0x7fffffffc038>, baseUrl=...)
                          at /home/qt/work/qt/qtwebengine/src/webenginewidgets/api/qwebengineview.cpp:1102
                      #2  0x0000555555ae0436 in operator() (__closure=0x555556a59390) at src/timetableprintform.cpp:58
                      #3  0x0000555555ae0ced in operator() (__closure=0x7fffffffc120) at ../../../Qt6.8/6.8.1/gcc_64/include/QtCore/qobjectdefs_impl.h:141
                      #4  0x0000555555ae0d94 in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, TimetablePrintForm::TimetablePrintForm(QWidget*)::<lambda()> >::call(TimetablePrintForm::TimetablePrintForm(QWidget*)::<lambda()>&, void**)::<lambda()> >(void **, struct {...} &&) (args=0x7fffffffc258, fn=...)
                          at ../../../Qt6.8/6.8.1/gcc_64/include/QtCore/qobjectdefs_impl.h:65
                      Backtrace stopped: Cannot access memory at address 0x7fffffffc108
                      
                      
                      1 Reply Last reply
                      0
                      • V Offline
                        V Offline
                        Volker75
                        wrote on last edited by
                        #31

                        In timetableprintform.cpp line 58 is the source from ChrisW67. It is:

                        view->setHtml("<html><head><title>Three seconds page</title></head><body><p>New content</p></body></html>");
                        
                        1 Reply Last reply
                        0
                        • hskoglundH Offline
                          hskoglundH Offline
                          hskoglund
                          wrote on last edited by
                          #32

                          What distro of Linux are you using?

                          1 Reply Last reply
                          0
                          • V Offline
                            V Offline
                            Volker75
                            wrote on last edited by Volker75
                            #33

                            Kubuntu 24.04: Just to be clear: the backtrack is if i copy his code into my project and run it.

                            1 Reply Last reply
                            0
                            • C Offline
                              C Offline
                              ChrisW67
                              wrote on last edited by ChrisW67
                              #34

                              Apologies for being a bit abrupt in my last post.

                              I have posted two pieces of code. The first was a simple one-widget form that looked a bit like the problem statement (and worked when the obvious other elements were added), and the second was a self-contained example that worked without addition. There was no intent that these were to be copied and pasted into anywhere as a solution.

                              Based on the backtrace I would start with the assumption that, at line 58 of your code, the view pointer is invalid (probably not null) at the time the slot/lambda executes. This could be because it is not initialised yet, the referenced object has been deleted, you have two variables called view with one (invalid) masking the other (valid) etc.

                              1 Reply Last reply
                              1
                              • V Offline
                                V Offline
                                Volker75
                                wrote on last edited by Volker75
                                #35

                                Thank you very much for your answer!
                                hmm.. Since I also used your code in my project and your name of the view was different, it should not be a shadowing problem.

                                In fact in my source I have a lot of similar names in different dialogs. In the main dialog and also in a sub dialog:

                                mainwindow.h
                                class MainWindow : public QMainWindow
                                {
                                   …
                                   QWebEngineView *viewPreview;
                                   …
                                }
                                
                                mainwindow.cpp
                                void MainWindow::printTimetable()
                                {
                                	TimetablePrintForm dialog(this);
                                	if (dialog.exec()) {
                                	}
                                	...
                                }
                                

                                This mainwindow executes the timetableprintform:

                                timetableprintform.h
                                class TimetablePrintForm: public Qdialog{
                                {
                                   …
                                   QWebEngineView *viewPreview;
                                   …
                                }
                                

                                I renamed QWebEngineView *viewPreview; in the timetableprintform to an other name. The bug is still present. So it is not a shadowing problem of the view. :-(

                                But while coding it, it reminds me on an 12 years old TODO. Maybe that is producing the shadowing problem? I sadly don't know if my comment it true and how to fix it:

                                main.cpp
                                ...
                                QApplication* app=NULL;
                                QTranslator TTranslator;
                                ...
                                int main(int argc, char *argv[]){	
                                	...
                                	QApplication app(argc, argv);       //TODO: QApplication shadows the global Qapplication?
                                	app.setApplicationName(NAME);
                                	app.setApplicationVersion(VERSION);
                                	...
                                	if(TSettings->language==""){
                                		selectLanguage(NULL);
                                	}
                                	setLanguage(app, NULL);
                                	...
                                	if(TSettings->languageRTL)
                                		app.setLayoutDirection(Qt::RightToLeft);
                                	...
                                	MainWindow mainWin(check);
                                	mainWin.show();
                                
                                	return app.exec();
                                }
                                

                                Any advice? Thank you very much.

                                jsulmJ 1 Reply Last reply
                                0
                                • V Volker75

                                  Thank you very much for your answer!
                                  hmm.. Since I also used your code in my project and your name of the view was different, it should not be a shadowing problem.

                                  In fact in my source I have a lot of similar names in different dialogs. In the main dialog and also in a sub dialog:

                                  mainwindow.h
                                  class MainWindow : public QMainWindow
                                  {
                                     …
                                     QWebEngineView *viewPreview;
                                     …
                                  }
                                  
                                  mainwindow.cpp
                                  void MainWindow::printTimetable()
                                  {
                                  	TimetablePrintForm dialog(this);
                                  	if (dialog.exec()) {
                                  	}
                                  	...
                                  }
                                  

                                  This mainwindow executes the timetableprintform:

                                  timetableprintform.h
                                  class TimetablePrintForm: public Qdialog{
                                  {
                                     …
                                     QWebEngineView *viewPreview;
                                     …
                                  }
                                  

                                  I renamed QWebEngineView *viewPreview; in the timetableprintform to an other name. The bug is still present. So it is not a shadowing problem of the view. :-(

                                  But while coding it, it reminds me on an 12 years old TODO. Maybe that is producing the shadowing problem? I sadly don't know if my comment it true and how to fix it:

                                  main.cpp
                                  ...
                                  QApplication* app=NULL;
                                  QTranslator TTranslator;
                                  ...
                                  int main(int argc, char *argv[]){	
                                  	...
                                  	QApplication app(argc, argv);       //TODO: QApplication shadows the global Qapplication?
                                  	app.setApplicationName(NAME);
                                  	app.setApplicationVersion(VERSION);
                                  	...
                                  	if(TSettings->language==""){
                                  		selectLanguage(NULL);
                                  	}
                                  	setLanguage(app, NULL);
                                  	...
                                  	if(TSettings->languageRTL)
                                  		app.setLayoutDirection(Qt::RightToLeft);
                                  	...
                                  	MainWindow mainWin(check);
                                  	mainWin.show();
                                  
                                  	return app.exec();
                                  }
                                  

                                  Any advice? Thank you very much.

                                  jsulmJ Offline
                                  jsulmJ Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #36

                                  @Volker75 said in Looks like the SIGNAL loadFinished(bool) is not emitted anymore with Qt 6.8.1:

                                  QApplication app(argc, argv);

                                  This is correct. QApplication instance is usually created in main() - there should not be any global instances of that class.
                                  Did you address what @ChrisW67 wrote: "at line 58 of your code, the view pointer is invalid"?

                                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  1 Reply Last reply
                                  0
                                  • V Offline
                                    V Offline
                                    Volker75
                                    wrote on last edited by Volker75
                                    #37

                                    Thank you. I think I addressed that, since like I already wrote "I renamed QWebEngineView *viewPreview; in the timetableprintform to an other name. The bug is still present.". So the pointer got a new unique name. So there shouldn't be a shadowing.
                                    Maybe I misunderstand you. Is there an other way to do? What should can I do? Just check if the pointer is !=NULL (But even if it is NULL, what should I do in that case?)?

                                    1 Reply Last reply
                                    0
                                    • V Offline
                                      V Offline
                                      Volker75
                                      wrote on last edited by Volker75
                                      #38

                                      I coded now this:

                                      if(viewPreview2==NULL){
                                      	qDebug("NULL");
                                      } else {
                                      	qDebug("Not NULL");
                                      }
                                      viewPreview2->setHtml(updateHTMLprintString(true));
                                      

                                      The last line is the problem.
                                      Debug tells me "Not NULL" in the terminal.
                                      Is there any thing else that I could check to locate the bug more detailed?

                                      1 Reply Last reply
                                      0
                                      • V Offline
                                        V Offline
                                        Volker75
                                        wrote on last edited by Volker75
                                        #39

                                        @jsulm: Please read my main.cpp once again. I saw that 2 probably important lines (The 2 first lines) were missing in my first post. I assume I done that because I needed the Translator global. Not sure anymore. I coded it 12 years ago.

                                        1 Reply Last reply
                                        0
                                        • V Offline
                                          V Offline
                                          Volker75
                                          wrote on last edited by Volker75
                                          #40
                                          This post is deleted!
                                          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