-
Notifications
You must be signed in to change notification settings - Fork 42
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
Matlab crashes when using ezc3dWrite() #125
Comments
Hello! What you wrote seems right, so I'll have a look why you get a core dump! I'll reach ASAP! |
Based on the code you provided, I was unable to reproduce a core krash. However, I spotted a mistake that may explain your bug. The line 78 should read: Can you confirm that the following simplified code from yours (using the c3d files Vicon.c3d from https://github.com/pyomeca/ezc3d-testFiles) actually works? If if does not, that is probably an OS dependent issue, so I would need to know which OS you are using and which commit you compiled from.
Thanks! |
Thanks for the quick response! I'll edit that line and run it on one of the
test files and get back to you ASAP.
Jake
…On Tue, Jun 2, 2020 at 1:42 PM Pariterre ***@***.***> wrote:
Based on the code you provided, I was unable to reproduce a core krash.
However, I spotted a mistake that may explain your bug. The line 78 should
read: currentVirtualMarker = virtualMarkerLabels{k}; (with curly
brackets) because otherwise it stores the cells containing the names,
instead of the names themselves. In any case, that does not produce a
segmentation fault here (but it does raise an error).
Can you confirm that the following simplified code from yours (using the
c3d files Vicon.c3d from https://github.com/pyomeca/ezc3d-testFiles)
actually works? If if does not, that is probably an OS dependent issue, so
I would need to know which OS you are using and which commit you compiled
from.
% Housecleaning
close all
clear
clc
c3d = ezc3dRead('Vicon.c3d');
frameToPlot = 1;
% Virtual Marker Label list %
virtualMarkerLabels = {'midAC'}';
% Append virtual marker labels to c3d label list %
for k = 1:length(virtualMarkerLabels)
c3d.parameters.POINT.LABELS.DATA{end+1} = virtualMarkerLabels(k);
end
% Marker Labels and positions to be used for virtual marker position
% calculation
markerLabels = {'Daphnee:SCAP_CP' 'Daphnee:SCAP_RS'}';
idx_markerLabels = zeros(1,length(markerLabels))';
markerCoordinates = zeros(3,length(markerLabels));
for i = 1:length(markerLabels)
idx_markerLabels(i) = find(strcmp(c3d.parameters.POINT.LABELS.DATA,markerLabels(i)));
markerCoordinates(:,i) = c3d.data.points(:,idx_markerLabels(i),frameToPlot);
end
virtualMarkerCoordinates = zeros(3,length(virtualMarkerLabels));
% midAC coordinates from acromion processes
virtualMarkerCoordinates(:,1) = mean(markerCoordinates(:,1:2),2);
% Append virtual marker coordinates to c3d structure and save as new c3d
% Append virtual marker coordinates to the c3d coordinates data
frame1 = horzcat(c3d.data.points(:,:,1),virtualMarkerCoordinates);
frame2 = horzcat(c3d.data.points(:,:,2),zeros(size(virtualMarkerCoordinates)));
c3d.data.points = cat(3,frame1,frame2);
% Correct dimensions of... everything...
% data residuals
c3d.data.meta_points.residuals = horzcat(c3d.data.meta_points.residuals(:,:,1),zeros(1,size(virtualMarkerCoordinates,2)));
c3d.data.meta_points.residuals = cat(3,c3d.data.meta_points.residuals,c3d.data.meta_points.residuals);
% camera masks
c3d.data.meta_points.camera_masks = horzcat(c3d.data.meta_points.camera_masks(:,:,1),zeros(7,size(virtualMarkerCoordinates,2)));
c3d.data.meta_points.camera_masks = cat(3,c3d.data.meta_points.camera_masks,c3d.data.meta_points.camera_masks);
% Write new c3d file
ezc3dWrite('test.c3d',c3d);
c3d_2 = ezc3dRead('test.c3d');
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#125 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/APZ6BBIKG2S7RSII2ITGYC3RUU22BANCNFSM4NQXGB4Q>
.
|
Ran into the same issue with the Vicon.c3d test file using the simplified
code.
I'm running Windows10 on my PC, but I'm not sure what you're asking for
when you say "last commit I compiled from".
Jake
Access violation detected at Tue Jun 02 01:53:08 2020 -0400
--------------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : windows-1252
Deployed : false
Graphics Driver : Unknown hardware
Graphics card 1 : NVIDIA ( 0x10de ) NVIDIA GeForce GTX 1660
Version 26.21.14.4575 (2020-3-17)
Java Version : Java 1.8.0_202-b08 with Oracle Corporation
Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Architecture : win64
MATLAB Entitlement ID : 2294143
MATLAB Root : C:\Program Files\MATLAB\R2020a
MATLAB Version : 9.8.0.1380330 (R2020a) Update 2
OpenGL : hardware
Operating System : Microsoft Windows 10 Education
Process ID : 12968
Processor ID : x86 Family 143 Model 113 Stepping 0,
AuthenticAMD
Session Key : c13d75cc-10c5-4f99-a66b-950e9e725d3c
Window System : Version 10.0 (Build 18363)
Fault Count: 1
Abnormal termination:
Access violation
Register State (from fault):
RAX = 0000000000000000 RBX = 0000000000000000
RCX = 000001dd1a379600 RDX = 00007ffa2232bfd0
RSP = 000000d833afa920 RBP = 000000d833afaed0
RSI = 000001dd104955f0 RDI = 000000d833afaaf8
R8 = 0000000000000000 R9 = 0000000000000001
R10 = 0000000000008000 R11 = 000000d833afa850
R12 = 0000000000000002 R13 = 0000000000000000
R14 = 000001dd56f77d00 R15 = 000001dd1a385000
RIP = 00007ff9ebd31545 EFL = 00010256
CS = 0033 FS = 0053 GS = 002b
Stack Trace (from fault):
[ 0] 0x00007ff9ebd31545 D:\UTKnox\Projects\Triple
Hop\Matlab\ezc3d\ezc3dWrite.mexw64+00005445
[ 1] 0x00007ff9ebd339fb D:\UTKnox\Projects\Triple
Hop\Matlab\ezc3d\ezc3dWrite.mexw64+00014843 mexFunction+00002731
[ 2] 0x00007ffa1ee1d406 C:\Program
Files\MATLAB\R2020a\bin\win64\libmex.dll+00381958
mexfile::Inspector::needs_upgrade+00015190
[ 3] 0x00007ffa1ee1e7db C:\Program
Files\MATLAB\R2020a\bin\win64\libmex.dll+00387035
MexRetrieveVersion+00003563
[ 4] 0x00007ffa1ee1e94c C:\Program
Files\MATLAB\R2020a\bin\win64\libmex.dll+00387404
MexRetrieveVersion+00003932
[ 5] 0x00007ffa1ee1eb14 C:\Program
Files\MATLAB\R2020a\bin\win64\libmex.dll+00387860
MexRetrieveVersion+00004388
[ 6] 0x00007ffa1edff819 C:\Program
Files\MATLAB\R2020a\bin\win64\libmex.dll+00260121
QueryMLFcnTable_libmex+00006377
[ 7] 0x00007ffa1f39aebd
bin\win64\pgo\m_dispatcher.dll+00634557
Mfh_file::dispatch_file_common+00000165
[ 8] 0x00007ffa1f39a54d
bin\win64\pgo\m_dispatcher.dll+00632141 Mfh_error::lookup+00006517
[ 9] 0x00007ffa1f39ae11
bin\win64\pgo\m_dispatcher.dll+00634385 Mfh_file::dispatch+00000045
[ 10] 0x00007ffa15c63898
bin\win64\pgo\m_lxe.dll+00538776
[ 11] 0x00007ffa15c2c386
bin\win64\pgo\m_lxe.dll+00312198
[ 12] 0x00007ffa15c2c270
bin\win64\pgo\m_lxe.dll+00311920
[ 13] 0x00007ffa15c61ce4
bin\win64\pgo\m_lxe.dll+00531684
[ 14] 0x00007ffa15d789b1
bin\win64\pgo\m_lxe.dll+01673649 MathWorks::lxe::ShutdownLxeEngine+00081477
[ 15] 0x00007ffa15c53f8d
bin\win64\pgo\m_lxe.dll+00475021
[ 16] 0x00007ffa15c56344
bin\win64\pgo\m_lxe.dll+00484164
[ 17] 0x00007ffa15c5745d
bin\win64\pgo\m_lxe.dll+00488541
[ 18] 0x00007ffa15c5704f
bin\win64\pgo\m_lxe.dll+00487503
[ 19] 0x00007ffa15d60fb4
bin\win64\pgo\m_lxe.dll+01576884 MathWorks::lxe::StartupLxeEngine+00374224
[ 20] 0x00007ffa15c5f30b
bin\win64\pgo\m_lxe.dll+00520971
[ 21] 0x00007ffa15c5562e
bin\win64\pgo\m_lxe.dll+00480814
[ 22] 0x00007ffa15c546ac
bin\win64\pgo\m_lxe.dll+00476844
[ 23] 0x00007ffa15cc5abf
bin\win64\pgo\m_lxe.dll+00940735
[ 24] 0x00007ffa15cc5c2b
bin\win64\pgo\m_lxe.dll+00941099
[ 25] 0x00007ffa15cc5b22
bin\win64\pgo\m_lxe.dll+00940834
[ 26] 0x00007ffa15cfce70
bin\win64\pgo\m_lxe.dll+01166960
[ 27] 0x00007ffa15cfce1e
bin\win64\pgo\m_lxe.dll+01166878
[ 28] 0x00007ffa17714ef8
bin\win64\pgo\m_lxe.dll+28528376
MathWorks::lxe::profiler::IMexProfilingSupport::~IMexProfilingSupport+00083312
[ 29] 0x00007ffa2319da8c C:\Program
Files\MATLAB\R2020a\bin\win64\libmwbridge.dll+00187020 mnParser+00001212
[ 30] 0x00007ffa1f4b6a99 C:\Program
Files\MATLAB\R2020a\bin\win64\mcr.dll+00551577
mcr_set_enableReadingFromStdin+00016745
[ 31] 0x00007ffa1f44a05a C:\Program
Files\MATLAB\R2020a\bin\win64\mcr.dll+00106586
mcrOptions::set_use_license_manager+00071962
[ 32] 0x00007ffa1f46b04a C:\Program
Files\MATLAB\R2020a\bin\win64\mcr.dll+00241738
mcrOptions::set_use_license_manager+00207114
[ 33] 0x00007ffa1f6e653e C:\Program
Files\MATLAB\R2020a\bin\win64\iqm.dll+00615742
iqm::PackagedTaskPlugin::execute+00000862
[ 34] 0x00007ffa1f6e63c9 C:\Program
Files\MATLAB\R2020a\bin\win64\iqm.dll+00615369
iqm::PackagedTaskPlugin::execute+00000489
[ 35] 0x00007ffa1f4b084e C:\Program
Files\MATLAB\R2020a\bin\win64\mcr.dll+00526414
mcrIsExternalAvailableBuiltin+00045518
[ 36] 0x00007ffa1f6bca03 C:\Program
Files\MATLAB\R2020a\bin\win64\iqm.dll+00444931
iqm::Iqm::setupIqmFcnPtrs+00100227
[ 37] 0x00007ffa1f694e2f C:\Program
Files\MATLAB\R2020a\bin\win64\iqm.dll+00282159 iqm::Iqm::create+00009279
[ 38] 0x00007ffa1f694428 C:\Program
Files\MATLAB\R2020a\bin\win64\iqm.dll+00279592 iqm::Iqm::create+00006712
[ 39] 0x00007ffa1f487d06 C:\Program
Files\MATLAB\R2020a\bin\win64\mcr.dll+00359686
mcrInstantiationError::operator=+00012150
[ 40] 0x00007ffa1f48830c C:\Program
Files\MATLAB\R2020a\bin\win64\mcr.dll+00361228
mcrInstantiationError::operator=+00013692
[ 41] 0x00007ffa1f485f0c C:\Program
Files\MATLAB\R2020a\bin\win64\mcr.dll+00352012
mcrInstantiationError::operator=+00004476
[ 42] 0x00007ffa8b1ba203 C:\Program
Files\MATLAB\R2020a\bin\win64\mwboost_thread-vc141-mt-x64-1_70.dll+00041475
mwboost::thread::swap+00000083
[ 43] 0x00007ffa9e390e82
C:\Windows\System32\ucrtbase.dll+00134786 beginthreadex+00000322
[ 44] 0x00007ffa9f347bd4
C:\Windows\System32\KERNEL32.DLL+00097236 BaseThreadInitThunk+00000020
[ 45] 0x00007ffaa12ece51
C:\Windows\SYSTEM32\ntdll.dll+00446033 RtlUserThreadStart+00000033
This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.
…On Tue, Jun 2, 2020 at 1:45 PM Jake Melaro ***@***.***> wrote:
Thanks for the quick response! I'll edit that line and run it on one of
the test files and get back to you ASAP.
Jake
On Tue, Jun 2, 2020 at 1:42 PM Pariterre ***@***.***> wrote:
> Based on the code you provided, I was unable to reproduce a core krash.
> However, I spotted a mistake that may explain your bug. The line 78 should
> read: currentVirtualMarker = virtualMarkerLabels{k}; (with curly
> brackets) because otherwise it stores the cells containing the names,
> instead of the names themselves. In any case, that does not produce a
> segmentation fault here (but it does raise an error).
>
> Can you confirm that the following simplified code from yours (using the
> c3d files Vicon.c3d from https://github.com/pyomeca/ezc3d-testFiles)
> actually works? If if does not, that is probably an OS dependent issue, so
> I would need to know which OS you are using and which commit you compiled
> from.
>
> % Housecleaning
> close all
> clear
> clc
>
> c3d = ezc3dRead('Vicon.c3d');
> frameToPlot = 1;
>
>
> % Virtual Marker Label list %
> virtualMarkerLabels = {'midAC'}';
>
> % Append virtual marker labels to c3d label list %
> for k = 1:length(virtualMarkerLabels)
> c3d.parameters.POINT.LABELS.DATA{end+1} = virtualMarkerLabels(k);
> end
>
> % Marker Labels and positions to be used for virtual marker position
> % calculation
> markerLabels = {'Daphnee:SCAP_CP' 'Daphnee:SCAP_RS'}';
> idx_markerLabels = zeros(1,length(markerLabels))';
> markerCoordinates = zeros(3,length(markerLabels));
> for i = 1:length(markerLabels)
> idx_markerLabels(i) = find(strcmp(c3d.parameters.POINT.LABELS.DATA,markerLabels(i)));
> markerCoordinates(:,i) = c3d.data.points(:,idx_markerLabels(i),frameToPlot);
> end
> virtualMarkerCoordinates = zeros(3,length(virtualMarkerLabels));
>
> % midAC coordinates from acromion processes
> virtualMarkerCoordinates(:,1) = mean(markerCoordinates(:,1:2),2);
>
> % Append virtual marker coordinates to c3d structure and save as new c3d
> % Append virtual marker coordinates to the c3d coordinates data
> frame1 = horzcat(c3d.data.points(:,:,1),virtualMarkerCoordinates);
> frame2 = horzcat(c3d.data.points(:,:,2),zeros(size(virtualMarkerCoordinates)));
> c3d.data.points = cat(3,frame1,frame2);
>
> % Correct dimensions of... everything...
> % data residuals
> c3d.data.meta_points.residuals = horzcat(c3d.data.meta_points.residuals(:,:,1),zeros(1,size(virtualMarkerCoordinates,2)));
> c3d.data.meta_points.residuals = cat(3,c3d.data.meta_points.residuals,c3d.data.meta_points.residuals);
>
> % camera masks
> c3d.data.meta_points.camera_masks = horzcat(c3d.data.meta_points.camera_masks(:,:,1),zeros(7,size(virtualMarkerCoordinates,2)));
> c3d.data.meta_points.camera_masks = cat(3,c3d.data.meta_points.camera_masks,c3d.data.meta_points.camera_masks);
>
> % Write new c3d file
> ezc3dWrite('test.c3d',c3d);
>
> c3d_2 = ezc3dRead('test.c3d');
>
> Thanks!
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#125 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/APZ6BBIKG2S7RSII2ITGYC3RUU22BANCNFSM4NQXGB4Q>
> .
>
|
That seems to be OS related then, I'll test on a windows computer as soon as I have access to one (I have colleagues that I can ask), I'll come back to you afterwards! The compilation question is more related on how did you install ezc3d? |
I followed the youtube video you posted in response to another issue, i.e., downloaded CMake and VisualStudio |
Okay! I'll have a look very soon :) |
Ok my bad... I actually made the same mistake as you! I wanted to test if it was the actual problem, so I changed the curly brackets for round brackets, but when I copied the code to send it here, I forgot to put back the curly brackets... % Housecleaning
close all
clear
clc
c3d = ezc3dRead('Vicon.c3d');
frameToPlot = 1;
% Virtual Marker Label list %
virtualMarkerLabels = {'midAC'}';
% Append virtual marker labels to c3d label list %
for k = 1:length(virtualMarkerLabels)
c3d.parameters.POINT.LABELS.DATA{end+1} = virtualMarkerLabels{k};
end
% Marker Labels and positions to be used for virtual marker position
% calculation
markerLabels = {'Daphnee:SCAP_CP' 'Daphnee:SCAP_RS'}';
idx_markerLabels = zeros(1,length(markerLabels))';
markerCoordinates = zeros(3,length(markerLabels));
for i = 1:length(markerLabels)
idx_markerLabels(i) = find(strcmp(c3d.parameters.POINT.LABELS.DATA,markerLabels(i)));
markerCoordinates(:,i) = c3d.data.points(:,idx_markerLabels(i),frameToPlot);
end
virtualMarkerCoordinates = zeros(3,length(virtualMarkerLabels));
% midAC coordinates from acromion processes
virtualMarkerCoordinates(:,1) = mean(markerCoordinates(:,1:2),2);
% Append virtual marker coordinates to c3d structure and save as new c3d
% Append virtual marker coordinates to the c3d coordinates data
frame1 = horzcat(c3d.data.points(:,:,1),virtualMarkerCoordinates);
frame2 = horzcat(c3d.data.points(:,:,2),zeros(size(virtualMarkerCoordinates)));
c3d.data.points = cat(3,frame1,frame2);
% Correct dimensions of... everything...
% data residuals
c3d.data.meta_points.residuals = horzcat(c3d.data.meta_points.residuals(:,:,1),zeros(1,size(virtualMarkerCoordinates,2)));
c3d.data.meta_points.residuals = cat(3,c3d.data.meta_points.residuals,c3d.data.meta_points.residuals);
% camera masks
c3d.data.meta_points.camera_masks = horzcat(c3d.data.meta_points.camera_masks(:,:,1),zeros(7,size(virtualMarkerCoordinates,2)));
c3d.data.meta_points.camera_masks = cat(3,c3d.data.meta_points.camera_masks,c3d.data.meta_points.camera_masks);
% Write new c3d file
ezc3dWrite('test.c3d',c3d);
c3d_2 = ezc3dRead('test.c3d'); This should actually works! |
Worked like a charm! Thanks a ton! JM |
Just as a reminder for me, I will leave this issue open so I can produce a proper error message when non strings are casted as string. |
Thanks again for reporting! |
Hello there,
I'm trying to append virtual markers to the c3d file through Matlab and when I execute the ezc3dWrite() function while inputting the new c3d structure Matlab crashes.
C3D_Import_Add_Virtual_Markers.txt
matlab_crash_dump.txt
The text was updated successfully, but these errors were encountered: