[Interest] Program runs only on four core processors.... sometimes.

Till Oliver Knoll till.oliver.knoll at gmail.com
Thu Mar 21 10:37:10 CET 2013


2013/3/21 Guido Seifert <wargand at gmx.de>:
>
>> Now we assume it is a deadlock caused by some race conditions for some network
>> (socket?) resources. But maye it is simply because the data is sometimes wrong?
>
> Hi and good morning,

I'd just like to add the fact that I drove one station too far with
the train this morning, because I was busy replying to your question.
Luckily I live in Switzerland where everything is pretty small and
tiny, such as the distances between train stations, so I could walk
back ;)

> the data is never wrong. At least one point where I can be sure. :-)

I'd /love/ to have your data source - may I borrow some of your data? ;)

>> Imagine one service would send image data "worth 4 terrabytes" (because the "content
>> size field" was wrongly set, or the height/width fields), so what would your main
>> program do? Would it try to really create a QImage that large and hence be busy
>> allocating virtual memory?
>
> Can't happen. I add images manually. An image that size would crash the gui long before it reaches the part, which causes the problems now.

Yes, but an application trying to squeeze the last bytes out of the
system takes quite some time - at least on OS X - until the OS finally
decides to terminate that process...

>
>> That would be visible off course by its memory consumption which would grow and grow.
>
> Memory is just fine. And I think such a huge image would tear down the whole system and not only the program.

... but off course you spotted my weak point in my argument already ;)
Anyway, my point was rather it might be some other (silly) thing which
might make the problem appear as it was a "race condition".

>
>> Off course my guess totally does not explain why it would (seem to) work on some
>> machines, and not on others (but that /could/ be a pure coincidence which would wrongly
>> lead us to believe it must be a threading/deadlock problem).
>
> I think, it is Thiago's priority inversion. There are hints, which strongly point in that direction, e.g. I can unfreeze the main program when I kill one or two of its services. Discovered this yesterday. Now I have at least a fighting chance to fix the problem. Thanks, Thiago. :-)

Another thing that I forgot: while the main process is "freezing",
what does the CPU utilisation say? Is it high and the process is
actively "idle" in some loop? Or is it low and the process is just
"waiting for something"?

Could you remote debug it? Maybe trying to attach with a remote
debugger (I think that is even possible via some menu entry in e.g. Qt
Creator) would tell you where the process is currently stuck (but
you'd probably need to compile with debug info, and that might already
alter the behaviour again.

Cheers, Oliver



More information about the Interest mailing list