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

Cython crash when referencing objects after free() is called #241

Open
dnicolson opened this issue Nov 24, 2023 · 0 comments
Open

Cython crash when referencing objects after free() is called #241

dnicolson opened this issue Nov 24, 2023 · 0 comments

Comments

@dnicolson
Copy link
Contributor

The following code causes a crash because Python still holds a reference after plist_free has been called. In this instance, the crash comes after the __getitem__ method is called.

import plist

test = plist.loads(b'<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><array><string>one</string><string>two</string></array></plist>')

# Option 1
test[0], test[1] = test[1], test[0]

# Option 2
# item = test[0]
# del test[0]
# item
Assertion failed: (data), function plist_copy_node, file plist.c, line 532.
fish: Job 1, 'PYTHONPATH=/usr/local/lib/pytho…' terminated by signal SIGABRT (Abort)

This is the underlying cause of libimobiledevice/libimobiledevice#929.

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