Closed gabrielenava closed 7 years ago
Maybe the mex-file is causing somewhere a null-pointer exception. Re-check the source code, i.e. all pointers and their allocations and deallocations. In Linux there exist a great tool for that, called "Valgrind".
Is the error only in Linux/Mac OS X?
@Ganimed I run the ctest in your WBM branch, and I still had the segmentation violation problem:
1: Fault Count: 1
1:
1:
1: Abnormal termination:
1: Segmentation violation
1:
1: Register State (from fault):
1: RAX = 4006ac5c6555bda3 RBX = 00007ff675279d98
1: RCX = 00007ff686c57e60 RDX = 00007ff686c57e80
1: RSP = 00007ff686c57bc0 RBP = 00007ff686c57bd0
1: RSI = 00007ff675279d98 RDI = 00007ff681651f30
1:
1: R8 = 00007ff686c57e40 R9 = 00007ff686c57e70
1: R10 = 0000000000000000 R11 = 0000000000000001
1: R12 = 00007ff681651f30 R13 = 00007ff686c57e60
1: R14 = 00007ff686c57e50 R15 = 00007ff686c57e40
1:
1: RIP = 00007ff693ee1940 EFL = 0000000000010202
1:
1: CS = 0033 FS = 0000 GS = 0000
1:
1: Stack Trace (from fault):
1: [ 0] 0x00007ff693ee1940 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+11843904
1: [ 1] 0x00007ff693ee1ac5 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+11844293
1: [ 2] 0x00007ff693846a56 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04917846
1: [ 3] 0x00007ff693843410 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04903952
1: [ 4] 0x00007ff69383e855 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04884565
1: [ 5] 0x00007ff69383eb69 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04885353
1: [ 6] 0x00007ff69384320d /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04903437
1: [ 7] 0x00007ff6938432e2 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04903650
1: [ 8] 0x00007ff69393a688 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+05916296
1: [ 9] 0x00007ff69393cb2f /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+05925679
1: [ 10] 0x00007ff693dbb10e /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+10637582
1: [ 11] 0x00007ff693eaae33 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+11619891
1: [ 12] 0x00007ff69707d8a3 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_dispatcher.so+00768163 _ZN8Mfh_file16dispatch_fh_implEMS_FviPP11mxArray_tagiS2_EiS2_iS2_+00000947
1: [ 13] 0x00007ff69707e16e /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_dispatcher.so+00770414 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00000030
1: [ 14] 0x00007ff693eb8847 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+11675719
1: [ 15] 0x00007ff693eb8aab /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+11676331
1: [ 16] 0x00007ff693f1e461 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+12092513
1: [ 17] 0x00007ff693844930 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04909360
1: [ 18] 0x00007ff693846c3c /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04918332
1: [ 19] 0x00007ff693843410 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04903952
1: [ 20] 0x00007ff69383e855 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04884565
1: [ 21] 0x00007ff69383eb69 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04885353
1: [ 22] 0x00007ff69384320d /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04903437
1: [ 23] 0x00007ff6938432e2 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04903650
1: [ 24] 0x00007ff69393a688 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+05916296
1: [ 25] 0x00007ff69393cb2f /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+05925679
1: [ 26] 0x00007ff693dbb10e /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+10637582
1: [ 27] 0x00007ff693eaae33 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+11619891
1: [ 28] 0x00007ff69707d8a3 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_dispatcher.so+00768163 _ZN8Mfh_file16dispatch_fh_implEMS_FviPP11mxArray_tagiS2_EiS2_iS2_+00000947
1: [ 29] 0x00007ff69707e16e /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_dispatcher.so+00770414 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00000030
1: [ 30] 0x00007ff693eb8847 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+11675719
1: [ 31] 0x00007ff693eb8aab /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+11676331
1: [ 32] 0x00007ff693f1e461 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+12092513
1: [ 33] 0x00007ff693844930 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04909360
1: [ 34] 0x00007ff693846c3c /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04918332
1: [ 35] 0x00007ff693843410 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04903952
1: [ 36] 0x00007ff69383e855 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04884565
1: [ 37] 0x00007ff69383eb69 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04885353
1: [ 38] 0x00007ff69384320d /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04903437
1: [ 39] 0x00007ff6938432e2 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04903650
1: [ 40] 0x00007ff69393a688 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+05916296
1: [ 41] 0x00007ff69393cb2f /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+05925679
1: [ 42] 0x00007ff693dbb10e /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+10637582
1: [ 43] 0x00007ff693eaae33 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+11619891
1: [ 44] 0x00007ff69707d8a3 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_dispatcher.so+00768163 _ZN8Mfh_file16dispatch_fh_implEMS_FviPP11mxArray_tagiS2_EiS2_iS2_+00000947
1: [ 45] 0x00007ff69707e16e /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_dispatcher.so+00770414 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00000030
1: [ 46] 0x00007ff693eb8847 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+11675719
1: [ 47] 0x00007ff693eb8aab /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+11676331
1: [ 48] 0x00007ff693f1e461 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+12092513
1: [ 49] 0x00007ff693844930 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04909360
1: [ 50] 0x00007ff693846c3c /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04918332
1: [ 51] 0x00007ff693843410 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04903952
1: [ 52] 0x00007ff69383e855 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04884565
1: [ 53] 0x00007ff69383eb69 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04885353
1: [ 54] 0x00007ff69384320d /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04903437
1: [ 55] 0x00007ff6938432e2 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+04903650
1: [ 56] 0x00007ff69393a688 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+05916296
1: [ 57] 0x00007ff69393cb2f /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+05925679
1: [ 58] 0x00007ff693dbb10e /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+10637582
1: [ 59] 0x00007ff693d82eab /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+10407595
1: [ 60] 0x00007ff693d82fb3 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+10407859
1: [ 61] 0x00007ff693d850d9 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+10416345
1: [ 62] 0x00007ff693dfdbbe /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+10910654
1: [ 63] 0x00007ff693dfe072 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+10911858
1: [ 64] 0x00007ff69679d941 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_interpreter.so+02443585 _Z51inEvalCmdWithLocalReturnInDesiredWSAndPublishEventsRKSbIDsSt11char_traitsIDsESaIDsEEPibbP15inWorkSpace_tag+00000065
1: [ 65] 0x00007ff697adefc1 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00696257 _ZNK3iqm18InternalEvalPlugin24inEvalCmdWithLocalReturnERKSbIDsSt11char_traitsIDsESaIDsEEP15inWorkSpace_tag+00000097
1: [ 66] 0x00007ff697ae09db /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00702939 _ZN3iqm18InternalEvalPlugin7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+00000123
1: [ 67] 0x00007ff6973546cd /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00624333
1: [ 68] 0x00007ff697ad3a0a /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00649738
1: [ 69] 0x00007ff697abfeb2 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00569010
1: [ 70] 0x00007ff69631b05a /usr/local/MATLAB/R2016b/bin/glnxa64/libmwbridge.so+00159834
1: [ 71] 0x00007ff69631b617 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwbridge.so+00161303
1: [ 72] 0x00007ff696322519 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwbridge.so+00189721
1: [ 73] 0x00007ff696322614 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwbridge.so+00189972
1: [ 74] 0x00007ff696322fa9 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwbridge.so+00192425 _Z8mnParserv+00000617
1: [ 75] 0x00007ff69733f243 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00537155
1: [ 76] 0x00007ff6973411ce /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00545230
1: [ 77] 0x00007ff697341849 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00546889 _ZN5boost6detail17task_shared_stateINS_3_bi6bind_tIvPFvRKNS_8functionIFvvEEEENS2_5list1INS2_5valueIS6_EEEEEEvE6do_runEv+00000025
1: [ 78] 0x00007ff697340236 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00541238
1: [ 79] 0x00007ff697b07b49 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00863049
1: [ 80] 0x00007ff697af451c /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00783644 _ZN5boost6detail8function21function_obj_invoker0ISt8functionIFNS_3anyEvEES4_E6invokeERNS1_15function_bufferE+00000028
1: [ 81] 0x00007ff697af41fc /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00782844 _ZN3iqm18PackagedTaskPlugin7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+00000428
1: [ 82] 0x00007ff697ad3a0a /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00649738
1: [ 83] 0x00007ff697abf690 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00566928
1: [ 84] 0x00007ff697ac2048 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00577608
1: [ 85] 0x00007ff6a755f40a /usr/local/MATLAB/R2016b/bin/glnxa64/libmwservices.so+02634762
1: [ 86] 0x00007ff6a75609af /usr/local/MATLAB/R2016b/bin/glnxa64/libmwservices.so+02640303
1: [ 87] 0x00007ff6a75610e6 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwservices.so+02642150 _Z25svWS_ProcessPendingEventsiib+00000102
1: [ 88] 0x00007ff69733f8c6 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00538822
1: [ 89] 0x00007ff69733fc42 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00539714
1: [ 90] 0x00007ff69732d8d6 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00465110
1: [ 91] 0x00007ff6a61786ba /lib/x86_64-linux-gnu/libpthread.so.0+00030394
1: [ 92] 0x00007ff6a5eae82d /lib/x86_64-linux-gnu/libc.so.6+01075245 clone+00000109
1: [ 93] 0x0000000000000000 <unknown-module>+00000000
1:
1:
1: If this problem is reproducible, please submit a Service Request via:
1: http://www.mathworks.com/support/contact_us/
1:
1: A technical support engineer might contact you with further information.
1:
1: Thank you for your help.** This crash report has been saved to disk as /home/gnava/matlab_crash_dump.25875-1 **
1:
1:
1:
1: MATLAB is exiting because of fatal error
1/1 Test #1: matlab_mex_wholebodymodel_tests ...***Exception: Other 28.56 sec
actually, unlike the previous time, the test started without problems:
test 1
Start 1: matlab_mex_wholebodymodel_tests
Test command: /usr/local/MATLAB/R2016b/bin/matlab "-nodesktop" "-nojvm" "-nodisplay" "-r" "runWBMTests"
Test timeout computed to be: 1500
< M A T L A B (R) >
Copyright 1984-2016 The MathWorks, Inc.
R2016b (9.1.0.441655) 64-bit (glnxa64)
September 7, 2016
For online documentation, see http://www.mathworks.com/support
For product information, visit www.mathworks.com.
Non-Degree Granting Education License -- for use at non-degree granting, nonprofit,
educational organizations only. Not for government, commercial, or other organizational use.
but then I got the error. Do the tests run on your pc?
@gabrielenava: Yes, there is still a problem with the segmentation fault. I compiled the code also in DEBUG mode, to see all the outputs and steps. The problem is still in the destructor of the ModelState class. The strange thing is, if you call the mex-subroutine in a normal procedure like "timeTest.m" and afterwards unload it from Matlab's memory manager with the "clear all" command, then the deallocation of the arrays in the ModelState class works flawlessly. But in the CTest it fails at exact position. After freeing the robotWBIModel, the system is not able to free the following arrays of the state variable. That's really strange! Furthermore, outside of the mexWholeBodyModel subroutine the CTest methods in Matlab causing also some sporadic segmentation faults. I suspect in this case that some random generated values are out of scope and causing these effects. But anyway the subroutine is now more stable than before. Let's talk about this tomorrow.
P.S: My system shows mostly that the CTest has passed successfully but immediately afterwards when the subroutine will be unloaded from the system it causes a segmentation problem. More details I will explain in the report.
ctest is finally working! great job @Ganimed, I will close this issue as soon as we merge into master
:+1:
Grazie! :smile:
I tried to run the ctest on the fixWin branch. The ctest fails with the following error:
UPDATE: apparently, the error is also in the master branch