idyntree icon indicating copy to clipboard operation
idyntree copied to clipboard

Visualiser does not work in interpreted languages in macOS

Open francesco-romano opened this issue 9 years ago • 9 comments
trafficstars

e.g. when executing the following code in MATLAB

viz = iDynTree.Visualizer();
viz.init();

this error appears in the terminal (not matlab prompt)

Irrlicht Engine version 1.8.3
2016-08-25 11:39:17.819 MATLAB_maci64[25749:21542325] _createMenuRef called with existing principal MenuRef already associated with menu
2016-08-25 11:39:17.824 MATLAB_maci64[25749:21542325] (
    0   CoreFoundation                      0x00007fff92f7b4f2 __exceptionPreprocess + 178
    1   libobjc.A.dylib                     0x00007fff8b5f8f7e objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff92fe24bd +[NSException raise:format:] + 205
    3   AppKit                              0x00007fff9584cc86 -[NSCarbonMenuImpl _createMenuRef] + 62
    4   AppKit                              0x00007fff9584c5c5 -[NSCarbonMenuImpl _instantiateCarbonMenu] + 140
    5   AppKit                              0x00007fff9584a270 -[NSApplication finishLaunching] + 856
    6   libidyntree-visualization.dylib     0x000000017270cac7 _ZN3irr16CIrrDeviceMacOSXC1ERKNS_27SIrrlichtCreationParametersE + 503
    7   libidyntree-visualization.dylib     0x000000017269fb61 createDeviceEx + 49
    8   libidyntree-visualization.dylib     0x000000017250d3b1 _ZN8iDynTree10Visualizer4initENS_17VisualizerOptionsE + 273
    9   iDynTreeMEX.mexmaci64               0x0000000171de6c1e _Z29_wrap_Visualizer_init__SWIG_1iPP11mxArray_tagiS1_ + 78
    10  iDynTreeMEX.mexmaci64               0x0000000171de6cd0 _Z21_wrap_Visualizer_initiPP11mxArray_tagiS1_ + 80
    11  iDynTreeMEX.mexmaci64               0x0000000171df15b1 mexFunction + 12049
    12  libmex.dylib                        0x0000000111bbfd34 mexRunMexFile + 84
    13  libmex.dylib                        0x0000000111bbc0d1 _ZN7Mfh_mex30runMexFileWithSignalProtectionEiPP11mxArray_tagiS2_ + 113
    14  libmex.dylib                        0x0000000111bbc25b _ZN7Mfh_mex13dispatch_fileEiPP11mxArray_tagiS2_ + 203
    15  libmwm_dispatcher.dylib             0x000000011277c47c _ZN8Mfh_file16dispatch_fh_implEMS_FviPP11mxArray_tagiS2_EiS2_iS2_ + 796
    16  libmwm_dispatcher.dylib             0x000000011277c8f3 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_ + 35
    17  libmwm_lxe.dylib                    0x0000000113ab1afe _ZN9MathWorks3lxe17LxeDispatcherImpl12apply_handleEPNS0_29DispatcherFunctionHandleTokenEmPNS0_6xvalueEmPKS4_ + 910
    18  libmwm_lxe.dylib                    0x0000000113c8270a _ZN9MathWorks3lxe18ApplyNargoutCommonIXadL_ZNS0_17ApplyHandleCommonEPvNS_2ts4TypeEPKNS0_6xvalueES2_S2_mmEEEEvS2_S4_PKvS2_S2_ + 474
    19  libmwm_lxe.dylib                    0x0000000113c00d05 _ZN9MathWorks3lxe38cpp_primitive_template_fn_with_contextIXadL_ZNS0_20apply_handle_nargoutEPvNS_2ts4TypeEPKvS2_S2_EEEEbS2_S4_S6_S2_S2_ + 21
    20  libmwm_lxe.dylib                    0x000000011363b177 _ZN9MathWorks3lxe13IrInterpreter17ApplyCppPrimitiveEPN2ir4termES4_RKNS_2ts4TypeES8_ + 407
    21  libmwm_lxe.dylib                    0x000000011363a36f _ZN9MathWorks3lxe13IrInterpreter31process_application_of_constantEPN2ir4termE + 1999
    22  libmwm_lxe.dylib                    0x0000000113638838 _ZN9MathWorks3lxe13IrInterpreter13applyConstantEPN2ir4termE + 248
    23  libmwm_lxe.dylib                    0x0000000113636d12 _ZN9MathWorks3lxe12IRTreeWalker9applyTermEPN2ir4termE + 98
    24  libmwm_lxe.dylib                    0x00000001136371df _ZN9MathWorks3lxe12IRTreeWalker11getNextIRPCENS0_9irpc_typeE + 559
    25  libmwm_lxe.dylib                    0x0000000113638529 _ZN9MathWorks3lxe13IrInterpreter9tree_walkERKNS0_9irpc_typeES4_ + 185
    26  libmwm_lxe.dylib                    0x00000001136383f6 _ZN9MathWorks3lxe13IrInterpreter9InterpretEv + 86
    27  libmwm_lxe.dylib                    0x0000000113718d13 _ZN9MathWorks3lxe15ExecutionDriver9ThreadRunEv + 3283
    28  libmwm_lxe.dylib                    0x000000011371c5f0 _ZN9MathWorks3lxe12IrEngineImpl5ApplyERKN2ir6IrTreeEPvS6_ + 352
    29  libmwm_lxe.dylib                    0x0000000113994c13 _ZN9MathWorks3lxe17IrEngineDecorator5ApplyERKN2ir6IrTreeEPvS6_ + 211
    30  libmwm_lxe.dylib                    0x0000000113aa7c00 _ZN9MathWorks3lxe27FileBasedMatlabCodeFunction16DispatchFunctionEiPP11mxArray_tagiS4_ + 848
    31  libmwm_dispatcher.dylib             0x000000011277c47c _ZN8Mfh_file16dispatch_fh_implEMS_FviPP11mxArray_tagiS2_EiS2_iS2_ + 796
    32  libmwm_dispatcher.dylib             0x000000011277c8f3 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_ + 35
    33  libmwmcos_impl.dylib                0x0000000119942d32 _ZNK4mcos17MScopedMethodInfo6invokeEPKNS_9COSClientERiPNS_8COSValueEiPKS5_ + 530
    34  libmwmcos_impl.dylib                0x00000001198db37f _ZN24OpaqueMethodCallMetaData11callMMethodEPN4mcos13COSMethodInfoEPP11mxArray_tagPKNS0_9COSClientE + 463
    35  libmwmcos_impl.dylib                0x00000001198de6d9 _ZN24OpaqueMethodCallMetaData23callMethodOrConstructorEP11mxArray_tagbiPS1_iPPKS0_bPKN4mcos9COSClientEPS9_PPNS6_13COSMethodInfoEb + 265
    36  libmwmcos_impl.dylib                0x00000001198df02a _ZN20OpaqueMethodMetaData23callMethodOrConstructorEP11mxArray_tagbiPS1_iPPKS0_bPKN4mcos9COSClientEPS9_PPNS6_13COSMethodInfoEb + 394
    37  libmwmcos_impl.dylib                0x00000001198dc8b8 _Z18mcosCallMethodImplN4mcos9COSNameIDES0_PKNS_9COSClientEiPP11mxArray_tagiPPKS4_bb + 200
    38  libmwmcos_impl.dylib                0x00000001198dd684 _ZN4mcos4impl12omCallMethodENS_9COSNameIDES1_PKNS_9COSClientEiPP11mxArray_tagiPPKS5_b + 84
    39  libmwmcos_impl.dylib                0x000000011996eeb6 _ZN4mcos4impl18omDirectCallMethodERKNS_9COSNameIDES3_S3_iPP11mxArray_tagiPPKS4_ + 134
    40  libmwmcos_impl.dylib                0x00000001199940ba _ZN4mcos22COSGenericDynamicPropIC2ENS_9COSStringENS_9COSNameIDES2_ + 4842
    41  libmwmcos.dylib                     0x0000000110bf62ca _Z18omDirectCallMethodRKN4mcos9COSNameIDES2_S2_iPP11mxArray_tagiPPKS3_ + 58
    42  libmwm_lxe.dylib                    0x0000000113b448c0 _ZN9MathWorks3lxe16MCOSFieldManager10CallMethodEiiPPK11mxArray_tag + 144
    43  libmwm_lxe.dylib                    0x0000000113b5e15e _ZNK9MathWorks3lxe21MCOSMethodParenRplace9GetFirstNEm + 478
    44  libmwm_lxe.dylib                    0x0000000113b4e713 _ZNK9MathWorks3lxe28MxArrayOwningRplaceDecorator9GetFirstNEm + 19
    45  libmwm_lxe.dylib                    0x0000000113b4e713 _ZNK9MathWorks3lxe28MxArrayOwningRplaceDecorator9GetFirstNEm + 19
    46  libmwm_lxe.dylib                    0x0000000113b73643 _ZNK9MathWorks3lxe18RplaceToMultiplace9GetFirstNEm + 19
    47  libmwm_lxe.dylib                    0x0000000113b83ccf _ZN9MathWorks3lxe17at_rparen_nargoutEPvNS_2ts4TypeEPKvS1_S1_ + 511
    48  libmwm_lxe.dylib                    0x0000000113bfce05 _ZN9MathWorks3lxe38cpp_primitive_template_fn_with_contextIXadL_ZNS0_17at_rparen_nargoutEPvNS_2ts4TypeEPKvS2_S2_EEEEbS2_S4_S6_S2_S2_ + 21
    49  libmwm_lxe.dylib                    0x000000011363b177 _ZN9MathWorks3lxe13IrInterpreter17ApplyCppPrimitiveEPN2ir4termES4_RKNS_2ts4TypeES8_ + 407
    50  libmwm_lxe.dylib                    0x000000011363a36f _ZN9MathWorks3lxe13IrInterpreter31process_application_of_constantEPN2ir4termE + 1999
    51  libmwm_lxe.dylib                    0x0000000113638838 _ZN9MathWorks3lxe13IrInterpreter13applyConstantEPN2ir4termE + 248
    52  libmwm_lxe.dylib                    0x0000000113636d12 _ZN9MathWorks3lxe12IRTreeWalker9applyTermEPN2ir4termE + 98
    53  libmwm_lxe.dylib                    0x00000001136371df _ZN9MathWorks3lxe12IRTreeWalker11getNextIRPCENS0_9irpc_typeE + 559
    54  libmwm_lxe.dylib                    0x0000000113638529 _ZN9MathWorks3lxe13IrInterpreter9tree_walkERKNS0_9irpc_typeES4_ + 185
    55  libmwm_lxe.dylib                    0x00000001136383f6 _ZN9MathWorks3lxe13IrInterpreter9InterpretEv + 86
    56  libmwm_lxe.dylib                    0x0000000113718d13 _ZN9MathWorks3lxe15ExecutionDriver9ThreadRunEv + 3283
    57  libmwm_lxe.dylib                    0x000000011371c5f0 _ZN9MathWorks3lxe12IrEngineImpl5ApplyERKN2ir6IrTreeEPvS6_ + 352
    58  libmwm_lxe.dylib                    0x0000000113994c13 _ZN9MathWorks3lxe17IrEngineDecorator5ApplyERKN2ir6IrTreeEPvS6_ + 211
    59  libmwm_lxe.dylib                    0x00000001139556ef _ZN9MathWorks3lxe9Evaluator15ApplyStatementsERKN2ir6IrTreeERNS0_18IEvaluationContextE + 447
    60  libmwm_lxe.dylib                    0x0000000113957617 _ZN9MathWorks3lxe9Evaluator17EvalStatementImplEPKcRNS0_18IEvaluationContextE + 167
    61  libmwm_lxe.dylib                    0x00000001139576e8 _ZN9MathWorks3lxe9Evaluator13EvalStatementERKNSt3__112basic_stringIDsNS2_11char_traitsIDsEENS2_9allocatorIDsEEEERNS0_18IEvaluationContextE + 136
    62  libmwm_lxe.dylib                    0x000000011394a405 _ZN9MathWorks3lxe20BuiltinSubsFunctions11SubsrefImplEiRK11mxArray_tagS4_PKNS0_29DispatcherFunctionHandleTokenE + 229
    63  libmwm_lxe.dylib                    0x000000011394a691 _ZN9MathWorks3lxe20BuiltinSubsFunctions7SubsrefEiPP11mxArray_tagiPKPKS2_ + 145
    64  libmwm_dispatcher.dylib             0x0000000112737966 _Z14new_fh_builtinPFviPP11mxArray_tagiS1_EPKcP11MdispatcherP13Mlm_MATLAB_fniiiiibbbi + 1318
    65  libmwm_dispatcher.dylib             0x000000011271e854 _ZN13Mfh_MATLAB_fn11dispatch_fhEiPP11mxArray_tagiS2_ + 500
    66  libmwmcos_impl.dylib                0x00000001199f0d2c _ZN19Mobject_system_impl11callBuiltinEPKciPP11mxArray_tagiS4_ + 540
    67  libmwm_dispatcher.dylib             0x000000011276c89e _Z21mdBuiltinAsBuiltinFcniPP11mxArray_tagiS1_ + 302
    68  libmwm_dispatcher.dylib             0x0000000112737966 _Z14new_fh_builtinPFviPP11mxArray_tagiS1_EPKcP11MdispatcherP13Mlm_MATLAB_fniiiiibbbi + 1318
    69  libmwm_dispatcher.dylib             0x000000011271e854 _ZN13Mfh_MATLAB_fn11dispatch_fhEiPP11mxArray_tagiS2_ + 500
    70  libmwm_lxe.dylib                    0x0000000113ab1afe _ZN9MathWorks3lxe17LxeDispatcherImpl12apply_handleEPNS0_29DispatcherFunctionHandleTokenEmPNS0_6xvalueEmPKS4_ + 910
    71  libmwm_lxe.dylib                    0x0000000113c8270a _ZN9MathWorks3lxe18ApplyNargoutCommonIXadL_ZNS0_17ApplyHandleCommonEPvNS_2ts4TypeEPKNS0_6xvalueES2_S2_mmEEEEvS2_S4_PKvS2_S2_ + 474
    72  libmwm_lxe.dylib                    0x0000000113c00d05 _ZN9MathWorks3lxe38cpp_primitive_template_fn_with_contextIXadL_ZNS0_20apply_handle_nargoutEPvNS_2ts4TypeEPKvS2_S2_EEEEbS2_S4_S6_S2_S2_ + 21
    73  libmwm_lxe.dylib                    0x000000011363b177 _ZN9MathWorks3lxe13IrInterpreter17ApplyCppPrimitiveEPN2ir4termES4_RKNS_2ts4TypeES8_ + 407
    74  libmwm_lxe.dylib                    0x000000011363a36f _ZN9MathWorks3lxe13IrInterpreter31process_application_of_constantEPN2ir4termE + 1999
    75  libmwm_lxe.dylib                    0x0000000113638838 _ZN9MathWorks3lxe13IrInterpreter13applyConstantEPN2ir4termE + 248
    76  libmwm_lxe.dylib                    0x0000000113636d12 _ZN9MathWorks3lxe12IRTreeWalker9applyTermEPN2ir4termE + 98
    77  libmwm_lxe.dylib                    0x00000001136371df _ZN9MathWorks3lxe12IRTreeWalker11getNextIRPCENS0_9irpc_typeE + 559
    78  libmwm_lxe.dylib                    0x0000000113638529 _ZN9MathWorks3lxe13IrInterpreter9tree_walkERKNS0_9irpc_typeES4_ + 185
    79  libmwm_lxe.dylib                    0x00000001136383f6 _ZN9MathWorks3lxe13IrInterpreter9InterpretEv + 86
    80  libmwm_lxe.dylib                    0x0000000113718d13 _ZN9MathWorks3lxe15ExecutionDriver9ThreadRunEv + 3283
    81  libmwm_lxe.dylib                    0x000000011371c5f0 _ZN9MathWorks3lxe12IrEngineImpl5ApplyERKN2ir6IrTreeEPvS6_ + 352
    82  libmwm_lxe.dylib                    0x0000000113994c13 _ZN9MathWorks3lxe17IrEngineDecorator5ApplyERKN2ir6IrTreeEPvS6_ + 211
    83  libmwm_lxe.dylib                    0x0000000113aa7c00 _ZN9MathWorks3lxe27FileBasedMatlabCodeFunction16DispatchFunctionEiPP11mxArray_tagiS4_ + 848
    84  libmwm_dispatcher.dylib             0x000000011277c47c _ZN8Mfh_file16dispatch_fh_implEMS_FviPP11mxArray_tagiS2_EiS2_iS2_ + 796
    85  libmwm_dispatcher.dylib             0x000000011277c8f3 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_ + 35
    86  libmwmcos_impl.dylib                0x0000000119942d32 _ZNK4mcos17MScopedMethodInfo6invokeEPKNS_9COSClientERiPNS_8COSValueEiPKS5_ + 530
    87  libmwmcos_impl.dylib                0x00000001198db37f _ZN24OpaqueMethodCallMetaData11callMMethodEPN4mcos13COSMethodInfoEPP11mxArray_tagPKNS0_9COSClientE + 463
    88  libmwmcos_impl.dylib                0x00000001198de6d9 _ZN24OpaqueMethodCallMetaData23callMethodOrConstructorEP11mxArray_tagbiPS1_iPPKS0_bPKN4mcos9COSClientEPS9_PPNS6_13COSMethodInfoEb + 265
    89  libmwmcos_impl.dylib                0x00000001198df02a _ZN20OpaqueMethodMetaData23callMethodOrConstructorEP11mxArray_tagbiPS1_iPPKS0_bPKN4mcos9COSClientEPS9_PPNS6_13COSMethodInfoEb + 394
    90  libmwmcos_impl.dylib                0x00000001198dd920 _Z22omCallMethodWithClientP11mxArray_tagbS0_iPS0_iPPKS_PKN4mcos9COSClientEPS8_PPNS5_13COSMethodInfoE + 352
    91  libmwmcos_impl.dylib                0x0000000119a00e68 _ZN25Mfh_MCOS_dynamic_all_args11dispatch_mfEiPP11mxArray_tagiS2_ + 440
    92  libmwm_dispatcher.dylib             0x000000011271e854 _ZN13Mfh_MATLAB_fn11dispatch_fhEiPP11mxArray_tagiS2_ + 500
    93  libmwmcos_impl.dylib                0x00000001199ff77c _ZN10Mfh_opaque11dispatch_fhEiPP11mxArray_tagiS2_ + 28
    94  libmwm_lxe.dylib                    0x0000000113b5b0ae _ZNK9MathWorks3lxe22OverloadedObjectRplace9GetFirstNEm + 190
    95  libmwm_lxe.dylib                    0x0000000113b4e713 _ZNK9MathWorks3lxe28MxArrayOwningRplaceDecorator9GetFirstNEm + 19
    96  libmwm_lxe.dylib                    0x0000000113b70c70 _ZN9MathWorks3lxe36DereferenceRplaceToXvalueZeroOutputsERKNS_3utl10attach_ptrIKNS0_7IRplaceEEE + 32
    97  libmwm_lxe.dylib                    0x0000000113b837b4 _ZN9MathWorks3lxe10at_rparen0EPvNS_2ts4TypeEPKvS1_S1_ + 372
    98  libmwm_lxe.dylib                    0x0000000113bfd345 _ZN9MathWorks3lxe38cpp_primitive_template_fn_with_contextIXadL_ZNS0_10at_rparen0EPvNS_2ts4TypeEPKvS2_S2_EEEEbS2_S4_S6_S2_S2_ + 21
    99  libmwm_lxe.dylib                    0x000000011363b177 _ZN9MathWorks3lxe13IrInterpreter17ApplyCppPrimitiveEPN2ir4termES4_RKNS_2ts4TypeES8_ + 407
    100 libmwm_lxe.dylib                    0x000000011363a36f _ZN9MathWorks3lxe13IrInterpreter31process_application_of_constantEPN2ir4termE + 1999
    101 libmwm_lxe.dylib                    0x0000000113638838 _ZN9MathWorks3lxe13IrInterpreter13applyConstantEPN2ir4termE + 248
    102 libmwm_lxe.dylib                    0x0000000113636d12 _ZN9MathWorks3lxe12IRTreeWalker9applyTermEPN2ir4termE + 98
    103 libmwm_lxe.dylib                    0x00000001136371df _ZN9MathWorks3lxe12IRTreeWalker11getNextIRPCENS0_9irpc_typeE + 559
    104 libmwm_lxe.dylib                    0x0000000113638529 _ZN9MathWorks3lxe13IrInterpreter9tree_walkERKNS0_9irpc_typeES4_ + 185
    105 libmwm_lxe.dylib                    0x00000001136383f6 _ZN9MathWorks3lxe13IrInterpreter9InterpretEv + 86
    106 libmwm_lxe.dylib                    0x0000000113718d13 _ZN9MathWorks3lxe15ExecutionDriver9ThreadRunEv + 3283
    107 libmwm_lxe.dylib                    0x000000011371c5f0 _ZN9MathWorks3lxe12IrEngineImpl5ApplyERKN2ir6IrTreeEPvS6_ + 352
    108 libmwm_lxe.dylib                    0x0000000113994c13 _ZN9MathWorks3lxe17IrEngineDecorator5ApplyERKN2ir6IrTreeEPvS6_ + 211
    109 libmwm_lxe.dylib                    0x0000000113aa82d6 _ZN9MathWorks3lxe27FileBasedMatlabCodeFunction14DispatchScriptEiPP11mxArray_tagiS4_ + 422
    110 libmwm_dispatcher.dylib             0x000000011277c4c9 _ZN8Mfh_file16dispatch_fh_implEMS_FviPP11mxArray_tagiS2_EiS2_iS2_ + 873
    111 libmwm_dispatcher.dylib             0x000000011277c8f3 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_ + 35
    112 libmwm_lxe.dylib                    0x0000000113ab1afe _ZN9MathWorks3lxe17LxeDispatcherImpl12apply_handleEPNS0_29DispatcherFunctionHandleTokenEmPNS0_6xvalueEmPKS4_ + 910
    113 libmwm_lxe.dylib                    0x0000000113bd4ac5 _ZN9MathWorks3lxe38cpp_primitive_template_fn_with_contextIXadL_ZNS0_16ans_apply_handleEPvNS_2ts4TypeEPKvS2_S2_EEEEbS2_S4_S6_S2_S2_ + 21
    114 libmwm_lxe.dylib                    0x000000011363b177 _ZN9MathWorks3lxe13IrInterpreter17ApplyCppPrimitiveEPN2ir4termES4_RKNS_2ts4TypeES8_ + 407
    115 libmwm_lxe.dylib                    0x000000011363a36f _ZN9MathWorks3lxe13IrInterpreter31process_application_of_constantEPN2ir4termE + 1999
    116 libmwm_lxe.dylib                    0x0000000113638838 _ZN9MathWorks3lxe13IrInterpreter13applyConstantEPN2ir4termE + 248
    117 libmwm_lxe.dylib                    0x0000000113636d12 _ZN9MathWorks3lxe12IRTreeWalker9applyTermEPN2ir4termE + 98
    118 libmwm_lxe.dylib                    0x00000001136371df _ZN9MathWorks3lxe12IRTreeWalker11getNextIRPCENS0_9irpc_typeE + 559
    119 libmwm_lxe.dylib                    0x0000000113638529 _ZN9MathWorks3lxe13IrInterpreter9tree_walkERKNS0_9irpc_typeES4_ + 185
    120 libmwm_lxe.dylib                    0x00000001136383f6 _ZN9MathWorks3lxe13IrInterpreter9InterpretEv + 86
    121 libmwm_lxe.dylib                    0x0000000113718d13 _ZN9MathWorks3lxe15ExecutionDriver9ThreadRunEv + 3283
    122 libmwm_lxe.dylib                    0x000000011371c5f0 _ZN9MathWorks3lxe12IrEngineImpl5ApplyERKN2ir6IrTreeEPvS6_ + 352
    123 libmwm_lxe.dylib                    0x0000000113994c13 _ZN9MathWorks3lxe17IrEngineDecorator5ApplyERKN2ir6IrTreeEPvS6_ + 211
    124 libmwm_lxe.dylib                    0x00000001139556ef _ZN9MathWorks3lxe9Evaluator15ApplyStatementsERKN2ir6IrTreeERNS0_18IEvaluationContextE + 447
    125 libmwm_lxe.dylib                    0x0000000113957617 _ZN9MathWorks3lxe9Evaluator17EvalStatementImplEPKcRNS0_18IEvaluationContextE + 167
    126 libmwm_lxe.dylib                    0x00000001139576e8 _ZN9MathWorks3lxe9Evaluator13EvalStatementERKNSt3__112basic_stringIDsNS2_11char_traitsIDsEENS2_9allocatorIDsEEEERNS0_18IEvaluationContextE + 136
    127 libmwm_lxe.dylib                    0x00000001139dd7dc _ZN9MathWorks3lxe9LxeBridge7EvalCmdERKNSt3__112basic_stringIDsNS2_11char_traitsIDsEENS2_9allocatorIDsEEEEb + 396
    128 libmwm_lxe.dylib                    0x00000001139dd687 _ZN9MathWorks3lxe9LxeBridge7EvalCmdERKNSt3__112basic_stringIDsNS2_11char_traitsIDsEENS2_9allocatorIDsEEEEb + 55
    129 libmwbridge.dylib                   0x00000001133e7bad _Z28evalCommandWithLongjmpSafetyRKNSt3__112basic_stringIDsNS_11char_traitsIDsEENS_9allocatorIDsEEEE + 93
    130 libmwbridge.dylib                   0x00000001133e8305 _Z8mnParserv + 1173
    131 libmwmcr.dylib                      0x0000000112635391 _ZN3mcr7runtime17InterpreterThread4Impl30mnParser_on_interpreter_threadEP11mcrInstance + 33
    132 libmwmcr.dylib                      0x0000000112637ec1 _ZN3mcr7runtime17InterpreterThread4Impl22TypedInvocationRequestIvE29doNotRethrowMxArrayExceptionsERKN5boost8functionIFvvEEE + 33
    133 libmwmcr.dylib                      0x0000000112638e6e _ZN5boost6detail12shared_countC2INS0_17task_shared_stateINS_3_bi6bind_tIvPFvRKNS_8functionIFvvEEEENS4_5list1INS4_5valueIS8_EEEEEEvEEEEPT_ + 734
    134 libmwmcr.dylib                      0x000000011263852b _ZN5boost6detail22task_base_shared_stateIvE3runEv + 59
    135 libmwmcr.dylib                      0x0000000112638458 _ZN5boost13packaged_taskIvEclEv + 24
    136 libmwmcr.dylib                      0x0000000112635873 _ZN3mcr7runtime17InterpreterThread4Impl26invocation_request_handlerEl + 35
    137 libmwiqm.dylib                      0x000000011250f390 _ZN3iqm23registerIqmPpeConditionEv + 3232
    138 libmwiqm.dylib                      0x00000001124f912e _ZN5boost6detail8function21function_obj_invoker0INSt3__18functionIFNS_3anyEvEEES5_E6invokeERNS1_15function_bufferE + 30
    139 libmwiqm.dylib                      0x00000001124f8692 _ZN3iqm18PackagedTaskPlugin7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE + 258
    140 libmwmcr.dylib                      0x000000011264b10f _ZN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEC2IS2_NS_6detail14sp_inplace_tagINS5_13sp_ms_deleterIS2_EEEEEEPT_T0_ + 1471
    141 libmwiqm.dylib                      0x00000001124d698b _ZNK3iqm17DefaultPacketInfo7executeEP15inWorkSpace_tag + 299
    142 libmwiqm.dylib                      0x00000001124b836a _ZN3iqm10DefaultIqm7dequeueEN6mlutil14cmddistributor13WhenToDequeue13WhenToDequeueEN5boost8optionalINSt3__18functionIFvRKNS5_10shared_ptrINS_22IntermediatePacketInfoEEEEEEEENS6_ImEE + 2170
    143 libmwiqm.dylib                      0x00000001124c0e0b _ZN3iqm10DefaultIqm26isIqmUserEventsModeEnabledEv + 5099
    144 libmwservices.dylib                 0x000000010d34a277 _Z40svWS_ProcessPendingEventsWithLimitedRateb + 18487
    145 libmwservices.dylib                 0x000000010d3451ff _Z25svWS_ProcessPendingEventsiib + 863
    146 libmwservices.dylib                 0x000000010d344efb _Z25svWS_ProcessPendingEventsiib + 91
    147 libmwmcr.dylib                      0x0000000112635b3f _ZN3mcr7runtime17InterpreterThread4Impl14process_eventsERKN5boost10shared_ptrIS2_EE + 191
    148 libmwmcr.dylib                      0x0000000112636086 _ZN3mcr7runtime17InterpreterThread4Impl3runERKN5boost10shared_ptrIS2_EEPNS2_12init_contextE + 358
    149 libmwmcr.dylib                      0x0000000112618ba6 _Z26run_init_and_handle_eventsPv + 54
    150 libsystem_pthread.dylib             0x00007fff8938899d _pthread_body + 131
    151 libsystem_pthread.dylib             0x00007fff8938891a _pthread_body + 0
    152 libsystem_pthread.dylib             0x00007fff89386351 thread_start + 13
)

This seems related to how irrlitch manages the menubar in macOS. Furthermore it seems they still use the Carbo lib, deprecated some ages ago.

Related references: http://irrlicht.sourceforge.net/forum/viewtopic.php?p=180371#p180371 https://github.com/zaki/irrlicht/blob/2b18a9ae1926ef9ee473ccaafd51398fd417abb9/source/Irrlicht/Irrlicht.cpp

francesco-romano avatar Aug 25 '16 09:08 francesco-romano

Summarising what we found out.

The problem is that if no window handles are specified, Irrlitch will create a new window and a menubar. This seems quite strange and I don't know if it is a feature or a bug. A part from trying to contribute upstream with a patch (if it is considered a bug), the alternative is to create a window beforehand and pass an handle to the createDeviceEx function. How to do it is still a question 😆

francesco-romano avatar Aug 29 '16 15:08 francesco-romano

Probably we are misusing it. I tried to create a simple Cocoa App, and even with my "stupid" modification, it crashes everytime. I think we have to find a way to specify the window reference.

And to answer @traversaro questions: windowId in macos:

if (Window)
    [(NSOpenGLContext*)ContextManager->getContext().OpenGLOSX.Context setView:[Window contentView]];
 else
    [(NSOpenGLContext*)ContextManager->getContext().OpenGLOSX.Context setView:(NSView*)CreationParams.WindowId];

and

void CIrrDeviceMacOSX::setWindow(NSWindow* window)
{
    Window = window;
}

francesco-romano avatar Aug 29 '16 16:08 francesco-romano

Shouldn't Irrlicht creating the window be fine? Why is there already a menubar existing? In any case, it is possible to pass a window id to irr::createDeviceEx(irrDevParams) by setting irrDevParams.WindowId. This seems to mean that a few other things have to be done manually. Opening the window in fullscreen works ok.

http://irrlicht.sourceforge.net/docu/structirr_1_1_s_irrlicht_creation_parameters.html#af287810d910a23f8f7db98cef87b6eae

kjyv avatar Sep 16 '16 16:09 kjyv

Hi @kjyv I completely missed your answer. As soon as I have some time I'll give a try again to the library.

francesco-romano avatar Nov 03 '16 09:11 francesco-romano

Recap: if I understood correctly, this is an inherit limitations of macOS and Cocoa-based OSs, in the sense that windows can only be created by the main thread, and not by non-main threads, see also the following comments:

  • https://stackoverflow.com/a/9762043
  • https://github.com/PointCloudLibrary/pcl/issues/253#issuecomment-29716100 .

traversaro avatar Feb 29 '20 14:02 traversaro

As I think back to this problem, I think the only workaround for this is probably to also provide a network/IPC/RPC wrapper of some kind for all the visualizer API, and in macOS when the visualizer is created spawn a new process (and connect to it) instead of directly create the Window from the non-main thread.

traversaro avatar Feb 29 '20 14:02 traversaro

cc @nunoguedelha

traversaro avatar May 17 '21 12:05 traversaro

This problem today affected @DanielePucci .

traversaro avatar Sep 12 '22 14:09 traversaro

Related https://github.com/deepmind/mujoco/issues/742 .

traversaro avatar Feb 20 '23 22:02 traversaro