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

Invalid operation (segfault, sigbus, etc) whenionc.ionc_write is given more arguments than expected. #375

Closed
nirosys opened this issue Oct 18, 2024 · 1 comment
Assignees
Labels

Comments

@nirosys
Copy link
Contributor

nirosys commented Oct 18, 2024

Identified in #372.

Issue

(venv) glitch@147dda5e5395 ~/C/s/i/ion-python> python
Python 3.12.5 (main, Aug  6 2024, 19:08:49) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from amazon.ion import ionc
>>> ionc.ionc_write(None, True, False, False, None)
fish: Job 1, 'python' terminated by signal SIGBUS (Misaligned address error)

Looking at the code, it looks like the issue is the uninitialized PyObject pointers values at the top of ionc_write. In the event that the arguments are wrong, the function jumps down to the fail label, and pointers that are uninitialized get Py_DECREF'd.. which is probably what is generating the random segfault, and bus errors.

@nirosys
Copy link
Contributor Author

nirosys commented Oct 18, 2024

Fixed with #376.

@nirosys nirosys closed this as completed Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant