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
Forum Updated to NodeBB v4.3 + New Features

Read access violation error

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 4 Posters 1.7k 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.
  • ivanicyI Offline
    ivanicyI Offline
    ivanicy
    wrote on 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!

    artwawA 1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 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

      ivanicyI 1 Reply Last reply
      1
      • ivanicyI ivanicy

        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!

        artwawA Offline
        artwawA Offline
        artwaw
        wrote on 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

        ivanicyI 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @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.

          ivanicyI Offline
          ivanicyI Offline
          ivanicy
          wrote on 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
          • artwawA artwaw

            @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.

            ivanicyI Offline
            ivanicyI Offline
            ivanicy
            wrote on 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
            • Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on 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

              ivanicyI 1 Reply Last reply
              1
              • Christian EhrlicherC Christian Ehrlicher

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

                ivanicyI Offline
                ivanicyI Offline
                ivanicy
                wrote on last edited by
                #7

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

                Christian EhrlicherC 1 Reply Last reply
                0
                • ivanicyI ivanicy

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

                  Christian EhrlicherC Online
                  Christian EhrlicherC Online
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on 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

                  ivanicyI 1 Reply Last reply
                  0
                  • Christian EhrlicherC Christian Ehrlicher

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

                    ivanicyI Offline
                    ivanicyI Offline
                    ivanicy
                    wrote on 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
                    • Christian EhrlicherC Online
                      Christian EhrlicherC Online
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on 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

                      ivanicyI 1 Reply Last reply
                      0
                      • Christian EhrlicherC Christian Ehrlicher

                        @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.

                        ivanicyI Offline
                        ivanicyI Offline
                        ivanicy
                        wrote on 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.

                        jsulmJ 1 Reply Last reply
                        0
                        • Christian EhrlicherC Online
                          Christian EhrlicherC Online
                          Christian Ehrlicher
                          Lifetime Qt Champion
                          wrote on 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
                          • ivanicyI ivanicy

                            @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.

                            jsulmJ Offline
                            jsulmJ Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on 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

                            • Login

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