[mythtv] Startup crash (Was DVB SI rework - Help needed)
Roger Siddons
dizygotheca at ntlworld.com
Sat Jan 28 23:05:56 UTC 2017
On 22/01/17 16:26, Roger James wrote:
>
> I did raise an issue on this a while back here
>
> https://code.mythtv.org/trac/ticket/12909
>
> And here
>
> https://bugs.launchpad.net/mythbuntu/+bug/1635685
>
> I coded up a fix for the crash in QImage but that just moved the crash a
> bit further down the mythfrontend initialisation sequence into a number
> of random other crashes all of which seem to be Qt signalling related. I
> can send you stack traces for these if you wish. I think I still have
> the cores.
>
> This all seems to relate to Qt not being thread safe or reentrant in a
> lot of areas. This exacerbated by running on a fast multi core 64bit
> processor with a fast SSD drive.
>
I doubt there's an issue in the Myth image loading. It's old code and
heavily exercised when navigating the UI so any issue would have
surfaced before.
Each thread loads a single image so re-entrancy is sufficient. There's
explicit code to prevent multiple threads from loading the same image so
thread-safety isn't required.
Qt seems to have recurring issues with loading/unloading plugins at
startup/shutdown that involve QFactoryLoader. It crops up in many bug
reports.
Qt5 bundles 20+ image plugins (QT_DIR/plugins/imageformats) that seem to
get loaded when the first screen (main menu) is displayed. Usually that
completes before MythUi starts but I wonder whether, on your
super-whizzy machine, Myth starts loading its image cache whilst Qt is
still loading its plugins.
To see the plugin action, try:
QT_DEBUG_PLUGINS=1 mythfrontend -v gui,file
Qt logging isn't date-stamped and will interleave with Myth logs but it
may give you a feel for any interference that's occurring.
AFAIK Myth only uses png & jpg images, which are supposedly supported by
core Qt. So a quick test is to remove all the image plugins to see if
that mitigates the crash.
If I'm right then Peter's work may well solve it. His splash-screen
(presumably a Qt widget) should initialise Qt gui and load the plugins
long before the themed UI starts loading images.
More information about the mythtv-dev
mailing list