Solved I occasionally make the following mistakes when using Qt4.7 program, please help me check.thanks
-
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. -
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.
-
@LeLev @kshegunov One of the problems is that when a window containing QTimer and QTcpSocket is opened, it occasionally freezes during the closing process.
-
@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.
-
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.
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 environmentThe 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:
- 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 () * *. - 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.
- Customer response before the program crash, the interface time will not be automatically refreshed.
-
@kshegunov I forgot to add @ here. Looking forward to your reply.
-
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, ordelete
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 useQObject::deleteLater
whenever possible and never directly deleteQObject
instances directly. -
This post is deleted! -
@kshegunov Ok, thank you very much
-
@None1 if your issue is solved, please don't forget to mark your post as such! Thanks
-
The uncertainty should be due to UDP processing of Qt4.7.4