April 9, 2012

Deleted Member # 269f Deleted Member # 269f
Lab Rat
251 posts

Debugging paint event = segmentation fault?

 

I’ve been trying to debug a QWidget paint event, nothing too fancy, just a rectangle being filled, and I keep on getting segmentation fault errors. I am using Creator and Qt 4.8.0. Any ideas?

3 replies

April 9, 2012

koahnig koahnig
Mad Scientist
2099 posts

I would not expect that the paint event while debugging is the source of your problem. It is more likely that there has been something messed up before the actual paint event. Some kind of a pointer error. Certainly something you need to worry about.
If the paint event is at the beginning, there could be something with the initialization of some static classes.
If the fault comes up later during execution, you may want to move it forward. Unfortunately, you may not see a fault, but the source of the problem is still before this execution step.
Using different tools, such as profilers, may help or provide a hint.

April 9, 2012

Deleted Member # 269f Deleted Member # 269f
Lab Rat
251 posts

It is not even a project, it is just a single widget with nothing but a paint event that fills a rectangle. The widget itself runs just fine, but any attempt to debug it ends up in a segmentation fault signal from the OS.

April 9, 2012

miroslav miroslav
Ant Farmer
228 posts

Still sounds strange. Setting a breakpoint in the paint event may cause the program to stop a lot and not update, but not to crash.

Maybe you can post a backtrace along with some snippets of your code?

 Signature 

Mirko Boehm | .(JavaScript must be enabled to view this email address) | KDE e.V.
FSFE Fellow
Qt Certified Specialist

 
  ‹‹ Question about cross platform programming in Qt      *[SOLVED]* Multiple signals and single slot... ››

You must log in to post a reply. Not a member yet? Register here!