Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. I occasionally make the following mistakes when using Qt4.7 program, please help me check.thanks
Qt 6.12 LTS is out! See what's new in the release blog

I occasionally make the following mistakes when using Qt4.7 program, please help me check.thanks

Scheduled Pinned Locked Moved Solved General and Desktop
15 Posts 4 Posters 3.9k Views 2 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.
  • N None1

    Hi.
    Thank you for following my question.
    main.cpp:203
    QApplication a(argc, argv);
    //...
    a.exec();

    kshegunovK Offline
    kshegunovK Offline
    kshegunov
    Moderators
    wrote on last edited by
    #5

    Most often that kind of stack trace is produced by having an invalid receiver object. Usually it's caused by having delete in a slot and/or having a queued event for an object, which was deleted in the meantime.

    Read and abide by the Qt Code of Conduct

    1 Reply Last reply
    3
    • ODБOïO ODБOï

      @None1 hi,
      well i never used qt4 nor linux so can't really help you, but let's clarify the situation for someone who has knowlage in this.

      What do you mean by "I occasionally make the following mistakes when using Qt4.7 program" ?

      Which user action is triggering this error ?
      Can you run your program in debug mode and reproduct this error ?

      from quick search on the web
      this looks similar
      https://stackoverflow.com/questions/5896495/qcoreapplicationnotifyinternal-segmentation-fault

      N Offline
      N Offline
      None1
      wrote on last edited by
      #6

      I read this blog.According to the blogger, I also blocked UDP related processing, but the problem has not been solved.This exception is not reproducible and may occur irregularly.

      1 Reply Last reply
      0
      • ODБOïO ODБOï

        @None1 hi,
        well i never used qt4 nor linux so can't really help you, but let's clarify the situation for someone who has knowlage in this.

        What do you mean by "I occasionally make the following mistakes when using Qt4.7 program" ?

        Which user action is triggering this error ?
        Can you run your program in debug mode and reproduct this error ?

        from quick search on the web
        this looks similar
        https://stackoverflow.com/questions/5896495/qcoreapplicationnotifyinternal-segmentation-fault

        N Offline
        N Offline
        None1
        wrote on last edited by
        #7

        @LeLev @kshegunov One of the problems is that when a window containing QTimer and QTcpSocket is opened, it occasionally freezes during the closing process.

        kshegunovK 1 Reply Last reply
        0
        • N None1

          @LeLev @kshegunov One of the problems is that when a window containing QTimer and QTcpSocket is opened, it occasionally freezes during the closing process.

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #8

          @None1 said in I occasionally make the following mistakes when using Qt4.7 program, please help me check.thanks:

          One of the problems is that when a window containing QTimer and QTcpSocket is opened, it occasionally freezes during the closing process.

          Is this the same problem or an unrelated issue?

          @None1 said in I occasionally make the following mistakes when using Qt4.7 program, please help me check.thanks:

          I read this blog.According to the blogger, I also blocked UDP related processing, but the problem has not been solved.

          What blog? Also what UDP processing? we haven't mentioned anything UDP related. Something's also not quite clear are you really using Qt4.7? This Qt version is many many years old, are you sure you don't mean QtCreator 4.7?

          This exception is not reproducible and may occur irregularly.

          Nonetheless you should investigate and try to reproduce it. Or rather try to determine and reproduce the sequence of events that leads to the issue.

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          2
          • N Offline
            N Offline
            None1
            wrote on last edited by
            #9

            hi,
            Thank you for following my question.
            First of all, let me answer your question. I am not familiar with Qt FORUM, and I wonder if you can see the answer in the screenshot below.In the reply here, I hope you can also see these contents and help me confirm whether they are relevant, so @ you.
            0_1552353086948_259f70d1-97fd-408c-86b1-7e84591014cb-image.png

            Thank you again, I hope the following supplement can make the question more detailed.
            The failure occurred on the client, which has a Qt environment version of 4.7.4
            The following is the Qt version in my compilation environment

            0_1552351350050_4440206f-4cff-46e3-8bf7-2e5f7a6294e7-image.png

            The first picture I asked was the output interface from GDB debugging the core file. The program would crash irregularly and generate this file about once or twice a day.

            Related phenomena:

            1. Customer response before the program crash, the interface time will not be automatically refreshed.
              My program interface time display is to pass the custom QLabel controls, which use QTimer, per second for a * * QDateTime: : currentDateTime refresh () * *.
            2. Customer's response is that the window cannot be displayed normally when some Windows are opened.
              After my analysis, there are also some QTimer calls in these Windows. Combined with the first point, I judge that the failure of QTimer is the cause.
            N 1 Reply Last reply
            0
            • N None1

              hi,
              Thank you for following my question.
              First of all, let me answer your question. I am not familiar with Qt FORUM, and I wonder if you can see the answer in the screenshot below.In the reply here, I hope you can also see these contents and help me confirm whether they are relevant, so @ you.
              0_1552353086948_259f70d1-97fd-408c-86b1-7e84591014cb-image.png

              Thank you again, I hope the following supplement can make the question more detailed.
              The failure occurred on the client, which has a Qt environment version of 4.7.4
              The following is the Qt version in my compilation environment

              0_1552351350050_4440206f-4cff-46e3-8bf7-2e5f7a6294e7-image.png

              The first picture I asked was the output interface from GDB debugging the core file. The program would crash irregularly and generate this file about once or twice a day.

              Related phenomena:

              1. Customer response before the program crash, the interface time will not be automatically refreshed.
                My program interface time display is to pass the custom QLabel controls, which use QTimer, per second for a * * QDateTime: : currentDateTime refresh () * *.
              2. Customer's response is that the window cannot be displayed normally when some Windows are opened.
                After my analysis, there are also some QTimer calls in these Windows. Combined with the first point, I judge that the failure of QTimer is the cause.
              N Offline
              N Offline
              None1
              wrote on last edited by
              #10

              @kshegunov I forgot to add @ here. Looking forward to your reply.

              kshegunovK 1 Reply Last reply
              0
              • N None1

                @kshegunov I forgot to add @ here. Looking forward to your reply.

                kshegunovK Offline
                kshegunovK Offline
                kshegunov
                Moderators
                wrote on last edited by
                #11

                I don't know what to suggest is all. I haven't worked with Qt this old for a long, long time and moreover you didn't provide any additional information on which I'm to speculate. If you're not using sockets I don't see how the stackoverflow thread is relevant. My best suggestion at this point is to try and reproduce the bug on your development machine and try to discern at least the region of code that's suspect. I've already said what you should be looking for - delete in a slot, or delete whenever you have some kind of event to be sent to the object. As a matter of fact a defensive programming practice in this case is to use QObject::deleteLater whenever possible and never directly delete QObject instances directly.

                Read and abide by the Qt Code of Conduct

                N 2 Replies Last reply
                2
                • kshegunovK kshegunov

                  I don't know what to suggest is all. I haven't worked with Qt this old for a long, long time and moreover you didn't provide any additional information on which I'm to speculate. If you're not using sockets I don't see how the stackoverflow thread is relevant. My best suggestion at this point is to try and reproduce the bug on your development machine and try to discern at least the region of code that's suspect. I've already said what you should be looking for - delete in a slot, or delete whenever you have some kind of event to be sent to the object. As a matter of fact a defensive programming practice in this case is to use QObject::deleteLater whenever possible and never directly delete QObject instances directly.

                  N Offline
                  N Offline
                  None1
                  wrote on last edited by
                  #12
                  This post is deleted!
                  1 Reply Last reply
                  0
                  • kshegunovK kshegunov

                    I don't know what to suggest is all. I haven't worked with Qt this old for a long, long time and moreover you didn't provide any additional information on which I'm to speculate. If you're not using sockets I don't see how the stackoverflow thread is relevant. My best suggestion at this point is to try and reproduce the bug on your development machine and try to discern at least the region of code that's suspect. I've already said what you should be looking for - delete in a slot, or delete whenever you have some kind of event to be sent to the object. As a matter of fact a defensive programming practice in this case is to use QObject::deleteLater whenever possible and never directly delete QObject instances directly.

                    N Offline
                    N Offline
                    None1
                    wrote on last edited by
                    #13

                    @kshegunov Ok, thank you very much

                    Pablo J. RoginaP 1 Reply Last reply
                    0
                    • N None1

                      @kshegunov Ok, thank you very much

                      Pablo J. RoginaP Offline
                      Pablo J. RoginaP Offline
                      Pablo J. Rogina
                      wrote on last edited by
                      #14

                      @None1 if your issue is solved, please don't forget to mark your post as such! Thanks

                      Upvote the answer(s) that helped you solve the issue
                      Use "Topic Tools" button to mark your post as Solved
                      Add screenshots via postimage.org
                      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                      1 Reply Last reply
                      0
                      • N Offline
                        N Offline
                        None1
                        wrote on last edited by
                        #15

                        The uncertainty should be due to UDP processing of Qt4.7.4

                        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
                        • Unsolved