MATLAB Answers

How to get S-function source code line number from crash dump stack trace?

7 views (last 30 days)
Damjan Miklic
Damjan Miklic on 29 Aug 2018
I have a Simulink S-function written in C++, which occasionally crashes Matlab. The S-function is compiled with debug flags and Matlab generates a crash dump file with the following Stack Trace:
Stack Trace (from fault):
[ 0] 0x00007f6f117aa1e9 /home/damjan/devel/system/agv_path_following/matlab/mpc_tricycle_sfun.mexa64+00053737
[ 1] 0x00007f6f117a125b /home/damjan/devel/system/agv_path_following/matlab/mpc_tricycle_sfun.mexa64+00016987
[ 2] 0x00007f6f81fbd5a0 bin/glnxa64/libmwsimulink.so+26867104
[ 3] 0x00007f6f81f788d2 bin/glnxa64/libmwsimulink.so+26585298
[ 4] 0x00007f6f81d4fb82 bin/glnxa64/libmwsimulink.so+24320898
[ 5] 0x00007f6f815331f0 bin/glnxa64/libmwsimulink.so+15815152
[ 6] 0x00007f6f8153359d bin/glnxa64/libmwsimulink.so+15816093
[ 7] 0x00007f6f814ec4c6 bin/glnxa64/libmwsimulink.so+15525062
[ 8] 0x00007f6f816251e1 bin/glnxa64/libmwsimulink.so+16806369
[ 9] 0x00007f6f8164af4e bin/glnxa64/libmwsimulink.so+16961358
[ 10] 0x00007f6f82004044 bin/glnxa64/libmwsimulink.so+27156548
[ 11] 0x00007f6f82006f08 bin/glnxa64/libmwsimulink.so+27168520
[ 12] 0x00007f6f8200bd44 bin/glnxa64/libmwsimulink.so+27188548
[ 13] 0x00007f6f8205be63 bin/glnxa64/libmwsimulink.so+27516515
[ 14] 0x00007f6f80ee70f6 bin/glnxa64/libmwsimulink.so+09212150
[ 15] 0x00007f6f81a15a48 bin/glnxa64/libmwsimulink.so+20937288 _ZN6SLGlue28simulationStartPauseContinueEP11UDInterface+00000312
[ 16] 0x00007f6f367c34ea bin/glnxa64/libmwsl_mi.so+00705770
[ 17] 0x00007f70ecb6dedf bin/glnxa64/libmwmcos_impl.so+02301663
[ 18] 0x00007f70ecb6f9be bin/glnxa64/libmwmcos_impl.so+02308542
[ 19] 0x00007f70ecb76137 bin/glnxa64/libmwmcos_impl.so+02335031
[ 20] 0x00007f70ecb6b8b2 bin/glnxa64/libmwmcos_impl.so+02291890
[ 21] 0x00007f70ecbfb617 bin/glnxa64/libmwmcos_impl.so+02881047
[ 22] 0x00007f70ecc997c3 bin/glnxa64/libmwmcos_impl.so+03528643
[ 23] 0x00007f70fc086628 bin/glnxa64/libmwm_dispatcher.so+00341544 _ZN13Mfh_MATLAB_fn11dispatch_fhEiPP11mxArray_tagiS2_+00000616
[ 24] 0x00007f70ecc998c8 bin/glnxa64/libmwmcos_impl.so+03528904
[ 25] 0x00007f70f8503e44 bin/glnxa64/libmwm_lxe.so+12688964
[ 26] 0x00007f70f8503ede bin/glnxa64/libmwm_lxe.so+12689118
[ 27] 0x00007f70f850b397 bin/glnxa64/libmwm_lxe.so+12718999
[ 28] 0x00007f70fb61a950 bin/glnxa64/libmwm_interpreter.so+02484560 inFullFevalFcn+00000432
[ 29] 0x00007f70fc09fede bin/glnxa64/libmwm_dispatcher.so+00446174
[ 30] 0x00007f70fc086628 bin/glnxa64/libmwm_dispatcher.so+00341544 _ZN13Mfh_MATLAB_fn11dispatch_fhEiPP11mxArray_tagiS2_+00000616
[ 31] 0x00007f70f8503e44 bin/glnxa64/libmwm_lxe.so+12688964
[ 32] 0x00007f70f8503ede bin/glnxa64/libmwm_lxe.so+12689118
[ 33] 0x00007f70f82dbcb6 bin/glnxa64/libmwm_lxe.so+10427574
[ 34] 0x00007f70f83582f1 bin/glnxa64/libmwm_lxe.so+10937073
[ 35] 0x00007f70f8358f37 bin/glnxa64/libmwm_lxe.so+10940215
[ 36] 0x00007f70fb604b8e bin/glnxa64/libmwm_interpreter.so+02395022 inCallFcnWithTrap+00000078
[ 37] 0x00007f6f9ed4382c bin/glnxa64/libmwdastudio.so+04261932 _Z14SafeCallMatlabiPP11mxArray_tagiS1_PKcN10DigManager13ShowErrorFlagE+00000284
[ 38] 0x00007f6f9ed3c561 bin/glnxa64/libmwdastudio.so+04232545 _ZN12ActionSchema14invokeCallbackEP11mxArray_tag+00000177
[ 39] 0x00007f6f9ed41e21 bin/glnxa64/libmwdastudio.so+04255265 _ZN18DigCallbackInvoker9invokeUDIEP11UDInterface+00000385
[ 40] 0x00007f6f9ed421b6 bin/glnxa64/libmwdastudio.so+04256182 _ZN25DigDefaultCallbackInvoker6invokeEv+00000054
[ 41] 0x00007f6f9edabc10 bin/glnxa64/libmwdastudio.so+04688912
[ 42] 0x00007f710fbdcb30 bin/glnxa64/libmwmvm.so+02726704 _ZN14cmddistributor15PackagedTaskIIP10invokeFuncIN5boost8functionIFvvEEEEENS2_10shared_ptrINS2_13unique_futureIDTclfp_EEEEEERKT_+00000080
[ 43] 0x00007f710fbdce3d bin/glnxa64/libmwmvm.so+02727485 _ZNSt17_Function_handlerIFN5boost3anyEvEZN14cmddistributor15PackagedTaskIIP10createFuncINS0_8functionIFvvEEEEESt8functionIS2_ET_EUlvE_E9_M_invokeERKSt9_Any_data+00000029
[ 44] 0x00007f70fcb7406c bin/glnxa64/libmwiqm.so+00778348 _ZN5boost6detail8function21function_obj_invoker0ISt8functionIFNS_3anyEvEES4_E6invokeERNS1_15function_bufferE+00000028
[ 45] 0x00007f70fcb73d4c bin/glnxa64/libmwiqm.so+00777548 _ZN3iqm18PackagedTaskPlugin7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+00000428
[ 46] 0x00007f70fc3cfded bin/glnxa64/libmwmcr.so+00646637
[ 47] 0x00007f70fcb51fba bin/glnxa64/libmwiqm.so+00638906
[ 48] 0x00007f70fcb40902 bin/glnxa64/libmwiqm.so+00567554
[ 49] 0x00007f70fa4b305a bin/glnxa64/libmwbridge.so+00159834
[ 50] 0x00007f70fa4ba55e bin/glnxa64/libmwbridge.so+00189790
[ 51] 0x00007f70fa4ba67b bin/glnxa64/libmwbridge.so+00190075
[ 52] 0x00007f70fa4bb003 bin/glnxa64/libmwbridge.so+00192515 _Z8mnParserv+00000627
[ 53] 0x00007f70fc3b8df3 bin/glnxa64/libmwmcr.so+00552435
[ 54] 0x00007f70fc3baf9e bin/glnxa64/libmwmcr.so+00561054
[ 55] 0x00007f70fc3bb619 bin/glnxa64/libmwmcr.so+00562713 _ZN5boost6detail17task_shared_stateINS_3_bi6bind_tIvPFvRKNS_8functionIFvvEEEENS2_5list1INS2_5valueIS6_EEEEEEvE6do_runEv+00000025
[ 56] 0x00007f70fc3b9f06 bin/glnxa64/libmwmcr.so+00556806
[ 57] 0x00007f70fcb87739 bin/glnxa64/libmwiqm.so+00857913
[ 58] 0x00007f70fcb7406c bin/glnxa64/libmwiqm.so+00778348 _ZN5boost6detail8function21function_obj_invoker0ISt8functionIFNS_3anyEvEES4_E6invokeERNS1_15function_bufferE+00000028
[ 59] 0x00007f70fcb73d4c bin/glnxa64/libmwiqm.so+00777548 _ZN3iqm18PackagedTaskPlugin7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+00000428
[ 60] 0x00007f70fcb51fba bin/glnxa64/libmwiqm.so+00638906
[ 61] 0x00007f70fcb4015f bin/glnxa64/libmwiqm.so+00565599
[ 62] 0x00007f70fcb42609 bin/glnxa64/libmwiqm.so+00574985
[ 63] 0x00007f710f59901a bin/glnxa64/libmwservices.so+02469914
[ 64] 0x00007f710f59a5cf bin/glnxa64/libmwservices.so+02475471
[ 65] 0x00007f710f59ad7a bin/glnxa64/libmwservices.so+02477434 _Z25svWS_ProcessPendingEventsiib+00000186
[ 66] 0x00007f70fc3b956e bin/glnxa64/libmwmcr.so+00554350
[ 67] 0x00007f70fc3b9901 bin/glnxa64/libmwmcr.so+00555265
[ 68] 0x00007f70fc3a7206 bin/glnxa64/libmwmcr.so+00479750
[ 69] 0x00007f710e1946ba /lib/x86_64-linux-gnu/libpthread.so.0+00030394
[ 70] 0x00007f710deca41d /lib/x86_64-linux-gnu/libc.so.6+01078301 clone+00000109
[ 71] 0x0000000000000000 <unknown-module>+00000000
I am on an Ubuntu OS. How can I convert the offset adresses, e.g.
/home/damjan/devel/system/agv_path_following/matlab/mpc_tricycle_sfun.mexa64+00053737
to source code lines to find out which part of my S-function is crashing Matlab?
I have found this and this related question, but they do not answer my specific problem. This SO question almost answers my problem, but I can not figure out how to compute the starting address of the shared library that I need for computing the right input for the addr2line tool.
Any help will be appreciated!

  0 Comments

Sign in to comment.

Answers (0)

Categories

Products


Release

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!