Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h.ql_clipboard_shruggie causes Mac OS/X to crash on startup #1439

Open
cfxegbert opened this issue May 3, 2024 · 9 comments
Open

h.ql_clipboard_shruggie causes Mac OS/X to crash on startup #1439

cfxegbert opened this issue May 3, 2024 · 9 comments
Assignees

Comments

@cfxegbert
Copy link

cfxegbert commented May 3, 2024

Removing this block allows the plugin to load. https://github.com/qLab/qLib/blame/4f38e98ee9e65322f2a841868facd66511a622d5/MainMenuCommon.xml#L118-L126
My guess is there is a different XML parser on the Mac and it is decoding the UTF-8 before it is passed to decode() python function. Is this item necessary?

github will not let me fork the project right now saying the storage is down. I have cleaned up the XML (prettyfied it). Would you like me to submit a pull request?

2024-05-03 10:31:44.481 houdini[17543:14678721] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithUTF8String:]: NULL cString'
*** First throw call stack:
(
	0   CoreFoundation                      0x0000000191d5f0e4 __exceptionPreprocess + 176
	1   libobjc.A.dylib                     0x000000019187dfd0 objc_exception_throw + 60
	2   Foundation                          0x0000000192c2dc08 NSEqualSizes + 0
	3   libHoudiniUI.dylib                  0x0000000105c2abf0 _ZN10SI_OSXMenu12generateMenuEP11si_MenuItemS1_P6NSMenuRK24si_MenuGenerationContextP20SI_XMLMenuItemFilteri + 608
	4   libHoudiniUI.dylib                  0x0000000105c2b160 _ZN10SI_OSXMenu12generateMenuEP11si_MenuItemS1_P6NSMenuRK24si_MenuGenerationContextP20SI_XMLMenuItemFilteri + 2000
	5   libHoudiniUI.dylib                  0x0000000105c2b160 _ZN10SI_OSXMenu12generateMenuEP11si_MenuItemS1_P6NSMenuRK24si_MenuGenerationContextP20SI_XMLMenuItemFilteri + 2000
	6   libHoudiniUI.dylib                  0x0000000105c2b160 _ZN10SI_OSXMenu12generateMenuEP11si_MenuItemS1_P6NSMenuRK24si_MenuGenerationContextP20SI_XMLMenuItemFilteri + 2000
	7   libHoudiniUI.dylib                  0x0000000105bd0810 _ZN12si_ParseData15generateMenuBarERK24si_MenuGenerationContext + 216
	8   libHoudiniUI.dylib                  0x0000000105bddd14 _ZN10SI_XMLMenu25parseAndGenerateMenuBarUIER12AP_InterfacePKcS3_S3_bP20SI_XMLMenuItemFilterb + 376
	9   libHoudiniAPPS2.dylib               0x0000000107d87474 _ZN8OPUI_App16buildMainMenuBarEPKcS1_ + 104
	10  libHoudiniAPPS3.dylib               0x0000000106fedad4 _ZN8FUSE_App15initApplicationEP10UI_ManageriPPKc + 10836
	11  libHoudiniAPPS2.dylib               0x0000000107f4b128 _ZN12OPUI_MainApp15initApplicationEP10UI_ManageriPPKc + 1364
	12  libHoudiniUI.dylib                  0x0000000105bf3384 main + 6676
	13  dyld                                0x00000001918aff28 start + 2236
)
libc++abi: terminating due to uncaught exception of type NSException
@johnnyquest
Copy link
Contributor

johnnyquest commented May 4, 2024

hi @cfxegbert could you just paste the updated code snippet here? :) but you could do a pull request as well if you like, whatever is easier. thanks for spotting this, I personally don't have OSX (and don't do much testing on windows either :))

On second thought, please paste the code here, so I could test on linux right away without trying to pull from any repo, etc. I'll also try to test it on windows! :D

@johnnyquest johnnyquest self-assigned this May 4, 2024
@cfxegbert
Copy link
Author

cfxegbert commented May 7, 2024

It seems no matter what the expression I use in houdini crashes on the Mac.

<labelExpression>'Shruggie'</labelExpression>

will crash Houdini 20

<label>Shruggie</label>

works fine.

I even tried

                                <labelExpression><![CDATA[
return 'Shruggie']]>
                                </labelExpression>

and it failed.

Maybe open an issue with SideFX on this one.

@cfxegbert
Copy link
Author

cfxegbert commented May 7, 2024

After more experiments it seems labelExpressions do not work in the MainMenuCommon.xml. The main menu on the Mac is the Apple menu bar and the rest of the menus are drawn by Houdini. I will come up with a simple example and send to SideFX. For the time being could the Shruggie be removed or changed to a plain text label.

Edit: Bug submitted to SideFX.

<?xml version="1.0" encoding="UTF-8"?>
<mainMenu>
    <menuBar>
        <subMenu id="testing_menu">
            <insertBefore>help_menu</insertBefore>
            <label>Testing</label>
            <subMenu id="testing_submenu">
                <label>Test Submenu</label>
                <scriptItem id="h.test_label">
                    <label>Plain label</label>
                    <scriptCode>
                        <![CDATA[
hou.ui.displayMessage("Plain label")]]>
                    </scriptCode>
                </scriptItem>
                <scriptItem id="h.test_label_expression">
                    <labelExpression>'Expression label'</labelExpression>
                    <scriptCode>
                        <![CDATA[
hou.ui.displayMessage("Expression label")]]>
                    </scriptCode>
                </scriptItem>
                <separatorItem />
            </subMenu>
        </subMenu>
    </menuBar>
</mainMenu>

@cfxegbert
Copy link
Author

The bug has been fixed on the 20.0.708 release. You should just stick with an ASCII label because the fix will not be available on older versions

@johnnyquest
Copy link
Contributor

see also Aeoll/Aelib#22

johnnyquest added a commit to johnnyquest/qLib-johannes that referenced this issue Jun 22, 2024
johnnyquest added a commit to johnnyquest/qLib-johannes that referenced this issue Jun 22, 2024
@johnnyquest
Copy link
Contributor

@cfxegbert better later than never I guess, just rolled out 0.2.250, replaced shruggie menu item with something more ascii (?) friendly. Could you please test it and tell me if that's working? Thanks, much appreciated

@johnnyquest
Copy link
Contributor

@cfxegbert did you have an opportunity to test this yet?

@cfxegbert
Copy link
Author

Just tested. The current one in 0.2.255 does not work in houdini-19.5.x. Please change to an ASCII representation and do not use any code in a top level menu item.

@johnnyquest
Copy link
Contributor

johnnyquest commented Sep 19, 2024

Just tested. The current one in 0.2.255 does not work in houdini-19.5.x. Please change to an ASCII representation and do not use any code in a top level menu item.

@cfxegbert could you please specify what exactly is needed to be changed to an ASCII representation? I might be misunderstanding something, but I was under the impression that it's the menu item label, and I already replaced that with ASCII characters (or maybe not ASCII by strict definition but there's no "exotic" characters in there).

Is it the single quote character causing issues? (sorry I don't have direct access to a Mac)

(update: managed to ask someone on a Mac to test this and it was working for him -- could you please double check that you update to the latest version?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants