[mythtv] Startup crash (Was DVB SI rework - Help needed)

Roger James roger at beardandsandals.co.uk
Tue Jan 31 08:06:23 UTC 2017


On 30 January 2017 11:06:41 am Stuart Auchterlonie 
<stuarta at squashedfrog.net> wrote:

> On 29/01/17 12:07, Roger James wrote:
>> On 28 January 2017 11:46:50 pm Roger James <roger at beardandsandals.co.uk>
>> wrote:
>>
>>> On 28 January 2017 11:06:20 pm Roger Siddons
>>> <dizygotheca at ntlworld.com> wrote:
>>>
>>>> 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.
>>>> _______________________________________________
>>>> mythtv-dev mailing list
>>>> mythtv-dev at mythtv.org
>>>> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
>>>> http://wiki.mythtv.org/Mailing_List_etiquette
>>>> MythTV Forums: https://forum.mythtv.org
>>>
>>> It is a Shuttle XS35GT, hardly a supercomputer😀. It only started
>>> exhibiting these problems when I stuck a SSD in it.
>>>
>>> Roger
>>
>> Hi Roger
>>
>> I was a bit loose with my description of my original findings. The
>> problem is definitely related to loading and unloading of Qt image
>> handler plugins. The crash is caused by a QImage::Load calling a pointer
>> to a plugin that has already unloaded. I am currently testing with a
>> build directly from 28 fixes (rather than mythbuntu debs) and that
>> crashes at a different place in the startup process. It crashes in the
>> logging thread when it access a null pointer in the incoming log
>> messages queue.
>>
>> I will look at this later today. The weird thing with all these crashes
>> is that when the wrapper script restarts the front-end it works perfectly.
>>
>
> Do you use Qt-5.6.1 ???
>
> This seems to bite us on a regular basis, and it seems to have been
> fixed in Qt-5.7
>
>
> Regards
> Stuart
>
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

Doh,

Thanks Stuart,

I built it on my little shuttle front-end box. I forgot to check which 
version of Qt it was, just assumed it was 5.7. It is actually 5.5.1

Roger




More information about the mythtv-dev mailing list