Mailing List Archive

macOS build issues - looking for advice / pointers
I've tracked down the issue on macOS that's causing the crash in Big Sur.
It appears to be induced by the _findAppleRemoteDevice function.

Any suggestions on how to go about trying to fix the issue? A thought was
to just set the default appleremote behavior to disable for darwin as it's
been a long time since apple sold a remote with a mac.

Another thought is it could be related to the same macOS deprecations
corrected with this commit (i.e. Apple inserted the same depraction into
the lastest 11.7.3 / Xcode):
https://github.com/MythTV/mythtv/commit/37875831a06acb651bfb545b3482281a0bb90caa
<https://github.com/MythTV/mythtv/commit/37875831a06acb651bfb545b3482281a0bb90caa>

Here's lldb's output of the crash:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=1, address=0x0)
* frame #0: 0x0000000105310869
libmythui-33.33.dylib`_findAppleRemoteDevice(char const*) + 57
frame #1: 0x00000001053106d0
libmythui-33.33.dylib`AppleRemote::startListening() + 48
frame #2: 0x00000001052dfbf6
libmythui-33.33.dylib`MythInputDeviceHandler::Start() + 326
frame #3: 0x00000001052dfa84
libmythui-33.33.dylib`MythInputDeviceHandler::MythInputDeviceHandler(MythMainWindow*)
+ 84
frame #4: 0x00000001052dfccd
libmythui-33.33.dylib`MythInputDeviceHandler::MythInputDeviceHandler(MythMainWindow*)
+ 29
frame #5: 0x0000000105177f2a
libmythui-33.33.dylib`MythMainWindow::MythMainWindow(bool) + 538
frame #6: 0x0000000105177b85
libmythui-33.33.dylib`MythMainWindow::MythMainWindow(bool) + 37
frame #7: 0x0000000105177a99
libmythui-33.33.dylib`MythMainWindow::getMainWindow(bool) + 121
frame #8: 0x00000001056f5e3b
libmyth-33.33.dylib`MythContextPrivate::TempMainWindow(bool) + 171
frame #9: 0x00000001056fe58e
libmyth-33.33.dylib`MythContextPrivate::ShowGuiStartup() + 46
frame #10: 0x00000001056fb1ff
libmyth-33.33.dylib`MythContextPrivate::TestDBconnection(bool) + 5583
frame #11: 0x00000001056f6c4e
libmyth-33.33.dylib`MythContextPrivate::FindDatabase(bool, bool) + 574
frame #12: 0x00000001056f6500
libmyth-33.33.dylib`MythContextPrivate::Init(bool, bool, bool, bool) + 256
frame #13: 0x0000000105700d34
libmyth-33.33.dylib`MythContext::Init(bool, bool, bool, bool) + 1652
frame #14: 0x0000000100010ef6 mythfrontend`main + 3126
frame #15: 0x00007fff20453f3d libdyld.dylib`start + 1


libmythui-33.33.dylib`_findAppleRemoteDevice:
-> 0x105310869 <+57>: movl (%rax), %edi
0x10531086b <+59>: movq -0x10(%rbp), %rsi
0x10531086f <+63>: leaq -0x14(%rbp), %rdx
0x105310873 <+67>: callq 0x105349cc2 ; symbol stub for:
IOServiceGetMatchingServices


Process 42006 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=1, address=0x0)
frame #0: 0x0000000105310869
libmythui-33.33.dylib`_findAppleRemoteDevice(char const*) + 57
libmythui-33.33.dylib`_findAppleRemoteDevice:
-> 0x105310869 <+57>: movl (%rax), %edi
0x10531086b <+59>: movq -0x10(%rbp), %rsi
0x10531086f <+63>: leaq -0x14(%rbp), %rdx
0x105310873 <+67>: callq 0x105349cc2 ; symbol stub for:
IOServiceGetMatchingServices
Target 0: (mythfrontend) stopped.


Thanks in advance for the help!!!!
John
Re: macOS build issues - looking for advice / pointers [ In reply to ]
It was ugly code when I wrote it (in 2008!!!).

I think AppleRemote:: has outlived its usefulness.


git rm ???



> On 13 Feb 2023, at 10:57 am, John Hoyt <john.hoyt@gmail.com> wrote:
>
> I've tracked down the issue on macOS that's causing the crash in Big Sur. It appears to be induced by the _findAppleRemoteDevice function.
>
> Any suggestions on how to go about trying to fix the issue? A thought was to just set the default appleremote behavior to disable for darwin as it's been a long time since apple sold a remote with a mac.
>
> Another thought is it could be related to the same macOS deprecations corrected with this commit (i.e. Apple inserted the same depraction into the lastest 11.7.3 / Xcode):
> https://github.com/MythTV/mythtv/commit/37875831a06acb651bfb545b3482281a0bb90caa  <https://github.com/MythTV/mythtv/commit/37875831a06acb651bfb545b3482281a0bb90caa>
>
> Here's lldb's output of the crash:
> * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
> * frame #0: 0x0000000105310869 libmythui-33.33.dylib`_findAppleRemoteDevice(char const*) + 57
> frame #1: 0x00000001053106d0 libmythui-33.33.dylib`AppleRemote::startListening() + 48
> frame #2: 0x00000001052dfbf6 libmythui-33.33.dylib`MythInputDeviceHandler::Start() + 326
> frame #3: 0x00000001052dfa84 libmythui-33.33.dylib`MythInputDeviceHandler::MythInputDeviceHandler(MythMainWindow*) + 84
> frame #4: 0x00000001052dfccd libmythui-33.33.dylib`MythInputDeviceHandler::MythInputDeviceHandler(MythMainWindow*) + 29
> frame #5: 0x0000000105177f2a libmythui-33.33.dylib`MythMainWindow::MythMainWindow(bool) + 538
> frame #6: 0x0000000105177b85 libmythui-33.33.dylib`MythMainWindow::MythMainWindow(bool) + 37
> frame #7: 0x0000000105177a99 libmythui-33.33.dylib`MythMainWindow::getMainWindow(bool) + 121
> frame #8: 0x00000001056f5e3b libmyth-33.33.dylib`MythContextPrivate::TempMainWindow(bool) + 171
> frame #9: 0x00000001056fe58e libmyth-33.33.dylib`MythContextPrivate::ShowGuiStartup() + 46
> frame #10: 0x00000001056fb1ff libmyth-33.33.dylib`MythContextPrivate::TestDBconnection(bool) + 5583
> frame #11: 0x00000001056f6c4e libmyth-33.33.dylib`MythContextPrivate::FindDatabase(bool, bool) + 574
> frame #12: 0x00000001056f6500 libmyth-33.33.dylib`MythContextPrivate::Init(bool, bool, bool, bool) + 256
> frame #13: 0x0000000105700d34 libmyth-33.33.dylib`MythContext::Init(bool, bool, bool, bool) + 1652
> frame #14: 0x0000000100010ef6 mythfrontend`main + 3126
> frame #15: 0x00007fff20453f3d libdyld.dylib`start + 1
>
> libmythui-33.33.dylib`_findAppleRemoteDevice:
> -> 0x105310869 <+57>: movl (%rax), %edi
> 0x10531086b <+59>: movq -0x10(%rbp), %rsi
> 0x10531086f <+63>: leaq -0x14(%rbp), %rdx
> 0x105310873 <+67>: callq 0x105349cc2 ; symbol stub for: IOServiceGetMatchingServices
>
> Process 42006 stopped
> * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
> frame #0: 0x0000000105310869 libmythui-33.33.dylib`_findAppleRemoteDevice(char const*) + 57
> libmythui-33.33.dylib`_findAppleRemoteDevice:
> -> 0x105310869 <+57>: movl (%rax), %edi
> 0x10531086b <+59>: movq -0x10(%rbp), %rsi
> 0x10531086f <+63>: leaq -0x14(%rbp), %rdx
> 0x105310873 <+67>: callq 0x105349cc2 ; symbol stub for: IOServiceGetMatchingServices
> Target 0: (mythfrontend) stopped.
>
>
> Thanks in advance for the help!!!!
> John
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org


--
Nigel Pearson, 02 9792 6998, 0408 66 44 35
nigel.pearson.au@gmail.com
Re: macOS build issues - looking for advice / pointers [ In reply to ]
On Mon, Feb 13, 2023 at 3:32 AM Nigel Pearson <nigel.pearson.au@gmail.com>
wrote:

>
> It was ugly code when I wrote it (in 2008!!!).
>
> I think AppleRemote:: has outlived its usefulness.
>
>
> git rm ???
>

So it looks like more functions were affected than just the AppleRemote
logic. Replacing all of the OS 12 defines in commit 3787583
<https://github.com/MythTV/mythtv/commit/37875831a06acb651bfb545b3482281a0bb90caa>

<https://github.com/MythTV/mythtv/commit/37875831a06acb651bfb545b3482281a0bb90caa>as
follows got it sorted on Big Sur.

-#if !defined(MAC_OS_VERSION_12_0)
+#if !defined(MAC_OS_VERSION_12_0) || !defined(MAC_OS_VERSION_11_7)

Any suggestion on a cleaner approach?
Re: macOS build issues - looking for advice / pointers [ In reply to ]
Sorry for the delay.

Haven't built anything on MacOS for years,
but I would create a new constant,
MAC_IO_SERVICE_DEPRECATED,
which is set on OS > 11.7.

If defined,
the .cpp files create the old kBlahPropertyElementblah constants?



> On 17 Feb 2023, at 12:37 pm, John Hoyt <john.hoyt@gmail.com> wrote:
>
> On Mon, Feb 13, 2023 at 3:32 AM Nigel Pearson <nigel.pearson.au@gmail.com <mailto:nigel.pearson.au@gmail.com>> wrote:
>
> It was ugly code when I wrote it (in 2008!!!).
>
> I think AppleRemote:: has outlived its usefulness.
>
>
> git rm ???
>
> So it looks like more functions were affected than just the AppleRemote logic. Replacing all of the OS 12 defines in commit 3787583 <https://github.com/MythTV/mythtv/commit/37875831a06acb651bfb545b3482281a0bb90caa>  <https://github.com/MythTV/mythtv/commit/37875831a06acb651bfb545b3482281a0bb90caa>as follows got it sorted on Big Sur.
> -#if !defined(MAC_OS_VERSION_12_0)
> +#if !defined(MAC_OS_VERSION_12_0) || !defined(MAC_OS_VERSION_11_7)
>
> Any suggestion on a cleaner approach?
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org


--
Nigel Pearson, 02 9792 6998, 0408 66 44 35
nigel.pearson.au@gmail.com
Re: macOS build issues - looking for advice / pointers [ In reply to ]
On Sat, Mar 4, 2023 at 4:52?AM Nigel Pearson <nigel.pearson.au@gmail.com>
wrote:

> Sorry for the delay.
>
> Haven't built anything on MacOS for years,
> but I would create a new constant,
> MAC_IO_SERVICE_DEPRECATED,
> which is set on OS > 11.7.
>
> If defined,
> the .cpp files create the old kBlahPropertyElementblah constants?
>
>
>
> On 17 Feb 2023, at 12:37 pm, John Hoyt <john.hoyt@gmail.com> wrote:
>
> On Mon, Feb 13, 2023 at 3:32 AM Nigel Pearson <nigel.pearson.au@gmail.com>
> wrote:
>
>>
>> It was ugly code when I wrote it (in 2008!!!).
>>
>> I think AppleRemote:: has outlived its usefulness.
>>
>>
>> git rm ???
>>
>
> So it looks like more functions were affected than just the AppleRemote
> logic. Replacing all of the OS 12 defines in commit 3787583
> <https://github.com/MythTV/mythtv/commit/37875831a06acb651bfb545b3482281a0bb90caa>
>
> <https://github.com/MythTV/mythtv/commit/37875831a06acb651bfb545b3482281a0bb90caa>as
> follows got it sorted on Big Sur.
>
> -#if !defined(MAC_OS_VERSION_12_0)
> +#if !defined(MAC_OS_VERSION_12_0) || !defined(MAC_OS_VERSION_11_7)
>
> Any suggestion on a cleaner approach?
>
>
Thanks Nigel!

After looking into the deprecated macros, it turned out they were all being
set to 0 or NULL.. As such, David Hampton suggested creating a new static
constant which was committed here:
https://github.com/MythTV/mythtv/commit/c273ed0f9a2491b7f6ec377be0a0a861f7788849

Neither of us were all too keen to create a new MAC_OS specific variable.