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

Segfaults when printing strings that have python values #342

Closed
ghost opened this issue Jul 25, 2023 · 2 comments
Closed

Segfaults when printing strings that have python values #342

ghost opened this issue Jul 25, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Jul 25, 2023

Describe the bug
I have stumbled on many cases where when there is code that is trying to create a string with interpolated python values in it, a segfault can happen.

I don't have a clear way to reproduce the issue, this a stack trace when it happens, trying to log an exception:

XXX lineno: 85, opcode: 150

[20931] signal (11.1): Segmentation fault
in expression starting at none:0
PyEval_GetGlobals at /usr/local/src/conda/python-3.11.4/Python/ceval.c:7204 [inlined]
PyImport_Import at /usr/local/src/conda/python-3.11.4/Python/import.c:1990
PyImport_Import at /home/fra/.julia/packages/PythonCall/1f5yE/src/cpython/pointers.jl:299 [inlined]
macro expansion at /home/fra/.julia/packages/PythonCall/1f5yE/src/Py.jl:131 [inlined]
pyimport at /home/fra/.julia/packages/PythonCall/1f5yE/src/concrete/import.jl:11
#_showerror#13 at /home/fra/.julia/packages/PythonCall/1f5yE/src/err.jl:126
_showerror at /home/fra/.julia/packages/PythonCall/1f5yE/src/err.jl:113 [inlined]
showerror at /home/fra/.julia/packages/PythonCall/1f5yE/src/err.jl:109 [inlined]

Your system
Please provide detailed information about your system:
Julia Version 1.9.2
Commit e4ee485e909 (2023-07-05 09:39 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)

@ghost ghost added the bug Something isn't working label Jul 25, 2023
@cjdoris
Copy link
Collaborator

cjdoris commented Jul 27, 2023

It's hard to say much without code that can reproduce the error - please try to figure out a minimal way to make this problem occur.

@ghost
Copy link
Author

ghost commented Aug 1, 2023

Some possible causes (not sure if they can actually happen though):

  • String interpolation causes some voodoo macro compilation that puts python references in the compiled code
  • It's not strings, maybe Revise is deleting some methods that trigger python GC and frees python values still used by other compiled methods

I don't think these are solvable or caused by pythoncall

@ghost ghost closed this as completed Aug 1, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant