views:

39

answers:

1

I have a qApp that generates a segmentation fault only when a breakpoint is inserted in the code (I can put it at different places) and only after 4-5 breakpoint stops. Do I have a problem with my code or is this a DBG bug. the method is part of a QThread Class.

Basically what I did is i took the mandlebrot example, and have 3 instances of it in my program. So the program would look like a mainwindow that has 3 mandlebrot widgets in it, one besides the other. Is it possible that GDB doesnt support debugging qthread subclasses that are instantiated multiple times or is it thread-unsafe to do so. I dont have any problems at run-time.

+2  A: 

It looks like the problem is that you have unsynchronized access to some object in your code and breakpoints are happily allows you to see the problem.

Kirill V. Lyadvinsky
do you mean multiple threads trying to acces objects at the same time?
yan bellavance
Yes, multiple threads.
Kirill V. Lyadvinsky
actually, at the moment this occurs, nothing outside the class interacts with it. Only the constructor gets called and this is done without any resources that are external to the class itself.
yan bellavance