-
Notifications
You must be signed in to change notification settings - Fork 20
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
maximum recursion limit reached #20
Comments
Hi @neuromechanist , I have the same problem with the test file (test.xdf in sample_data/test_data). I think this might be due to how new versions of MATLAB handles objects. In the old version, there was no recursive call when accessing object properties, but now there might be. Would you mind to investigate? |
Thanks, @lauraf94 for pointing out this issue. Could you provide a sample XDF that you were using and encountered this error? Also, please provide more details, including the MATLAB version and the OS you are running on your machine, so I can replicate the problem. You can use this OneDrive folder to upload the sample dataset. |
You may use eeglab/sample_data/test_data/test.xdf tx |
Hi @neuromechanist, I am using MATLAB R2024a, on Windows 11. I have tried with multiple xdf files, always obtaining the same error. It must be indeed a problem with the new MATLAB version; since when I try to open the same files with MATLAB R2023a it works. |
I was able to reproduce the error. I could make the error both with 2024a (both Mac and Windows) and 2023b (both Mac and Windows). Matlab 2022b (on Windows 64-bit) worked as expected. Line 113 in 8942ac1
when Matlab tries to get obj.timeStamp .
To put a little bit of background, the xdf metadata is temporarily stored in hear Line 98 in 8942ac1
The path to the header file is added to the obj. The same class has getters ( obj.get.timeStamp for example) that call the obj.retrieveProperty method (also defined under the same class) to load the property from the header file.
My inspection using 2023b showed that Line 148 in 8942ac1
, causing recursive calls. This is a lazy implementation that would pull the variables as needed. Surprisingly, running the same plug-in, I would get all I am not currently sure about a solution. Putting almost some hours on possible solutions, including removing the lazy implementation and adding all fields together to the obj did not immediately resolve the issue, although the issue seem to move to another portion of the code, likely because there are other places where the same problem happens. I think a more effective way to answer this problem is to investigate what has changed in Maltab that causes this problem. Also, we could look into alternative approaches, like the xdf_import plug-in that seems to be successful in importing the EEG file even using the latest Matlab. |
Modifying the getter methods may be the way to resolve this issue. For example, the particular problem that occurred above goes away with changing the timeStamp getter methods. function timeStamp = get.timeStamp(obj)
if isempty(obj.timeStamp)
timeStamp = retrieveProperty(obj,'timeStamp');
else
timeStamp = obj.timeStamp;
end
end The challenge, however, is that there are many of these getter methods that may need to be updated. |
Warning: Maximum recursion limit of 500 reached.
The text was updated successfully, but these errors were encountered: