Closed JC3 closed 2 days ago
Looking at this...
[INFO ] Image: Providers: img_tex, img_imageio, img_dds, img_sdl2 (img_pil, img_ffpyplayer ignored)
And this...
1 ImageIO 0x1aa744d80 IIOReadPlugin::callInitialize() + 136
I don't entirely know what I'm talking about so I'm not sure if this is a valid question, but is there a way to remove the img_imageio
image provider from consideration when running an application (perhaps also enabling img_pil
)?
Also, I get the same bus error with kivy 2.1.0 and Python 3.10.14.
Looking at this...
[INFO ] Image: Providers: img_tex, img_imageio, img_dds, img_sdl2 (img_pil, img_ffpyplayer ignored)
And this...
1 ImageIO 0x1aa744d80 IIOReadPlugin::callInitialize() + 136
I don't entirely know what I'm talking about so I'm not sure if this is a valid question, but is there a way to remove the
img_imageio
image provider from consideration when running an application (perhaps also enablingimg_pil
)?
os.environ["KIVY_IMAGE"] = "sdl2"
will use sdl2
image provider only. (you need to set it before any kivy
import)
Please keep us posted! (I'm on an Apple Silicon M1 Pro with macOS Sonoma and can't reproduce the same issue).
Additional test:
What happens if you use https://www.python.org/downloads/ installers, instead of using the homebrew
provided Python?
Testing with different image providers yielded some new information; see below.
What happens if you use https://www.python.org/downloads/ installers, instead of using the
homebrew
provided Python?
Same issue with all of the ones I tried, with Kivy 2.1.0 and 2.3.0:
os.environ["KIVY_IMAGE"] = "sdl2"
will usesdl2
image provider only. (you need to set it before anykivy
import)
Thanks. I tried with img_sdl2 and also img_pil. No success, but slightly different results with each. TLDR is that img_pil let the application make it slightly farther into the startup process before crashing.
With the default img_imageio
etc. (original crash), for reference, the Kivy log was:
[INFO ] [Logger ] Record log in /Users/cipriani_pro2023/.kivy/logs/kivy_24-03-29_14.txt
[INFO ] [Kivy ] v2.1.0
[INFO ] [Kivy ] Installed at "/Users/cipriani_pro2023/pyenv-factoryflash/lib/python3.10/site-packages/kivy/__init__.py"
[INFO ] [Python ] v3.10.14 (main, Mar 19 2024, 21:46:16) [Clang 15.0.0 (clang-1500.1.0.2.5)]
[INFO ] [Python ] Interpreter at "/Users/cipriani_pro2023/pyenv-factoryflash/bin/python3.10"
[INFO ] [Logger ] Purge log fired. Processing...
[INFO ] [Logger ] Purge finished!
[INFO ] [Factory ] 189 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL ES 2" graphics system
[INFO ] [GL ] Backend used <sdl2>
[INFO ] [GL ] OpenGL version <b'2.1 Metal - 83.1'>
[INFO ] [GL ] OpenGL vendor <b'Apple'>
[INFO ] [GL ] OpenGL renderer <b'Apple M2 Pro'>
[INFO ] [GL ] OpenGL parsed version: 2, 1
[INFO ] [GL ] Shading version <b'1.20'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <16>
And the top of the crash log was:
0 ??? 0xbad4007 ???
1 ImageIO 0x190d0cd80 IIOReadPlugin::callInitialize() + 136
2 ImageIO 0x190d0ca94 IIO_Reader::initImageAtOffset(CGImagePlugin*, unsigned long, unsigned long, unsigned long) + 124
3 ImageIO 0x190d0a328 IIOImageSource::makeImagePlus(unsigned long, IIODictionary*) + 808
4 ImageIO 0x190d16618 IIOImageSource::createImageAtIndex(unsigned long, IIODictionary*) + 80
5 ImageIO 0x190d164e8 CGImageSourceCreateImageAtIndex + 276
6 img_imageio.cpython-310-darwin.so 0x103cf0f1c __pyx_pw_4kivy_4core_5image_11img_imageio_1load_image_data + 660
With img_sdl2
, looks like it ultimately uses ImageIO, so same Kivy log as above, and the top of the crash log has a different trace but is basically the same:
0 ??? 0xbad4007 ???
1 ImageIO 0x190d0cd80 IIOReadPlugin::callInitialize() + 136
2 ImageIO 0x190d0ca94 IIO_Reader::initImageAtOffset(CGImagePlugin*, unsigned long, unsigned long, unsigned long) + 124
3 ImageIO 0x190d0a328 IIOImageSource::makeImagePlus(unsigned long, IIODictionary*) + 808
4 ImageIO 0x190d16618 IIOImageSource::createImageAtIndex(unsigned long, IIODictionary*) + 80
5 ImageIO 0x190d164e8 CGImageSourceCreateImageAtIndex + 276
6 SDL2_image 0x105960830 0x10595c000 + 18480
7 SDL2_image 0x10596069c IMG_Load + 120
8 _img_sdl2.cpython-310-darwin.so 0x1056416c4 __pyx_pw_4kivy_4core_5image_9_img_sdl2_5load_from_filename + 288
However, with img_pil, the application made it slightly farther into the initialization process, and the Kivy log was:
[INFO ] [Logger ] Record log in /Users/cipriani_pro2023/.kivy/logs/kivy_24-03-29_16.txt
[INFO ] [Kivy ] v2.1.0
[INFO ] [Kivy ] Installed at "/Users/cipriani_pro2023/pyenv-factoryflash/lib/python3.10/site-packages/kivy/__init__.py"
[INFO ] [Python ] v3.10.14 (main, Mar 19 2024, 21:46:16) [Clang 15.0.0 (clang-1500.1.0.2.5)]
[INFO ] [Python ] Interpreter at "/Users/cipriani_pro2023/pyenv-factoryflash/bin/python3.10"
[INFO ] [Logger ] Purge log fired. Processing...
[INFO ] [Logger ] Purge finished!
[INFO ] [Factory ] 189 symbols loaded
[INFO ] [Image ] Providers: img_pil (img_imageio, img_tex, img_dds, img_sdl2, img_ffpyplayer ignored)
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL ES 2" graphics system
[INFO ] [GL ] Backend used <sdl2>
[INFO ] [GL ] OpenGL version <b'2.1 Metal - 83.1'>
[INFO ] [GL ] OpenGL vendor <b'Apple'>
[INFO ] [GL ] OpenGL renderer <b'Apple M2 Pro'>
[INFO ] [GL ] OpenGL parsed version: 2, 1
[INFO ] [GL ] Shading version <b'1.20'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <16>
[INFO ] [Window ] auto add sdl2 input provider
Note that "auto add sdl2 input provider" is now displayed. The crash log for this one, though, was still at the same point in ImageIO:
0 ??? 0xbad4007 ???
1 ImageIO 0x190d0cd80 IIOReadPlugin::callInitialize() + 136
2 ImageIO 0x190d0ca94 IIO_Reader::initImageAtOffset(CGImagePlugin*, unsigned long, unsigned long, unsigned long) + 124
3 ImageIO 0x190d0a328 IIOImageSource::makeImagePlus(unsigned long, IIODictionary*) + 808
4 ImageIO 0x190d16618 IIOImageSource::createImageAtIndex(unsigned long, IIODictionary*) + 80
5 ImageIO 0x190d164e8 CGImageSourceCreateImageAtIndex + 276
6 SDL2_image 0x104d18830 0x104d14000 + 18480
7 SDL2_image 0x104d1869c IMG_Load + 120
8 _window_sdl2.cpython-310-darwin.so 0x1048d9bb8 __pyx_pw_4kivy_4core_6window_12_window_sdl2_18_WindowSDL2Storage_53set_window_icon + 240
It looks like now I'm stuck on the "sdl2" window provider (which still uses SDL2 internally, of course, for its image operations regardless of Kivy's image provider).
Is there perhaps an alternate window provider besides sdl2 that doesn't ultimately rely on something that relies on ImageIO?
The root of this issue seems to be pointing to some ImageIO incompatibility, I think. But I'm not sure why.
Does giving the terminal All File Access in Security change anything?
Does giving the terminal All File Access in Security change anything?
No, no change.
I don't know if this is interesting but I tried forcing Kivy (2.1.0, I'm having some build errors with 2.3.0 that are probably the topic of a new issue) to recompile on install with:
pip install --no-cache-dir --no-binary :all: kivy==2.1.0
But there was also no change in behavior.
I got it working!
/opt/homebrew/lib
was in my DYLD_LIBRARY_PATH
environment variable. Removing it solved the problem. So some other version of some library must have been getting loaded. I'm not sure which. Will investigate further on Monday.
I got it working!
/opt/homebrew/lib
was in myDYLD_LIBRARY_PATH
environment variable. Removing it solved the problem. So some other version of some library must have been getting loaded. I'm not sure which. Will investigate further on Monday.
Glad that worked! Over the years I've learned that brew-installing things and playing with DYLD_LIBRARY_PATH
(and similar) can lead to build errors and failures, so I try to keep my brew installations as minimal as I can.
Let us know if you find out which is the offending library, and if we can do something on our side (via code or docs)!
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have the means to take action. Please reach out if you have or find the answers we need so that we can investigate further.
Software Versions
pip install kivy
into a clean venvDescribe the bug
When attempting to use Kivy, a bus error occurs immediately. See below for stack trace.
Expected behavior
Application runs.
To Reproduce
From https://kivy.org/doc/stable/guide/basic.html#quickstart:
Code and Logs and screenshots
Application output (no additional info in kivy log):
Bus error log and stack trace:
Full report attached: errorlog.txt