-
Notifications
You must be signed in to change notification settings - Fork 1
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
Dlite v0.5.24 causes segmentation fault in linux for pytest startup #327
Comments
This is not a bug in DLite, but caused by the changes in commit a24efd4. Commit a24efd4 should be fixed or revoked. Checking out commit fdd527d does not result in segfault. One part of the issue is pytest that during its collection phase loads modules without importing them properly. But the real problem is commit fdd527d. With the changes in commit a24efd4, SWIG_init() is not called during the pytest collection phase. That results in a segfault when any other SWIG-generated function is called. This happens in the SWIG-generated API and has nothing to do with DLite. |
I am getting the same segmentation fault in other repositories for DLite version later than v0.5.23 when running pytest and dlite is imported and used. Until a solution is found for not having DLite result in segmentation faults, I cannot see a reason to upgrade. If the solution can be found outside of changing the internals or build of DLite that is fine, but a universal solution should be found that does not result in segmentation faults for the later versions. |
For some reason the segmenatition fault does not occur when the line about treating warnings as errors in the pytest settings in pyproject is commented out. Some other issues pop up though. |
This might be relevant: When using Dlite-Pyhon==0.5.24 I get the followin warning: And a search on that points me to the above isse. Support for Swig 4.3.0 was introduced in DLite-Pyton==0.5.24. Apparently there is an issue there that we are not the only ones encountering. They have a milestone on fixing this for the next release. Does pytest just shut down everything in a manner so that DLite is not able to shut down properly and causes a segmantation fault, if warnings> errors? |
Well spotted and debugged @francescalb ! 😃 Raising Python warnings to error level definitely should not cause segmentation faults. So there seems to be some race conditions happening concerning SWIG, DLite and their interaction with the Python interpreter executing pytest, wherein the exception at the SWIG level (i.e., when the DeprecationWarning happens) is not handled properly before a "shutdown". |
See for example this run or this run.
The text was updated successfully, but these errors were encountered: