Files
mocha/bug2020b.txt
2022-08-04 10:19:32 +02:00

54 lines
3.8 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Dear Jan,
Thank you for the feedback and your suggestion to use LD_PRELOAD to load the library before we then actually LD_PRELOAD the partial glibc 2.18 implementation. Then your library should still be able to load with pure glibc 2.17 as available on your system, in which this glibc bug does not exist. I had not thought of this. I have now added this approach to our knowledge base.
Thanks again and best regards,
Martijn
--------------- Original Message ---------------
From: Martijn Aben [support@mathworks.nl]
Sent: 6/3/2021 11:56 AM
To: jan.chrin@psi.ch
Subject: Re: mex file hangs in 2020b on Linux [ ref:_00Di0Ha1u._5003q1PWEEz:ref ]
Dear Jan Chrin,
I am writing in reference to your Technical Support Case 04900956 regarding 'mex file hangs in 2020b on Linux'.
I suspect that what is going on here is that this third-party library is using pthread_join() when loaded (i.e. it might call it its entry point or the constructor of a static class instance). Using pthread_join() at library load, will lead to deadlocks in glibc versions 2.18 2.22:
https://bugzilla.redhat.com/show_bug.cgi?id=1223055
Now it looks like you are on a Red Hat 7 (based) system. RHEL 7 by default includes glibc 2.17 and so in general, outside MATLAB, you would not run into this issue with that third-party library which you work with. As a matter of fact, even inside MATLAB you will not run into any issues related to this as long as you work with a MATLAB release before R2020b; those releases will simply work with your system's glibc 2.17.
Starting with MATLAB R2020b however, MATLAB is no longer compatible with glibc 2.17, we now require 2.18 at a minimum. To still allow MATLAB to run on RHEL 7 systems, which we did still want to support, we therefore have included a partial glibc 2.18 implementation with MATLAB R20208b which is loaded on top of the glibc 2.17 of your system (if needed, if you are on a system with newer glibc we will simply only use the newer system glibc). This glibc 2.18 implementation which we add, then also actually introduces that glibc 2.18 bug.
There is no direct/straightforward solution or workaround for this issue, you have to either:
1. Avoid the usage of pthread_join() during library load. Perhaps move the initialization code which normally occurs statically/automatically at library load to a function which can/must be be called after the library has loaded. You may be able to make this change by yourself or you might need to work with the developer of the third-party library to see whether they can/are willing to make this change. The issue is not necessarily MATLAB specific; it could occur with any application trying to work with their library on a Linux distribution with glibc versions 2.18 2.22, so it could really be worth making that change. Or,
2. Work with MATLAB releases prior to R2020b, or
3. Since upgrading glibc in an existing Linux distribution is not really an option, switch to version 8 of your Red Hat (based) Linux distribution, which includes glibc 2.28 which we can work with directly and which should not suffer from that glibc bug which exists in versions 2.18 2.22. Or switch to an entirely different Linux distribution/version altogether which includes glibc > 2.22.
Please preserve the Reference ID in further correspondence on this query. This allows our systems to automatically associate your reply to the appropriate Case.
If you have a new technical support question, please submit a new request here:
http://www.mathworks.com/support/servicerequests/create.html
Sincerely,
Martijn Aben
MathWorks Technical Support Department
Self-Service: http://www.mathworks.com/support
File Exchange and MATLAB Answers: http://www.mathworks.com/matlabcentral/
The MathWorks BV
Dr. Holtroplaan 5B
5652 XR Eindhoven
The Netherlands
Chamber of Commerce Eindhoven: 29046452