-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Segmentation fault in opengl_utils.pyx #8406
Comments
This happens only when using |
texture = CoreImage(data, ext="png", filename="image.png").texture # crashes If I create the texture from a .png file directly and not from data, it works. |
Texture class use OpenGL functions. The OpenGL context is not created in your code, which leads to a segmentation fault. |
Thank you for your analysis. Your suggestion indeed fixed the issue ( no segmentation fault ).
|
I have now actually found on the texture page documentation the following:
from kivy.core.window import Window
This fixed the crash, seems to be a known limitation. |
Software Versions
Describe the bug
Program received signal SIGSEGV, Segmentation fault.
import io
from kivy.core.image import Image as CoreImage
data = io.BytesIO(open("image.png", "rb").read())
texture = CoreImage(data, ext="png", filename="image.png").texture
Crashes !ONLY! when accessing ".texture".
Crash DUMP:
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff5ce317a in __pyx_f_4kivy_8graphics_12opengl_utils_gl_get_extensions (__pyx_skip_dispatch=__pyx_skip_dispatch@entry=0) at /project/kivy/graphics/opengl_utils.c:3090
#2 0x00007ffff5ce47e4 in __pyx_f_4kivy_8graphics_12opengl_utils_gl_has_extension (__pyx_v_name=0x7ffff6857f00, __pyx_skip_dispatch=__pyx_skip_dispatch@entry=0) at /project/kivy/graphics/opengl_utils.c:3441
#3 0x00007ffff5ce8008 in __pyx_f_4kivy_8graphics_12opengl_utils_gl_has_capability (__pyx_v_cap=2, __pyx_skip_dispatch=) at /project/kivy/graphics/opengl_utils.c:3945
#4 0x00007ffff5e61db4 in __pyx_pf_4kivy_8graphics_7texture_2texture_create_from_data (__pyx_self=, __pyx_v_mipmap=, __pyx_v_im=) at /project/kivy/graphics/texture.c:10360
#5 __pyx_pw_4kivy_8graphics_7texture_3texture_create_from_data (__pyx_self=, __pyx_args=, __pyx_kwds=) at /project/kivy/graphics/texture.c:10245
#6 0x0000555555758c47 in cfunction_call (func=0x7ffff6821710, args=, kwargs=) at Objects/methodobject.c:542
The issue tracker is a tool to address bugs only (search known bugs: https://git.io/vM1iE).
Please use the #support Discord channel at https://chat.kivy.org/ or Stack Overflow for
support questions, more information at https://git.io/vM1yQ.
Expected behavior
No crash
To Reproduce
import io
from kivy.core.image import Image as CoreImage
data = io.BytesIO(open("image.png", "rb").read())
texture = CoreImage(data, ext="png", filename="image.png").texture
Code and Logs and screenshots
Additional context
Crashes !ONLY! when accessing ".texture".
Used latest version of SDL as well as older 2.26.5
The text was updated successfully, but these errors were encountered: