Skip to content
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

Segfault on exit on Linux #3

Open
mducle opened this issue Sep 22, 2021 · 0 comments
Open

Segfault on exit on Linux #3

mducle opened this issue Sep 22, 2021 · 0 comments

Comments

@mducle
Copy link
Member

mducle commented Sep 22, 2021

For complex operations, pace_python almost always segfaults on exit on Linux.

Run the following script:

import pace_python
m = pace_python.Matlab()
sw = m.spinw()
print(sw)

This produces a segfault. If the final line print(sw) is removed, there is no segfault... there's something screwy with the garbage collector...

The following base matlab-python code also segfaults:

import pace_python.pace
m = pace_python.pace.initialize()
sw = m.call('spinw', [], nargout=1)
m.call('disp', [sw], nargout=1)
m.exit()

(the segfault occurs irregardless of whether the final m.exit() is there or not). However:

import pace_python.pace
m = pace_python.pace.initialize()
sw = m.call('spinw', [], nargout=1)
sws = m.call('struct', [sw], nargout=1)
print(sws)

Does not segfault - suggesting it's something about the disp call...?

mducle added a commit that referenced this issue Sep 23, 2021
* Now uses a wrapper class around the Matlab interface
  This ensures that the `__del__` method of this class
  will only be called when all references to Matlab has
  been garbage collected.
* This is an attempt to fix the ext segfault #3 but it
  doesn't fix it entirely (something funky on the Matlab
  side).
* Fix MatlabProxyObject `__setattr__` - can now do e.g.
  `h = m.herbert_config(); h.use_mex = True`
* Fix `worker_v2.m` not found in initialisation
  (introduced in Horace 3.5.3)
* Fix Windows Jenkinsfile - now uses PowerShell commands
  to notify github; and fixed build and run scripts
* Fix DataTypes.py encoding list recursion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant