[mythtv] Problems with dynamic_cast

Mark Spieth mark at digivation.com.au
Wed Jan 29 13:05:25 UTC 2020


On 1/29/2020 3:02 PM, Mark Spieth wrote:
>
> On 29/01/2020 1:35 pm, David Engel wrote:
>> On Wed, Jan 29, 2020 at 11:24:45AM +1100, Mark Spieth wrote:
>>> I have another instrumented test if someone can test it. Otherwise 
>>> it will
>>> have to wait for approx 7 hours when I get home.
>>>
>>> http://digivation.com.au/debian/mythfrontend-20200129-arm64-v31-Pre-1828-g4b2272287a-dirty.apk 
>>>
>>>
>>> use adb logcat | tee x.log
>>>
>>> The test is
>>>
>>> settings -> video -> playback -> change profile to something else
>>>
>>> Then email me with the last bit of the log where it mentions dce 
>>> especially.
>> 01-28 20:30:23.656 32532 32555 I mfe     : 
>> mythdialogbox.cpp:452:SendEvent  post dce:140920670464 
>> dce_e:P21DialogCompletionEvent:140813528616 ev:140920670464 
>> ev_e:P6QEvent:140813528641
>> 01-28 20:30:23.656 32532 32555 I mfe     : 
>> standardsettings.cpp:815:customEvent  evtype:65518
>> 01-28 20:30:23.656 32532 32555 I mfe     : 
>> standardsettings.cpp:832:customEvent  dce:0 e:P6QEvent:140818516747 
>> qe:P6QEvent:140818516747 d2:P21DialogCompletionEvent:140818516722
>>
>> I'll send you the whole log privately if you want it.
>>
> Well thats interesting. sender newed DialogCompletionEvent type is 
> different from one in libmyth. no wonder it doesnt work.
>
> now to try -rdynamic as a SO post suggests.

Found it!

The key is

https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md#rtti_exceptions-not-working-across-library-boundaries

I added a virtual destructor to DialogCompletionEvent and that one 
works. Now to do it for the rest that use dynamic_cast. Ive left 
-rdynamic in place as others have said its necessary.

It works as it forces a vtable to exist only in the so that has the 
virtual function defined. Every subclass needs at least one defined non 
inline virtual function.

Will push stuff before bed. Watching to do.

Mark


More information about the mythtv-dev mailing list