Read access violation error
-
wrote on 1 Mar 2021, 12:38 last edited by
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!
-
@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.
-
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!
wrote on 1 Mar 2021, 12:40 last edited by@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. -
@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.
wrote on 1 Mar 2021, 12:42 last edited by@Christian-Ehrlicher I use it, but Qt doesn't show me the line that was wrong. Let me show you an image:
-
@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. -
Go up the stack until you see from where findItems() is called. Looks like an infinite loop.
-
Go up the stack until you see from where findItems() is called. Looks like an infinite loop.
wrote on 1 Mar 2021, 12:48 last edited by@Christian-Ehrlicher I can't do that because Qt crashes and close.
-
@Christian-Ehrlicher I can't do that because Qt crashes and close.
@ivanicy I don't understand. Why can't you go up in the stack trace to see where it crashes? Does the debugger crash?
-
@ivanicy I don't understand. Why can't you go up in the stack trace to see where it crashes? Does the debugger crash?
wrote on 1 Mar 2021, 12:50 last edited by@Christian-Ehrlicher When I try to scroll for the entries Qt doesn't respond and then close itself
-
@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. -
@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.wrote on 1 Mar 2021, 13:01 last edited by@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.
-
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.
-
@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.
@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.
3/13