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

[BUG] Segmentation fault when trying to convert VASP MD trajectory using ASE. #592

Open
arm61 opened this issue Nov 4, 2024 · 4 comments · May be fixed by #607
Open

[BUG] Segmentation fault when trying to convert VASP MD trajectory using ASE. #592

arm61 opened this issue Nov 4, 2024 · 4 comments · May be fixed by #607
Labels
bug Something isn't working enhancement New feature or request

Comments

@arm61
Copy link

arm61 commented Nov 4, 2024

I get a segmentation fault when trying to convert a VASP trajectory, using the ASE convertoer.

I can share the relevant file if necessary by email; could likely be a user error.

@arm61 arm61 added bug Something isn't working enhancement New feature or request labels Nov 4, 2024
@MBartkowiakSTFC
Copy link
Collaborator

The trajectory file itself would definitely help us identify the problem. You are welcome to use MDANSE-help@stfc.ac.uk to send us the file, or a download link to the file.

Overall, please share more details with us, such as the OS, Python version, ASE version and VASP version you were using. If your conversion run created a log file, you can send it to us too. I expect that, since it was a segmentation fault, you received no traceback from the Python interpreter.

@arm61
Copy link
Author

arm61 commented Nov 15, 2024

I have emailed the files over, they are quite large so hopefully they make it.

The other information is as follows:

  • OS: macOS
  • Python version: 3.11
  • ASE version: Whatever version MDANSE is using
  • MDANSE version: 2.0.0b2
  • MDANSE GUI version: 0.1.0b3
  • VASP veresion: 6.4.2

The Python traceback when the error is raised:

python3.11(18636,0x319d07000) malloc: Heap corruption detected, free list is damaged at 0x600001125320
*** Incorrect guard value: 242712764896031
python3.11(18636,0x319d07000) malloc: *** set a breakpoint in malloc_error_break to debug
[1]    18636 abort      mdanse_gui
Process Subprocess-1:
Traceback (most recent call last):
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/site-packages/MDANSE/Framework/Jobs/IJob.py", line 410, in run
    IJob._runner[mode](self)
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/site-packages/MDANSE/Framework/Jobs/IJob.py", line 255, in _run_singlecore
    self._status.update()
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/site-packages/MDANSE/Framework/Status.py", line 121, in update
    self.update_status()
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/site-packages/MDANSE_GUI/Subprocess/JobStatusProcess.py", line 106, in update_status
    self._pipe.send(("STEP", temp))
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/multiprocessing/connection.py", line 206, in send
    self._send_bytes(_ForkingPickler.dumps(obj))
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/multiprocessing/connection.py", line 427, in _send_bytes
    self._send(header + buf)
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/multiprocessing/connection.py", line 384, in _send
    n = write(self._handle, buf)
        ^^^^^^^^^^^^^^^^^^^^^^^^
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/site-packages/MDANSE_GUI/Subprocess/Subprocess.py", line 61, in run
    self._job_instance.run(self._job_parameters)
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/site-packages/MDANSE/Framework/Jobs/IJob.py", line 419, in run
    raise JobError(self, tb)
          ^^^^^^^^^^^^^^^^^^
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/site-packages/MDANSE/Framework/Jobs/IJob.py", line 74, in __init__
    job._status.update(force=True)
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/site-packages/MDANSE/Framework/Status.py", line 121, in update
    self.update_status()
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/site-packages/MDANSE_GUI/Subprocess/JobStatusProcess.py", line 106, in update_status
    self._pipe.send(("STEP", temp))
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/multiprocessing/connection.py", line 206, in send
    self._send_bytes(_ForkingPickler.dumps(obj))
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/multiprocessing/connection.py", line 427, in _send_bytes
    self._send(header + buf)
  File "/Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/multiprocessing/connection.py", line 384, in _send
    n = write(self._handle, buf)
        ^^^^^^^^^^^^^^^^^^^^^^^^
BrokenPipeError: [Errno 32] Broken pipe
(mdanse) ➜  ~ /Users/ee23687/miniforge3/envs/mdanse/lib/python3.11/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 32 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

@MBartkowiakSTFC
Copy link
Collaborator

Thank you for the details.

It appears that the ASE read function cannot handle the Direct configuration= 50 lines. If I replace each one of them with just "Direct", the conversion works. Of course, then the time step in the conversion has to be checked, since there will be information in the trajectory about how many frames have been skipped. (I presume that this is what this number is supposed to be.)

I will create a new issue in the ASE issue tracker, assuming that they have not seen this one before. I will inform you once we have a better solution to this problem.

@MBartkowiakSTFC
Copy link
Collaborator

One more comment: what I wrote above was valid for the stable version of ASE 3.23.0 which would normally be installed together with MDANSE.

If I manually install the development version of ASE (at the moment this is ase-3.23.1b1) after installing MDANSE, then the loading starts correctly, but I get a crash and an error like

Python(37279,0x105188580) malloc: Incorrect checksum for freed object 0x291f7b060: probably modified after being freed.
Corrupt value: 0xd0000000ffffffff
Python(37279,0x105188580) malloc: *** set a breakpoint in malloc_error_break to debug
Abort trap: 6

after about 40-80% of the conversion has been completed. Which is more consistent with the error you reported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants