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. Read access violation error

Read access violation error

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 4 Posters 1.7k 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.
  • I Offline
    I Offline
    ivanicy
    wrote on 1 Mar 2021, 12:38 last edited by
    #1

    Hello!

    I have an application that contains a QGraphicsView. This QGraphicsView loads images and items on it. Suddenly, I don't know if it is when I draw more items or when I load the items, the app crashes with the Read access violation error. This causes qt also crash and shut down. I only can see that there is a problem with QTreeWidget::findItems... but I don't know what is it in my case.

    So, my question is if there is a way to see a log of the application to see what is really going wrong?

    Thank you very much!

    A 1 Reply Last reply 1 Mar 2021, 12:40
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 1 Mar 2021, 12:39 last edited by
      #2

      @ivanicy said in Read access violation error:

      So, my question is if there is a way to see a log of the application to see what is really going wrong?

      As always: use a debugger to see where it exactly crashes.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      I 1 Reply Last reply 1 Mar 2021, 12:42
      1
      • I ivanicy
        1 Mar 2021, 12:38

        Hello!

        I have an application that contains a QGraphicsView. This QGraphicsView loads images and items on it. Suddenly, I don't know if it is when I draw more items or when I load the items, the app crashes with the Read access violation error. This causes qt also crash and shut down. I only can see that there is a problem with QTreeWidget::findItems... but I don't know what is it in my case.

        So, my question is if there is a way to see a log of the application to see what is really going wrong?

        Thank you very much!

        A Offline
        A Offline
        artwaw
        wrote on 1 Mar 2021, 12:40 last edited by
        #3

        @ivanicy Like @Christian-Ehrlicher said. Also, you can use qDebug() to output parameters for findItems, so you can actually see on what parameter it crashed.

        For more information please re-read.

        Kind Regards,
        Artur

        I 1 Reply Last reply 1 Mar 2021, 12:46
        0
        • C Christian Ehrlicher
          1 Mar 2021, 12:39

          @ivanicy said in Read access violation error:

          So, my question is if there is a way to see a log of the application to see what is really going wrong?

          As always: use a debugger to see where it exactly crashes.

          I Offline
          I Offline
          ivanicy
          wrote on 1 Mar 2021, 12:42 last edited by
          #4

          @Christian-Ehrlicher I use it, but Qt doesn't show me the line that was wrong. Let me show you an image:

          c2a7da67-844b-4597-bc55-3c6de296d897-image.png

          1 Reply Last reply
          0
          • A artwaw
            1 Mar 2021, 12:40

            @ivanicy Like @Christian-Ehrlicher said. Also, you can use qDebug() to output parameters for findItems, so you can actually see on what parameter it crashed.

            I Offline
            I Offline
            ivanicy
            wrote on 1 Mar 2021, 12:46 last edited by
            #5

            @artwaw The problem is that I am not using this function. I think that Qt use it in background when I load the items

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on 1 Mar 2021, 12:47 last edited by
              #6

              Go up the stack until you see from where findItems() is called. Looks like an infinite loop.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              I 1 Reply Last reply 1 Mar 2021, 12:48
              1
              • C Christian Ehrlicher
                1 Mar 2021, 12:47

                Go up the stack until you see from where findItems() is called. Looks like an infinite loop.

                I Offline
                I Offline
                ivanicy
                wrote on 1 Mar 2021, 12:48 last edited by
                #7

                @Christian-Ehrlicher I can't do that because Qt crashes and close.

                C 1 Reply Last reply 1 Mar 2021, 12:49
                0
                • I ivanicy
                  1 Mar 2021, 12:48

                  @Christian-Ehrlicher I can't do that because Qt crashes and close.

                  C Offline
                  C Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on 1 Mar 2021, 12:49 last edited by
                  #8

                  @ivanicy I don't understand. Why can't you go up in the stack trace to see where it crashes? Does the debugger crash?

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  I 1 Reply Last reply 1 Mar 2021, 12:50
                  0
                  • C Christian Ehrlicher
                    1 Mar 2021, 12:49

                    @ivanicy I don't understand. Why can't you go up in the stack trace to see where it crashes? Does the debugger crash?

                    I Offline
                    I Offline
                    ivanicy
                    wrote on 1 Mar 2021, 12:50 last edited by
                    #9

                    @Christian-Ehrlicher When I try to scroll for the entries Qt doesn't respond and then close itself

                    1 Reply Last reply
                    0
                    • C Offline
                      C Offline
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on 1 Mar 2021, 12:56 last edited by
                      #10

                      @ivanicy said in Read access violation error:

                      Qt doesn't respond

                      What do you mean with 'Qt' here? QtCreator? this is not Qt but an IDE...
                      I'm pretty sure you call findItems() somewhere in your code.

                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                      Visit the Qt Academy at https://academy.qt.io/catalog

                      I 1 Reply Last reply 1 Mar 2021, 13:01
                      0
                      • C Christian Ehrlicher
                        1 Mar 2021, 12:56

                        @ivanicy said in Read access violation error:

                        Qt doesn't respond

                        What do you mean with 'Qt' here? QtCreator? this is not Qt but an IDE...
                        I'm pretty sure you call findItems() somewhere in your code.

                        I Offline
                        I Offline
                        ivanicy
                        wrote on 1 Mar 2021, 13:01 last edited by
                        #11

                        @Christian-Ehrlicher Yes, I mean Qt Creator and no, I don't call findItems anywhere. I don't know if QGraphicsScene use it when I call to the addItem function or something like that but I don't call it explicitly.

                        J 1 Reply Last reply 1 Mar 2021, 13:08
                        0
                        • C Offline
                          C Offline
                          Christian Ehrlicher
                          Lifetime Qt Champion
                          wrote on 1 Mar 2021, 13:08 last edited by
                          #12

                          You have no other chance to either reduce you code until it no longer crashes or write a minimal example to reproduce the problem. Also check if the stuff you pass to addItem() are valid.

                          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                          Visit the Qt Academy at https://academy.qt.io/catalog

                          1 Reply Last reply
                          2
                          • I ivanicy
                            1 Mar 2021, 13:01

                            @Christian-Ehrlicher Yes, I mean Qt Creator and no, I don't call findItems anywhere. I don't know if QGraphicsScene use it when I call to the addItem function or something like that but I don't call it explicitly.

                            J Offline
                            J Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on 1 Mar 2021, 13:08 last edited by
                            #13

                            @ivanicy You can also try to disable parts of your code until it stops crashing then you know roughly where it is. And if you use CVS like Git you can check the changes since last stable version.

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

                            1 Reply Last reply
                            2

                            7/13

                            1 Mar 2021, 12:48

                            • Login

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