Kivy: Segmentation fault in Raspberry 3B+

Created on 22 Oct 2018  ·  44Comments  ·  Source: kivy/kivy

Versions

Description

I am trying to execute the demo app_with_kv.py but it shows a segmentation fault error always. I am using the TFT screen from here.

Code and Logs

[INFO   ] [Logger      ] Record log in /home/pi/.kivy/logs/kivy_18-10-22_12.txt
[INFO   ] [Kivy        ] v1.11.0.dev0, git-916b77b, 20181022
[INFO   ] [Python      ] v3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516]
[INFO   ] [Factory     ] 184 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: egl_rpi
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
Segmentation fault
RPi High SDL2 Confirmed

Most helpful comment

Had similar issue with it. For some reason, sdl2 is called instead of the gl for Backend. I do not know if there is a permanent fix for this, but after some time trying to find a fix, the only solution I could come up with is this to add 2 lines on top of your app, before you import Kivy. Should look like this:

import os
os.environ['KIVY_GL_BACKEND'] = 'gl'
import kivy

Hope it will help. Good luck!

P.s. If you want to run your app on Windows you might want to comment os.environ['KIVY_GL_BACKEND'] = 'gl' otherwise it will not run.

All 44 comments

Had similar issue with it. For some reason, sdl2 is called instead of the gl for Backend. I do not know if there is a permanent fix for this, but after some time trying to find a fix, the only solution I could come up with is this to add 2 lines on top of your app, before you import Kivy. Should look like this:

import os
os.environ['KIVY_GL_BACKEND'] = 'gl'
import kivy

Hope it will help. Good luck!

P.s. If you want to run your app on Windows you might want to comment os.environ['KIVY_GL_BACKEND'] = 'gl' otherwise it will not run.

I'm getting the same error on the Zero W. @goadik's suggestion fixed the 3B+ for me, haven't tried on the Zero yet.

I also confirm that @goadik 's solution works! And I also point out that as it is an environment variable problem, you can simply export the variable as follows:

export KIVY_GL_BACKEND=gl

And then execute the script.

SDL2 is used to dynamically lookup the symbol.
It would be nice to have a backtrace in order to understand and fix the issue.
Moving to GL backend for rpi could be implemented depending the platform, but i would rather fix the underlaying issue.

Please use gdb --args python main.py, type r, then when it crash, do bt all. Post the whole things.

Okay. This is the output for gdb --args python main.py:

GNU gdb (Raspbian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python3...(no debugging symbols found)...done.
(gdb) r
Starting program: /usr/bin/python3 main.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[INFO   ] [Logger      ] Record log in /home/pi/.kivy/logs/kivy_18-10-27_0.txt
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO   ] [Kivy        ] v1.11.0.dev0, git-916b77b, 20181022
[INFO   ] [Python      ] v3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516]
[INFO   ] [Factory     ] 184 symbols loaded
[DEBUG  ] [App         ] Loading kv <./main.kv>
[DEBUG  ] [App         ] kv <./main.kv> not found
[INFO   ] [Window      ] Provider: egl_rpi
[New Thread 0x74758470 (LWP 973)]
[New Thread 0x73dff470 (LWP 974)]
[New Thread 0x735ff470 (LWP 975)]
[New Thread 0x72dff470 (LWP 976)]
[DEBUG  ] [Window      ] Actual display size: 800x480
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[DEBUG  ] [GL          ] glActiveTexture is not available
[DEBUG  ] [GL          ] glAttachShader is not available
[DEBUG  ] [GL          ] glBindAttribLocation is not available
[DEBUG  ] [GL          ] glBindBuffer is not available
[DEBUG  ] [GL          ] glBindFramebuffer is not available
[DEBUG  ] [GL          ] glBindRenderbuffer is not available
[DEBUG  ] [GL          ] glBindTexture is not available
[DEBUG  ] [GL          ] glBlendColor is not available
[DEBUG  ] [GL          ] glBlendEquation is not available
[DEBUG  ] [GL          ] glBlendEquationSeparate is not available
[DEBUG  ] [GL          ] glBlendFunc is not available
[DEBUG  ] [GL          ] glBlendFuncSeparate is not available
[DEBUG  ] [GL          ] glBufferData is not available
[DEBUG  ] [GL          ] glBufferSubData is not available
[DEBUG  ] [GL          ] glCheckFramebufferStatus is not available
[DEBUG  ] [GL          ] glClear is not available
[DEBUG  ] [GL          ] glClearColor is not available
[DEBUG  ] [GL          ] glClearStencil is not available
[DEBUG  ] [GL          ] glColorMask is not available
[DEBUG  ] [GL          ] glCompileShader is not available
[DEBUG  ] [GL          ] glCompressedTexImage2D is not available
[DEBUG  ] [GL          ] glCompressedTexSubImage2D is not available
[DEBUG  ] [GL          ] glCopyTexImage2D is not available
[DEBUG  ] [GL          ] glCopyTexSubImage2D is not available
[DEBUG  ] [GL          ] glCreateProgram is not available
[DEBUG  ] [GL          ] glCreateShader is not available
[DEBUG  ] [GL          ] glCullFace is not available
[DEBUG  ] [GL          ] glDeleteBuffers is not available
[DEBUG  ] [GL          ] glDeleteFramebuffers is not available
[DEBUG  ] [GL          ] glDeleteProgram is not available
[DEBUG  ] [GL          ] glDeleteRenderbuffers is not available
[DEBUG  ] [GL          ] glDeleteShader is not available
[DEBUG  ] [GL          ] glDeleteTextures is not available
[DEBUG  ] [GL          ] glDepthFunc is not available
[DEBUG  ] [GL          ] glDepthMask is not available
[DEBUG  ] [GL          ] glDetachShader is not available
[DEBUG  ] [GL          ] glDisable is not available
[DEBUG  ] [GL          ] glDisableVertexAttribArray is not available
[DEBUG  ] [GL          ] glDrawArrays is not available
[DEBUG  ] [GL          ] glDrawElements is not available
[DEBUG  ] [GL          ] glEnable is not available
[DEBUG  ] [GL          ] glEnableVertexAttribArray is not available
[DEBUG  ] [GL          ] glFinish is not available
[DEBUG  ] [GL          ] glFlush is not available
[DEBUG  ] [GL          ] glFramebufferRenderbuffer is not available
[DEBUG  ] [GL          ] glFramebufferTexture2D is not available
[DEBUG  ] [GL          ] glFrontFace is not available
[DEBUG  ] [GL          ] glGenBuffers is not available
[DEBUG  ] [GL          ] glGenerateMipmap is not available
[DEBUG  ] [GL          ] glGenFramebuffers is not available
[DEBUG  ] [GL          ] glGenRenderbuffers is not available
[DEBUG  ] [GL          ] glGenTextures is not available
[DEBUG  ] [GL          ] glGetActiveAttrib is not available
[DEBUG  ] [GL          ] glGetActiveUniform is not available
[DEBUG  ] [GL          ] glGetAttachedShaders is not available
[DEBUG  ] [GL          ] glGetAttribLocation is not available
[DEBUG  ] [GL          ] glGetBooleanv is not available
[DEBUG  ] [GL          ] glGetBufferParameteriv is not available
[DEBUG  ] [GL          ] glGetError is not available
[DEBUG  ] [GL          ] glGetFloatv is not available
[DEBUG  ] [GL          ] glGetFramebufferAttachmentParameteriv is not available
[DEBUG  ] [GL          ] glGetIntegerv is not available
[DEBUG  ] [GL          ] glGetProgramInfoLog is not available
[DEBUG  ] [GL          ] glGetProgramiv is not available
[DEBUG  ] [GL          ] glGetRenderbufferParameteriv is not available
[DEBUG  ] [GL          ] glGetShaderInfoLog is not available
[DEBUG  ] [GL          ] glGetShaderiv is not available
[DEBUG  ] [GL          ] glGetShaderSource is not available
[DEBUG  ] [GL          ] glGetString is not available
[DEBUG  ] [GL          ] glGetTexParameterfv is not available
[DEBUG  ] [GL          ] glGetTexParameteriv is not available
[DEBUG  ] [GL          ] glGetUniformfv is not available
[DEBUG  ] [GL          ] glGetUniformiv is not available
[DEBUG  ] [GL          ] glGetUniformLocation is not available
[DEBUG  ] [GL          ] glGetVertexAttribfv is not available
[DEBUG  ] [GL          ] glGetVertexAttribiv is not available
[DEBUG  ] [GL          ] glHint is not available
[DEBUG  ] [GL          ] glIsBuffer is not available
[DEBUG  ] [GL          ] glIsEnabled is not available
[DEBUG  ] [GL          ] glIsFramebuffer is not available
[DEBUG  ] [GL          ] glIsProgram is not available
[DEBUG  ] [GL          ] glIsRenderbuffer is not available
[DEBUG  ] [GL          ] glIsShader is not available
[DEBUG  ] [GL          ] glIsTexture is not available
[DEBUG  ] [GL          ] glLineWidth is not available
[DEBUG  ] [GL          ] glLinkProgram is not available
[DEBUG  ] [GL          ] glPixelStorei is not available
[DEBUG  ] [GL          ] glPolygonOffset is not available
[DEBUG  ] [GL          ] glReadPixels is not available
[DEBUG  ] [GL          ] glRenderbufferStorage is not available
[DEBUG  ] [GL          ] glSampleCoverage is not available
[DEBUG  ] [GL          ] glScissor is not available
[DEBUG  ] [GL          ] glShaderBinary is not available
[DEBUG  ] [GL          ] glShaderSource is not available
[DEBUG  ] [GL          ] glStencilFunc is not available
[DEBUG  ] [GL          ] glStencilFuncSeparate is not available
[DEBUG  ] [GL          ] glStencilMask is not available
[DEBUG  ] [GL          ] glStencilMaskSeparate is not available
[DEBUG  ] [GL          ] glStencilOp is not available
[DEBUG  ] [GL          ] glStencilOpSeparate is not available
[DEBUG  ] [GL          ] glTexImage2D is not available
[DEBUG  ] [GL          ] glTexParameterf is not available
[DEBUG  ] [GL          ] glTexParameteri is not available
[DEBUG  ] [GL          ] glTexSubImage2D is not available
[DEBUG  ] [GL          ] glUniform1f is not available
[DEBUG  ] [GL          ] glUniform1fv is not available
[DEBUG  ] [GL          ] glUniform1i is not available
[DEBUG  ] [GL          ] glUniform1iv is not available
[DEBUG  ] [GL          ] glUniform2f is not available
[DEBUG  ] [GL          ] glUniform2fv is not available
[DEBUG  ] [GL          ] glUniform2i is not available
[DEBUG  ] [GL          ] glUniform2iv is not available
[DEBUG  ] [GL          ] glUniform3f is not available
[DEBUG  ] [GL          ] glUniform3fv is not available
[DEBUG  ] [GL          ] glUniform3i is not available
[DEBUG  ] [GL          ] glUniform3iv is not available
[DEBUG  ] [GL          ] glUniform4f is not available
[DEBUG  ] [GL          ] glUniform4fv is not available
[DEBUG  ] [GL          ] glUniform4i is not available
[DEBUG  ] [GL          ] glUniform4iv is not available
[DEBUG  ] [GL          ] glUniformMatrix4fv is not available
[DEBUG  ] [GL          ] glUseProgram is not available
[DEBUG  ] [GL          ] glValidateProgram is not available
[DEBUG  ] [GL          ] glVertexAttrib1f is not available
[DEBUG  ] [GL          ] glVertexAttrib2f is not available
[DEBUG  ] [GL          ] glVertexAttrib3f is not available
[DEBUG  ] [GL          ] glVertexAttrib4f is not available
[DEBUG  ] [GL          ] glVertexAttribPointer is not available
[DEBUG  ] [GL          ] glViewport is not available
[INFO   ] [GL          ] Backend used <sdl2>

Thread 1 "python3" received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()

Also, as bt all has thrown a "No symbol "all" in current context." message, I have the output of thread apply all bt, which is the following:

Thread 5 (Thread 0x72dff470 (LWP 976)):
#0  0x76f88014 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, 
    expected=1, futex_word=0x748885ec <cecservice_notify_available_event+24>)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x748885ec <cecservice_notify_available_event+24>, 
    abstime=0x0) at sem_waitcommon.c:115
#2  0x76f88158 in __new_sem_wait_slow (
    sem=0x748885ec <cecservice_notify_available_event+24>, abstime=0x0)
    at sem_waitcommon.c:282
#3  0x7486ec44 in cecservice_notify_func () from /opt/vc/lib/libbcm_host.so
#4  0x747d7cc4 in vcos_thread_entry (arg=0x74888600 <cecservice_notify_task>)
    at /home/dc4/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#5  0x76f7efc4 in start_thread (arg=0x72dff470) at pthread_create.c:335
#6  0x76e0cbc8 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76
   from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 4 (Thread 0x735ff470 (LWP 975)):
#0  0x76f88014 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, 
    expected=1, futex_word=0x74887864 <tvservice_notify_available_event+24>)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x74887864 <tvservice_notify_available_event+24>, 
    abstime=0x0) at sem_waitcommon.c:115
#2  0x76f88158 in __new_sem_wait_slow (
    sem=0x74887864 <tvservice_notify_available_event+24>, abstime=0x0)
---Type <return> to continue, or q <return> to quit---
    at sem_waitcommon.c:282
#3  0x7486e084 in tvservice_notify_func () from /opt/vc/lib/libbcm_host.so
#4  0x747d7cc4 in vcos_thread_entry (arg=0x74887878 <tvservice_notify_task>)
    at /home/dc4/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#5  0x76f7efc4 in start_thread (arg=0x735ff470) at pthread_create.c:335
#6  0x76e0cbc8 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76
   from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 3 (Thread 0x73dff470 (LWP 974)):
#0  0x76f88014 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, 
    expected=1, futex_word=0x748886e8 <dispmanx_notify_available_event+24>)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x748886e8 <dispmanx_notify_available_event+24>, 
    abstime=0x0) at sem_waitcommon.c:115
#2  0x76f88158 in __new_sem_wait_slow (
    sem=0x748886e8 <dispmanx_notify_available_event+24>, abstime=0x0)
    at sem_waitcommon.c:282
#3  0x74872150 in dispmanx_notify_func () from /opt/vc/lib/libbcm_host.so
#4  0x747d7cc4 in vcos_thread_entry (arg=0x74889428 <dispmanx_notify_task>)
    at /home/dc4/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#5  0x76f7efc4 in start_thread (arg=0x73dff470) at pthread_create.c:335
#6  0x76e0cbc8 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76
   from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
---Type <return> to continue, or q <return> to quit---

Thread 2 (Thread 0x74758470 (LWP 973)):
#0  0x76e0580c in ioctl () at ../sysdeps/unix/syscall-template.S:84
#1  0x747f1010 in completion_thread () from /opt/vc/lib/libvchiq_arm.so
#2  0x747d7cc4 in vcos_thread_entry (arg=0x74804318 <vchiq_instance+16>)
    at /home/dc4/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#3  0x76f7efc4 in start_thread (arg=0x74758470) at pthread_create.c:335
#4  0x76e0cbc8 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76
   from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0x76ff7010 (LWP 967)):
#0  0x00000000 in ?? ()

#1  0x74bb28d0 in __pyx_pf_4kivy_8graphics_6opengl_138glGetString (
    __pyx_self=<optimized out>, __pyx_v_name=<optimized out>)
    at /tmp/pip-bp1kpwjd-build/kivy/graphics/opengl.c:12436
#2  __pyx_pw_4kivy_8graphics_6opengl_139glGetString (__pyx_self=<optimized out>, 
    __pyx_arg_name=<optimized out>)
    at /tmp/pip-bp1kpwjd-build/kivy/graphics/opengl.c:12415
#3  0x000b1df8 in PyEval_EvalFrameEx ()
#4  0x000b1a7c in PyEval_EvalFrameEx ()
#5  0x000b1a7c in PyEval_EvalFrameEx ()
#6  0x001985c8 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

OK, look like SDL_GL_GetProcAddress can't find anything :( I understand now.
Our method to detect and load opengl is tied to the Window provider used.
But in this case, egl_rpi is used, not SDL2, therefore the SDL2 function will not work.

It requires a fix, thanks for reporting!

Not sure if it is relevant to add here but I think it got something to do with the new version of Raspbian. I tried the older one (I have an image) and it worked like a charm.

The problem with segmentation fault on app start can be fixed with an environment variable, but also, it crashes with the same segmentation fault every time I load the graph with lots of data on it to show.

The problem with GDB is that if I try to use it like that gdb --args python main.py and replicate the crash, RPI just freezes and the only thing left to do at this point is just to restart it. When I check the logs they are empty.

Wanted to add it here.

I had the same issue and like @goadik said it could be a bug from the new raspbian version because on my older image (Raspberry3, kivy v1.11.0.dev0, python v3.4.2) the kivy app is running fine. My problem is described here: https://stackoverflow.com/questions/53122908/kivy-opengl-segmentation-fault-on-raspberry

@krrrambambuli

on my older image (Raspberry3, kivy v1.11.0.dev0, python v3.4.2) the kivy app is running fine

So why don't you use the older image?

RPi Dev's are notorious for pushing out new "updates" that are breaking all sorts of things. I've had so much unpleasant experience with these, that I have completely disabled all OS related updates coming from RPi org.

@E3V3A

So why don't you use the older image?

Because I had a RPI wich was already configured with the latest raspbian update. And I was just wondering why kivy is not running although I was doing exactly the same things like before. Now I changed to the old image and it's running fine!

From now I will take care with hasty updates ;)

Perhaps totally unrelated, but unless I'm wrong: Kivy depends on SDL2 and SDL2 depend on cffi and/or Cairo, and cffi is hard to build independent of architecture. But I ran across the following pip package, perhaps try that?

# pip3 search cairocffi 
cairotft (0.1.2)   - UI library for small tft screens using cairocffi

@E3V3A
I already switched to the old image. Maybe it's good to know for the future

Can I ask you what image are you using and where I can find it? I'm using Rpi 3 B+ and kivy 1.11.0.dev0, what image should I use?

@E3V3A
I already switched to the old image. Maybe it's good to know for the future

I am using raspbian jessie, last time updated on 11-6-18 without upgrades. Rpi3, Kivy v1.10.1 and Python 3.4.2
My Log:

[INFO ] Logger: Record log in /home/pi/.kivy/logs/kivy_18-11-14_11.txt
[INFO ] Kivy: v1.10.1
[INFO ] Python: v3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1]
[INFO ] KivyMD: KivyMD version: 0.1.2
[INFO ] Factory: 194 symbols loaded
[INFO ] Image: Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO ] Window: Provider: egl_rpi
[INFO ] GL: Using the "OpenGL ES 2" graphics system
[INFO ] GL: Backend used
[INFO ] GL: OpenGL version
[INFO ] GL: OpenGL vendor
[INFO ] GL: OpenGL renderer
[INFO ] GL: OpenGL parsed version: 2, 0
[INFO ] GL: Shading version
[INFO ] GL: Texture max size <2048>
[INFO ] GL: Texture max units <8>
[INFO ] Window: virtual keyboard allowed, multiuser mode, not docked
[INFO ] Text: Provider: sdl2
[INFO ] GL: NPOT texture support is available
[INFO ] Clipboard: Provider: xclip
[INFO ] CutBuffer: cut buffer support enabled
[INFO ] ProbeSysfs: device match: /dev/input/event0
...

Thanks, had the same problem.
export KIVY_GL_BACKEND=gl
fixed it.

have exactly same problem in raspberry pi 3b+ ..is it possible to install kivy on Ubuntu core or any other raspberry pi 3b+ supported OS?

also which Raspbian image should i use in raspberry pi 3b+ to get kivy working

this issue is not fixed
usingimport os
os.environ['KIVY_GL_BACKEND'] = 'gl'
import kivy
is only a temporary solution

It hasn't been mentioned yet in this thread but it might be pertinent whether someone has the Lite or PIXEL version of Raspbian.

screen shot 2018-12-17 at 8 34 11 am

sdl2 includes an X windows dependency and Raspbian Lite obviously doesn't include this.

I can confirm that sneaking...

import os
os.environ['KIVY_GL_BACKEND'] = 'gl'

...at the top of my Python script makes the "Hello, Button" app work. I'm on the Stretch Lite version.

What version of raspbian should i use to not have this issue ?
I tried to donwngrade my os to Raspbian Jessie 8.0 but i've got the same seg fault...

What version of raspbian should i use to not have this issue ?
I tried to donwngrade my os to Raspbian Jessie 8.0 but i've got the same seg fault...

Same issue here with a raspberry pi 3b+:

Starting program: /usr/bin/python3 /home/pi/sorbito/main.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_19-02-13_3.txt
[INFO ] [Kivy ] v1.11.0.dev0, git-233cdd1, 20190212
[INFO ] [Python ] v3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516]
[INFO ] [Factory ] 184 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_pil, img_gif (img_sdl2, img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [Window ] Provider: egl_rpi
[New Thread 0x747ff470 (LWP 2420)]
[New Thread 0x73dff470 (LWP 2421)]
[New Thread 0x735ff470 (LWP 2422)]
[New Thread 0x72dff470 (LWP 2423)]
[INFO ] [GL ] Using the "OpenGL ES 2" graphics system
[INFO ] [GL ] Backend used

Thread 1 "python3" received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()

Log:
[INFO ] Logger: Record log in /home/pi/.kivy/logs/kivy_19-02-13_3.txt
[INFO ] Kivy: v1.11.0.dev0, git-233cdd1, 20190212
[INFO ] Python: v3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516]
[INFO ] Factory: 184 symbols loaded
[INFO ] Image: Providers: img_tex, img_dds, img_pil, img_gif (img_sdl2, img_ffpyplayer ignored)
[INFO ] Text: Provider: sdl2
[INFO ] Window: Provider: egl_rpi
[INFO ] GL: Using the "OpenGL ES 2" graphics system
[INFO ] GL: Backend used

Still no solution to this?

os.environ['KIVY_GL_BACKEND'] = 'gl'doesn't help at all with v1.11.0.dev0, git-9ebad2d, 20190516

Getting: [CRITICAL] [App ] Unable to get a Window, abort

And with older version like 1.10.1 I don't get any transparent PNG support...all transparent PNGs are drawn with a black background...same code works fine on Debian 9 though ...

So will RPi Stretch-Lite never be supported again?

Back-read my last comment on this thread. It works for me on Raspbian Stretch Lite (Nov 2018) and my 1.10.1 _does_ support the hundred or so PNG graphics I'm using with transparent backgrounds.

To confirm a build using the latest stable (1.11.0) in a fully up to date stretch-lite installation on any RPI causes this segmentation fault. Must build stable-1.10.1 to run on an RPI. I am not sure why you would release a stable that has had this problem on a major platform for over 6 months.

I am also experiencing this problem on raspberry 3 B+, on raspbian lite

A good workaround right now is to make sure Pillow is installed and then run kivy with KIVY_WINDOW=sdl2. No need to set the gl backend in this case as sdl2 will be used. If you want to use the egl_rpi window provider, then the gl backend needs to be set.

This definitely qualifies as a regression bug. Installing on RPI 3B+ as

pip install git+https://github.com/kivy/[email protected]

renders in Segmentation fault whereas

pip install git+https://github.com/kivy/[email protected]

works like a charm.

I'm planning to fix it in the post release.

On Wed, Jun 12, 2019, 1:11 PM RafalSkolasinski notifications@github.com
wrote:

This definitely qualifies as regression bug. Installing on RPI 3B+ as

pip install git+https://github.com/kivy/[email protected]

renders in Segmentation fault whereas

pip install git+https://github.com/kivy/[email protected]

works like a charm.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/kivy/kivy/issues/6007?email_source=notifications&email_token=AAMRN7T3A2SZJ5OE4QQ63NDP2EU2XA5CNFSM4F6QJQM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXREWFA#issuecomment-501369620,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAMRN7XWDPCYLGW5QREDN3DP2EU2XANCNFSM4F6QJQMQ
.

Can you test https://github.com/kivy/kivy/pull/6384 ? This should fix it and also allow you to use any of the three backends when selected manually (egl_rpi, sdl2, and x11 if compiled).

I can test it later today or tomorrow.

On Thu, 13 Jun 2019, 22:52 matham, notifications@github.com wrote:

Can you test #6384 https://github.com/kivy/kivy/pull/6384 ? This should
fix it and also allow you to use any of the three backends when selected
manually (egl_rpi, sdl2, and x11 if compiled).


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/kivy/kivy/issues/6007?email_source=notifications&email_token=ACTL75LVT74IBQJQ4W5QARTP2K6RXA5CNFSM4F6QJQM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXVEJXA#issuecomment-501892316,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACTL75OGYIBPXEVW33B57KLP2K6RXANCNFSM4F6QJQMQ
.

6384 Fixes it for me using egl_rpi on raspbian-lite, no exports needed.

[INFO ] Logger: Record log in /home/pi/.kivy/logs/kivy_19-06-14_1.txt
[INFO ] Image: Providers: img_tex, img_dds, img_pil, img_gif (img_sdl2, img_ffpyplayer ignored)
[INFO ] Kivy: v2.0.0.dev0, git-dccba95, 20190614
[INFO ] Kivy: Installed at "/home/pi/Stuff/kivy-fix/kivy/__init__.py"
[INFO ] Python: v3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516]
[INFO ] Python: Interpreter at "/usr/bin/python3"
[INFO ] Factory: 184 symbols loaded
[INFO ] Text: Provider: sdl2
[INFO ] Window: Provider: egl_rpi
[INFO ] GL: Using the "OpenGL ES 2" graphics system
[INFO ] GL: Backend used
[INFO ] GL: OpenGL version
[INFO ] GL: OpenGL vendor
[INFO ] GL: OpenGL renderer
[INFO ] GL: OpenGL parsed version: 2, 0
[INFO ] GL: Shading v

Yes, it works.
Initially I had a problem and got some errors

[CRITICAL] [Window      ] Unable to find any valuable Window provider.

but after adding pillow it started to work.
I guess pillow is new dependencies added in 1.11?

edit:
Is this fix gonna be released in 1.11.1? I see

[INFO ] Kivy: v2.0.0.dev0, git-dccba95, 20190614

in logs.

This will be cherry-picked into a post release of 1.11.0.post0 (https://github.com/kivy/kivy/pull/6357). This way people who target 1.11.0 when installing will automatically get the fixed version (assuming pip does the right thing here and installs 1.11.0.post0 when 1.11.0 is requested).

Normally, I would go to 1.11.1, but this doesn't work very well with our workflow, given our jump to 2.0.0 and the next release breaking stuff such as python 2 support. This release should happen very soon.

Regarding pillow, I'm not sure what's up. sdl2_image should have worked (I think it worked in the past?), but for some reason it's unable to load the image. I guess it'd need to be troubleshooted further (PRs welcome). In any case, I updated the docs to list pillow as dependency.

I'd go for 1.11.1 as then it is clear that a bug fix is included. Let's
hope that pip we'll be doing the right thing.

On Fri, 14 Jun 2019, 17:11 matham, notifications@github.com wrote:

This will be cherry-picked into a post release of 1.11.0.post0 (#6357
https://github.com/kivy/kivy/pull/6357). This way people who target
1.11.0 when installing will automatically get the fixed version (assuming
pip does the right thing here and installs 1.11.0.post0 when 1.11.0 is
requested).

Normally, I would go to 1.11.1, but this doesn't work very well with our
workflow, given our jump to 2.0.0 and the next release breaking stuff such
as python 2 support. This release should happen very soon.

Regarding pillow, I'm not sure what's up. sdl2_image should have worked
(I think it worked in the past?), but for some reason it's unable to load
the image. I guess it'd need to be troubleshooted further (PRs welcome). In
any case, I updated the docs to list pillow as dependency.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/kivy/kivy/issues/6007?email_source=notifications&email_token=ACTL75LMHH3Q2FDKYW4HTUTP2O7LDA5CNFSM4F6QJQM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXXH4HQ#issuecomment-502169118,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACTL75NBY6O6KBPR4QT3LPDP2O7LDANCNFSM4F6QJQMQ
.

If you ask for 1.11.0, pip will likely not install 1.11.1, but 1.11.0 exactly. I'm not sure what it'd do if we ask for 1.11,

Oh, I meant that it will install patched ".post0" when we ask for "1.11.0" :)

On Fri, 14 Jun 2019, 19:29 matham, notifications@github.com wrote:

If you ask for 1.11.0, pip will likely not install 1.11.1, but 1.11.0
exactly. I'm not sure what it'd do if we ask for 1.11,


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/kivy/kivy/issues/6007?email_source=notifications&email_token=ACTL75JZDOPPHORTC3LEVZTP2PPPNA5CNFSM4F6QJQM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXXTMNI#issuecomment-502216245,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACTL75KC3BTJGUQTTBMAHLDP2PPPNANCNFSM4F6QJQMQ
.

as Discussed above I added export KIVY_GL_BACKEND=gl to path and Now I am getting another issue that says...
create_window() takes 1 positional argument but 2 were given

please help me out of this error.
when I run my code in raspberry pi

sudo python3 main.py
[WARNING] [Config ] Older configuration version detected (0 instead of 14)
[WARNING] [Config ] Upgrading configuration in progress.
[INFO ] [Logger ] Record log in /root/.kivy/logs/kivy_19-06-17_0.txt
[INFO ] [Kivy ] v1.9.1
[INFO ] [Python ] v3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516]
[INFO ] [Factory ] 179 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [OSC ] using for socket
[INFO ] [Window ] Provider: sdl2(['window_egl_rpi'] ignored)
error: XDG_RUNTIME_DIR not set in the environment.
[CRITICAL] [Window ] Unable to find any valuable Window provider at all!
egl_rpi - ImportError: cannot import name 'bcm'
File "/usr/lib/python3/dist-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "/usr/lib/python3/dist-packages/kivy/core/window/window_egl_rpi.py", line 12, in
from kivy.lib.vidcore_lite import bcm, egl

sdl2 - RuntimeError: b'No available video device'
File "/usr/lib/python3/dist-packages/kivy/core/__init__.py", line 67, in core_select_lib
cls = cls()
File "/usr/lib/python3/dist-packages/kivy/core/window/window_sdl2.py", line 138, in __init__
super(WindowSDL, self).__init__()
File "/usr/lib/python3/dist-packages/kivy/core/window/__init__.py", line 722, in __init__
self.create_window()
File "/usr/lib/python3/dist-packages/kivy/core/window/window_sdl2.py", line 237, in create_window
self.fullscreen, resizable, state)
File "kivy/core/window/_window_sdl2.pyx", line 80, in kivy.core.window._window_sdl2._WindowSDL2Storage.setup_window (kivy/core/window/_window_sdl2.c:1893)
File "kivy/core/window/_window_sdl2.pyx", line 55, in kivy.core.window._window_sdl2._WindowSDL2Storage.die (kivy/core/window/_window_sdl2.c:1479)

x11 - ImportError: No module named 'kivy.core.window.window_x11'
File "/usr/lib/python3/dist-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)

[CRITICAL] [App ] Unable to get a Window, abort.
Exception ignored in: 'kivy.properties.dpi2px'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/kivy/utils.py", line 513, in __get__
retval = self.func(inst)
File "/usr/lib/python3/dist-packages/kivy/metrics.py", line 175, in dpi
EventLoop.ensure_window()
File "/usr/lib/python3/dist-packages/kivy/base.py", line 126, in ensure_window
sys.exit(1)
SystemExit: 1
[CRITICAL] [App ] Unable to get a Window, abort.

Anyone, please let me know what should I do.

@jayeshsingh9767 have you tried with master or the last release? This has been fixed in master but we haven't made a new release yet that includes the fix.

@harshp1301 this error is unrelated to this issue. This also seems like a problem with your system and not kivy. For support please ask on discord.

@matham Thanks, But the problem is fixed when I removed Window.size() from my code.
I think we cannot manage kivy app Window in Raspberry pi.... But could someone explain me why?
Note : Wimdow.size() was running perfectly on Ubuntu...

This is unrelated to this issue, so maybe open new issue for this (if one doesn't exist)? But maybe that's not possible with the egl_rpi window backend. I'd try with the sdl2 backend or x11 window backend (I think both are resizable even on the pi).

I had simliar problems with the actual raspbian lite os (2020-05-27) --> after first loading I got segmentation fault. Than I tried the switching to 'gl'. After that I gt a whichte screen and a black cursor without any contesnts from my GUI.
If I swiched back to a previusly raspbian lite it works with Kivy 1.11.1. Actually I do not know what exactly is the difference. Seems that there are some updates which cause this issue (libs, firmware...?). I luckily backed up the old sd card and restore it for my actually used GUI.
I decided to use Kivy because of the reason that I do not need to install X11. My GUI is running in the console...

@AndreasPantle I'm running into the same experience with 1.11.1 and Raspberry PI OS (renamed Raspbian). Going to give 1.10.1 a whirl and see what happens. kivy is a dependency for the Mission Pinball media controller, so may not have the option to flip the version.

Was this page helpful?
0 / 5 - 0 ratings