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

pyparted crashes in disk.destroy() #62

Open
rlaager opened this issue Jul 10, 2019 · 5 comments
Open

pyparted crashes in disk.destroy() #62

rlaager opened this issue Jul 10, 2019 · 5 comments
Assignees

Comments

@rlaager
Copy link

rlaager commented Jul 10, 2019

$ sudo python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import parted
>>> device = parted.getDevice("/path/to/disk.img")
>>> disk = parted.Disk(device)
>>> disk.destroy()
Backtrace has 20 calls on stack:
  20: /lib/x86_64-linux-gnu/libparted.so.2(ped_assert+0x45) [0x7f95f6dde6e5]
  19: /lib/x86_64-linux-gnu/libparted.so.2(ped_disk_commit_to_os+0) [0x7f95f6de1500]
  18: /usr/lib/python3/dist-packages/_ped.cpython-36m-x86_64-linux-gnu.so(_ped_Disk_dealloc+0x12) [0x7f95f7032742]
  17: python3() [0x564dc8]
  16: python3() [0x502fd8]
  15: python3(_PyEval_EvalFrameDefault+0x449) [0x506859]
  14: python3() [0x504c28]
  13: python3() [0x58650d]
  12: python3(PyObject_Call+0x3e) [0x59ebbe]
  11: python3(_PyEval_EvalFrameDefault+0x1807) [0x507c17]
  10: python3() [0x504c28]
  9: python3() [0x502540]
  8: python3() [0x502f3d]
  7: python3(_PyEval_EvalFrameDefault+0x449) [0x506859]
  6: python3() [0x504c28]
  5: python3(PyEval_EvalCode+0x23) [0x506393]
  4: python3() [0x634d52]
  3: python3() [0x4a38c5]
  2: python3(PyRun_InteractiveLoopFlags+0xd4) [0x4a5cd5]
  1: python3(PyRun_AnyFileExFlags+0x53) [0x6387b3]
Aborted

Sometimes it doesn't crash immediately, but calling disk.destroy() twice will guarantee a crash. From what I can tell, disk.destroy() (or at least _ped_Disk_dealloc()) is being called when the Python object is garbage-collected. If it was already called explicitly earlier, then it crashes.

@rlaager
Copy link
Author

rlaager commented Jul 10, 2019

This also seems to happen with device.destroy().

@rlaager
Copy link
Author

rlaager commented Jul 10, 2019

This is with pyparted 3.11.1-1ubuntu2 on Ubuntu 18.04.

@dcantrell dcantrell self-assigned this Sep 7, 2019
@dcantrell
Copy link
Owner

Are you able to recreate this with the latest release, which is 3.11.2?

@rlaager

This comment has been minimized.

@rlaager
Copy link
Author

rlaager commented Sep 17, 2019

This is reproducible with master, specifically 22d2a2d.

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

2 participants