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. QPlatformWindow::requestUpdate() Assert
QtWS25 Last Chance

QPlatformWindow::requestUpdate() Assert

Scheduled Pinned Locked Moved Unsolved General and Desktop
18 Posts 3 Posters 2.4k 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.
  • B Offline
    B Offline
    Bremenpl
    wrote on last edited by
    #1

    Hello there,
    I am using Qt 5.13. My application crashes in the qplatformwindow.cpp file, line 758 where assertion is failed. This is the function:

    /*!
        Requests an QEvent::UpdateRequest event. The event will be
        delivered to the QWindow.
    
        QPlatformWindow subclasses can re-implement this function to
        provide display refresh synchronized updates. The event
        should be delivered using QPlatformWindow::deliverUpdateRequest()
        to not get out of sync with the the internal state of QWindow.
    
        The default implementation posts an UpdateRequest event to the
        window after 5 ms. The additional time is there to give the event
        loop a bit of idle time to gather system events.
    
    */
    void QPlatformWindow::requestUpdate()
    {
        Q_D(QPlatformWindow);
    
        static int updateInterval = []() {
            bool ok = false;
            int customUpdateInterval = qEnvironmentVariableIntValue("QT_QPA_UPDATE_IDLE_TIME", &ok);
            return ok ? customUpdateInterval : 5;
        }();
    
        Q_ASSERT(!d->updateTimer.isActive());
        d->updateTimer.start(updateInterval, Qt::PreciseTimer, window());
    }
    

    I was trying to unroll the call stack in order to check what could be causing this, but its simply too long at starts at app.exec(), where app is:

    QGuiApplication app(argc, argv);
    

    In the main.c. I would like to post my code but its simply too big... I can try to describe the situation at which this is happening. Basically in the QML part I have some Window components. This issue happens at changing the Window mode from full screen to windowed mode and vice versa.

    I would appreciate all hints regarding debugging this issue further.

    lprzenioslo.zut.edu.pl

    jsulmJ JKSHJ 2 Replies Last reply
    1
    • B Bremenpl

      Hello there,
      I am using Qt 5.13. My application crashes in the qplatformwindow.cpp file, line 758 where assertion is failed. This is the function:

      /*!
          Requests an QEvent::UpdateRequest event. The event will be
          delivered to the QWindow.
      
          QPlatformWindow subclasses can re-implement this function to
          provide display refresh synchronized updates. The event
          should be delivered using QPlatformWindow::deliverUpdateRequest()
          to not get out of sync with the the internal state of QWindow.
      
          The default implementation posts an UpdateRequest event to the
          window after 5 ms. The additional time is there to give the event
          loop a bit of idle time to gather system events.
      
      */
      void QPlatformWindow::requestUpdate()
      {
          Q_D(QPlatformWindow);
      
          static int updateInterval = []() {
              bool ok = false;
              int customUpdateInterval = qEnvironmentVariableIntValue("QT_QPA_UPDATE_IDLE_TIME", &ok);
              return ok ? customUpdateInterval : 5;
          }();
      
          Q_ASSERT(!d->updateTimer.isActive());
          d->updateTimer.start(updateInterval, Qt::PreciseTimer, window());
      }
      

      I was trying to unroll the call stack in order to check what could be causing this, but its simply too long at starts at app.exec(), where app is:

      QGuiApplication app(argc, argv);
      

      In the main.c. I would like to post my code but its simply too big... I can try to describe the situation at which this is happening. Basically in the QML part I have some Window components. This issue happens at changing the Window mode from full screen to windowed mode and vice versa.

      I would appreciate all hints regarding debugging this issue further.

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

      @Bremenpl said in QPlatformWindow::requestUpdate() Assert:

      call stack

      Is there anything from your own source code in the stack?

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

      B 3 Replies Last reply
      0
      • jsulmJ jsulm

        @Bremenpl said in QPlatformWindow::requestUpdate() Assert:

        call stack

        Is there anything from your own source code in the stack?

        B Offline
        B Offline
        Bremenpl
        wrote on last edited by
        #3

        @jsulm No

        lprzenioslo.zut.edu.pl

        1 Reply Last reply
        0
        • jsulmJ jsulm

          @Bremenpl said in QPlatformWindow::requestUpdate() Assert:

          call stack

          Is there anything from your own source code in the stack?

          B Offline
          B Offline
          Bremenpl
          wrote on last edited by Bremenpl
          #4

          @jsulm Actually, its hard to tell. There is some USER CALL entry, but I am not able to unroll it:

          0_1561445664796_1-41.png

          0_1561445655329_35-74.png

          lprzenioslo.zut.edu.pl

          1 Reply Last reply
          0
          • jsulmJ jsulm

            @Bremenpl said in QPlatformWindow::requestUpdate() Assert:

            call stack

            Is there anything from your own source code in the stack?

            B Offline
            B Offline
            Bremenpl
            wrote on last edited by
            #5

            @jsulm Hi, any new ideas?

            lprzenioslo.zut.edu.pl

            jsulmJ 1 Reply Last reply
            0
            • B Bremenpl

              @jsulm Hi, any new ideas?

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

              @Bremenpl The only idea I have is to check on Qt bug tracker and if you don't find anything file a bug.

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

              B 1 Reply Last reply
              1
              • jsulmJ jsulm

                @Bremenpl The only idea I have is to check on Qt bug tracker and if you don't find anything file a bug.

                B Offline
                B Offline
                Bremenpl
                wrote on last edited by
                #7

                @jsulm Ok, will have to do that. Thanks.
                Just so you know, this problem only occurs in Windows OS. In linux everything works fine. I dont have the possibility to check on Mac OS right now.

                lprzenioslo.zut.edu.pl

                1 Reply Last reply
                1
                • B Bremenpl

                  Hello there,
                  I am using Qt 5.13. My application crashes in the qplatformwindow.cpp file, line 758 where assertion is failed. This is the function:

                  /*!
                      Requests an QEvent::UpdateRequest event. The event will be
                      delivered to the QWindow.
                  
                      QPlatformWindow subclasses can re-implement this function to
                      provide display refresh synchronized updates. The event
                      should be delivered using QPlatformWindow::deliverUpdateRequest()
                      to not get out of sync with the the internal state of QWindow.
                  
                      The default implementation posts an UpdateRequest event to the
                      window after 5 ms. The additional time is there to give the event
                      loop a bit of idle time to gather system events.
                  
                  */
                  void QPlatformWindow::requestUpdate()
                  {
                      Q_D(QPlatformWindow);
                  
                      static int updateInterval = []() {
                          bool ok = false;
                          int customUpdateInterval = qEnvironmentVariableIntValue("QT_QPA_UPDATE_IDLE_TIME", &ok);
                          return ok ? customUpdateInterval : 5;
                      }();
                  
                      Q_ASSERT(!d->updateTimer.isActive());
                      d->updateTimer.start(updateInterval, Qt::PreciseTimer, window());
                  }
                  

                  I was trying to unroll the call stack in order to check what could be causing this, but its simply too long at starts at app.exec(), where app is:

                  QGuiApplication app(argc, argv);
                  

                  In the main.c. I would like to post my code but its simply too big... I can try to describe the situation at which this is happening. Basically in the QML part I have some Window components. This issue happens at changing the Window mode from full screen to windowed mode and vice versa.

                  I would appreciate all hints regarding debugging this issue further.

                  JKSHJ Offline
                  JKSHJ Offline
                  JKSH
                  Moderators
                  wrote on last edited by
                  #8

                  @Bremenpl said in QPlatformWindow::requestUpdate() Assert:

                  I would like to post my code but its simply too big... I can try to describe the situation at which this is happening. Basically in the QML part I have some Window components. This issue happens at changing the Window mode from full screen to windowed mode and vice versa.

                  I would appreciate all hints regarding debugging this issue further.

                  First, check to see if this happens on a bare-bones, Hello World application with a bare Window.

                  If it does, check to see if this happens on a very different compiler (e.g. if you're currently using MSVC, check MinGW)

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  B 1 Reply Last reply
                  1
                  • JKSHJ JKSH

                    @Bremenpl said in QPlatformWindow::requestUpdate() Assert:

                    I would like to post my code but its simply too big... I can try to describe the situation at which this is happening. Basically in the QML part I have some Window components. This issue happens at changing the Window mode from full screen to windowed mode and vice versa.

                    I would appreciate all hints regarding debugging this issue further.

                    First, check to see if this happens on a bare-bones, Hello World application with a bare Window.

                    If it does, check to see if this happens on a very different compiler (e.g. if you're currently using MSVC, check MinGW)

                    B Offline
                    B Offline
                    Bremenpl
                    wrote on last edited by
                    #9

                    @JKSH Hi, I have a followup question:
                    I want to investigate the MSC compiler solution, but I was wondering:

                    • What compiler was used to compile the Qt version (Windows) one downloads using the official installer? Was it MinGW or MSC?
                    • In case it was compiled with MinGW, wont my compiling using MSC be in conflict at some hard to track point?
                    • In case it was compiled with MinGW, should I dowload the sources and compile Qt myself using MSC if I wanted to continue using it with MSC compiler?

                    I am asking because I have never really used MSC compiler with Qt in a serious way- there was always some problems setting it up or compiling, while MinGW worked flawlessly so far...

                    lprzenioslo.zut.edu.pl

                    JKSHJ 1 Reply Last reply
                    0
                    • B Bremenpl

                      @JKSH Hi, I have a followup question:
                      I want to investigate the MSC compiler solution, but I was wondering:

                      • What compiler was used to compile the Qt version (Windows) one downloads using the official installer? Was it MinGW or MSC?
                      • In case it was compiled with MinGW, wont my compiling using MSC be in conflict at some hard to track point?
                      • In case it was compiled with MinGW, should I dowload the sources and compile Qt myself using MSC if I wanted to continue using it with MSC compiler?

                      I am asking because I have never really used MSC compiler with Qt in a serious way- there was always some problems setting it up or compiling, while MinGW worked flawlessly so far...

                      JKSHJ Offline
                      JKSHJ Offline
                      JKSH
                      Moderators
                      wrote on last edited by JKSH
                      #10

                      @Bremenpl said in QPlatformWindow::requestUpdate() Assert:

                      @JKSH Hi, I have a followup question:
                      I want to investigate the MSC compiler solution, but I was wondering:

                      • What compiler was used to compile the Qt version (Windows) one downloads using the official installer? Was it MinGW or MSC?

                      Both variants are provided. When you run the installer, you choose which version(s) you want (notice that you can even choose from multiple versions of MSVC):

                      Qt installer screenshot

                      • In case it was compiled with MinGW, wont my compiling using MSC be in conflict at some hard to track point?

                      It won't be hard to track. When building your project, if you try to link against DLLs that were built using a different compiler, the link will fail completely.

                      • In case it was compiled with MinGW, should I dowload the sources and compile Qt myself using MSC if I wanted to continue using it with MSC compiler?

                      No, just install the versions you want from the installer.

                      I am asking because I have never really used MSC compiler with Qt in a serious way- there was always some problems setting it up or compiling, while MinGW worked flawlessly so far...

                      I've had no problems. I just install the C++ compiler for Visual Studio, and then Qt Creator auto-detects the compiler.

                      It's MSVC, by the way. It stands for the Microsoft Visual C++ compiler.

                      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                      B 2 Replies Last reply
                      3
                      • JKSHJ JKSH

                        @Bremenpl said in QPlatformWindow::requestUpdate() Assert:

                        @JKSH Hi, I have a followup question:
                        I want to investigate the MSC compiler solution, but I was wondering:

                        • What compiler was used to compile the Qt version (Windows) one downloads using the official installer? Was it MinGW or MSC?

                        Both variants are provided. When you run the installer, you choose which version(s) you want (notice that you can even choose from multiple versions of MSVC):

                        Qt installer screenshot

                        • In case it was compiled with MinGW, wont my compiling using MSC be in conflict at some hard to track point?

                        It won't be hard to track. When building your project, if you try to link against DLLs that were built using a different compiler, the link will fail completely.

                        • In case it was compiled with MinGW, should I dowload the sources and compile Qt myself using MSC if I wanted to continue using it with MSC compiler?

                        No, just install the versions you want from the installer.

                        I am asking because I have never really used MSC compiler with Qt in a serious way- there was always some problems setting it up or compiling, while MinGW worked flawlessly so far...

                        I've had no problems. I just install the C++ compiler for Visual Studio, and then Qt Creator auto-detects the compiler.

                        It's MSVC, by the way. It stands for the Microsoft Visual C++ compiler.

                        B Offline
                        B Offline
                        Bremenpl
                        wrote on last edited by
                        #11

                        @JKSH thank you for the followup. In this case I will start from instling the msvc compiler. Also my bad about the spelling.

                        lprzenioslo.zut.edu.pl

                        1 Reply Last reply
                        0
                        • JKSHJ JKSH

                          @Bremenpl said in QPlatformWindow::requestUpdate() Assert:

                          @JKSH Hi, I have a followup question:
                          I want to investigate the MSC compiler solution, but I was wondering:

                          • What compiler was used to compile the Qt version (Windows) one downloads using the official installer? Was it MinGW or MSC?

                          Both variants are provided. When you run the installer, you choose which version(s) you want (notice that you can even choose from multiple versions of MSVC):

                          Qt installer screenshot

                          • In case it was compiled with MinGW, wont my compiling using MSC be in conflict at some hard to track point?

                          It won't be hard to track. When building your project, if you try to link against DLLs that were built using a different compiler, the link will fail completely.

                          • In case it was compiled with MinGW, should I dowload the sources and compile Qt myself using MSC if I wanted to continue using it with MSC compiler?

                          No, just install the versions you want from the installer.

                          I am asking because I have never really used MSC compiler with Qt in a serious way- there was always some problems setting it up or compiling, while MinGW worked flawlessly so far...

                          I've had no problems. I just install the C++ compiler for Visual Studio, and then Qt Creator auto-detects the compiler.

                          It's MSVC, by the way. It stands for the Microsoft Visual C++ compiler.

                          B Offline
                          B Offline
                          Bremenpl
                          wrote on last edited by
                          #12

                          @JKSH Hello again,
                          After you suggestion, I have installed the MSVC 2017 x64 compiler and set it up with Qt Creator. After compiling and testing the code with it, the described bug does not occur. I will stick to this compiler from now on on the Windows platform.

                          Thank you again for your feedback and help.

                          lprzenioslo.zut.edu.pl

                          1 Reply Last reply
                          1
                          • JKSHJ Offline
                            JKSHJ Offline
                            JKSH
                            Moderators
                            wrote on last edited by
                            #13

                            @Bremenpl I'm glad your issue is resolved. Do mark the topic as "Solved" (under the "Topic Tools" button)

                            Happy coding!

                            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                            B 1 Reply Last reply
                            1
                            • JKSHJ JKSH

                              @Bremenpl I'm glad your issue is resolved. Do mark the topic as "Solved" (under the "Topic Tools" button)

                              Happy coding!

                              B Offline
                              B Offline
                              Bremenpl
                              wrote on last edited by
                              #14

                              @JKSH Hi, unfortunately the problem persist with MSVC... I thought I have tested this through, but apparently not:

                              0_1563184343726_97e4dca4-4fed-4772-b538-7866c69a5872-image.png

                              ASSERT: "!d->updateTimer.isActive()" in file kernel\qplatformwindow.cpp, line 758
                              

                              I think I will have to fill in that bug report.

                              lprzenioslo.zut.edu.pl

                              JKSHJ 1 Reply Last reply
                              0
                              • B Bremenpl

                                @JKSH Hi, unfortunately the problem persist with MSVC... I thought I have tested this through, but apparently not:

                                0_1563184343726_97e4dca4-4fed-4772-b538-7866c69a5872-image.png

                                ASSERT: "!d->updateTimer.isActive()" in file kernel\qplatformwindow.cpp, line 758
                                

                                I think I will have to fill in that bug report.

                                JKSHJ Offline
                                JKSHJ Offline
                                JKSH
                                Moderators
                                wrote on last edited by
                                #15

                                @Bremenpl said in QPlatformWindow::requestUpdate() Assert:

                                unfortunately the problem persist with MSVC...

                                Does it only occur in your app?

                                Or does it also occur on a very small, simple, "Hello World" application?

                                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                B 1 Reply Last reply
                                0
                                • JKSHJ JKSH

                                  @Bremenpl said in QPlatformWindow::requestUpdate() Assert:

                                  unfortunately the problem persist with MSVC...

                                  Does it only occur in your app?

                                  Or does it also occur on a very small, simple, "Hello World" application?

                                  B Offline
                                  B Offline
                                  Bremenpl
                                  wrote on last edited by
                                  #16

                                  @JKSH Hi, thanks for answer.
                                  It only occurs in my program. Creating an MWE would be a bit tricky, since there is a lot of logic there. I highly predict that even If I would extract the functionality to an MWE, then the problem would not exist anymore. I have to try anyways though.

                                  For example, now, as a workaround, I replaced all occurencies of window automatic visibility setting to maximized in the qml part. Also, each time a window ia opened, I donr set the visibility immidietally, but start a timer that will do that for me 10 ms later. The problem stopped occuring but the workaround is very bad looking.

                                  lprzenioslo.zut.edu.pl

                                  JKSHJ 1 Reply Last reply
                                  0
                                  • B Bremenpl

                                    @JKSH Hi, thanks for answer.
                                    It only occurs in my program. Creating an MWE would be a bit tricky, since there is a lot of logic there. I highly predict that even If I would extract the functionality to an MWE, then the problem would not exist anymore. I have to try anyways though.

                                    For example, now, as a workaround, I replaced all occurencies of window automatic visibility setting to maximized in the qml part. Also, each time a window ia opened, I donr set the visibility immidietally, but start a timer that will do that for me 10 ms later. The problem stopped occuring but the workaround is very bad looking.

                                    JKSHJ Offline
                                    JKSHJ Offline
                                    JKSH
                                    Moderators
                                    wrote on last edited by
                                    #17

                                    @Bremenpl said in QPlatformWindow::requestUpdate() Assert:

                                    It only occurs in my program. Creating an MWE would be a bit tricky, since there is a lot of logic there. I highly predict that even If I would extract the functionality to an MWE, then the problem would not exist anymore. I have to try anyways though.

                                    A systematic way to locate the problem is:

                                    1. Make a copy of your project
                                    2. Gradually remove large chunks of your code until the problem disappears
                                    3. Restore the last chunk to bring back the problem
                                    4. Gradually remove other bits until the problem disappears

                                    Keep repeating until you have an MWE.

                                    now, as a workaround, I replaced all occurencies of window automatic visibility setting to maximized in the qml part. Also, each time a window ia opened, I donr set the visibility immidietally, but start a timer that will do that for me 10 ms later. The problem stopped occuring but the workaround is very bad looking.

                                    Having a usable workaround is a good thing.

                                    It would be good to find out if the issue is in your code or in Qt itself.

                                    @Bremenpl said in QPlatformWindow::requestUpdate() Assert:

                                    I am using Qt 5.13. My application crashes

                                    Has this always happened with your application? Do you remember when the problem started? (For example... After you upgraded to Qt 5.13? After you added a new feature?)

                                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                    B 1 Reply Last reply
                                    1
                                    • JKSHJ JKSH

                                      @Bremenpl said in QPlatformWindow::requestUpdate() Assert:

                                      It only occurs in my program. Creating an MWE would be a bit tricky, since there is a lot of logic there. I highly predict that even If I would extract the functionality to an MWE, then the problem would not exist anymore. I have to try anyways though.

                                      A systematic way to locate the problem is:

                                      1. Make a copy of your project
                                      2. Gradually remove large chunks of your code until the problem disappears
                                      3. Restore the last chunk to bring back the problem
                                      4. Gradually remove other bits until the problem disappears

                                      Keep repeating until you have an MWE.

                                      now, as a workaround, I replaced all occurencies of window automatic visibility setting to maximized in the qml part. Also, each time a window ia opened, I donr set the visibility immidietally, but start a timer that will do that for me 10 ms later. The problem stopped occuring but the workaround is very bad looking.

                                      Having a usable workaround is a good thing.

                                      It would be good to find out if the issue is in your code or in Qt itself.

                                      @Bremenpl said in QPlatformWindow::requestUpdate() Assert:

                                      I am using Qt 5.13. My application crashes

                                      Has this always happened with your application? Do you remember when the problem started? (For example... After you upgraded to Qt 5.13? After you added a new feature?)

                                      B Offline
                                      B Offline
                                      Bremenpl
                                      wrote on last edited by
                                      #18

                                      @JKSH will try to make the MWE the way you instructed me to do. Thanks. As for the version- I really cant tell, since i prev qt version I was not that far in the project progress...

                                      lprzenioslo.zut.edu.pl

                                      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