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

LinePlot / SmoothLinePlot crashes on Kivy 1.10.0 and certain graphics hardware on windows #11

Open
brentpicasso opened this issue Oct 23, 2017 · 14 comments

Comments

@brentpicasso
Copy link
Contributor

We have reports of SmoothLinePlot crashing our app when running on Windows 7 when running Intel HD 4000 drivers. Also reproduces with the latest driver version.

This started with Kivy 1.10.0 - does not reproduce on Kivy 1.9.1.

Any suggestions on how to diagnose? or graphics settings that might mitigate this?

Thanks,

@brentpicasso brentpicasso changed the title SmoothLinePlot crashes on Kivy 1.10.0 and certain graphics hardware on windows LinePlot / SmoothLinePlot crashes on Kivy 1.10.0 and certain graphics hardware on windows Oct 23, 2017
@brentpicasso
Copy link
Contributor Author

Looks like it's also happening with LinePlot as well. Trying to get a console output to augment this ticket.

@matham
Copy link
Member

matham commented Oct 23, 2017 via email

@brentpicasso
Copy link
Contributor Author

Thank you; we'll give it a try and report back.

@brentpicasso
Copy link
Contributor Author

any risk or side effects by doing this revert? If there's a PR or commit that describes the reason for the original code, please share it so I know if it's just a refactoring / optimization or if it fixed something important. would be helpful before we give this to our customers.

Thanks!

@matham
Copy link
Member

matham commented Oct 24, 2017 via email

@brentpicasso
Copy link
Contributor Author

Thank you. still waiting for some log dumps. I take it the line chart exploits this feature in some way, possibly causing the crash?

Will apply the branch and see if my users reproduce the problem. It's slow for me because I cannot reproduce it locally.

@matham
Copy link
Member

matham commented Oct 24, 2017 via email

@brentpicasso
Copy link
Contributor Author

Thanks. I'll hold off until we can reproduce it. Hopefully we can get it fixed without me having to purchase a specific computer to test on. :)

@brentpicasso
Copy link
Contributor Author

brentpicasso commented Oct 30, 2017

Here's the crash, right when the graph is used.

Does this ring a bell?

Exception MemoryError: MemoryError('vertex index allocation',) in 'kivy.graphic
s.vbo.VertexBatch.append_data' ignored
Exception MemoryError: MemoryError('vertex index allocation',) in 'kivy.graphic
s.vbo.VertexBatch.append_data' ignored

image

@tshirtman
Copy link
Contributor

tshirtman commented Oct 30, 2017

I'm not sure i had any visible error before segfaulting on my side, but i don't have the logs around anymore to confirm :/

About the feature that the removed code defines, i didn't use it (at least explicitly) either, my code was just a dynamic mesh defined in kv, so aside some complex looping/zipping code, there was nothing really magic going on.

@matham
Copy link
Member

matham commented Oct 31, 2017 via email

@brentpicasso
Copy link
Contributor Author

So from reports, this happens the instant they navigate to the part of the app that has the graph - it's not something that happens gradually. However, I suppose an infinite loop could consume memory quickly.

As before, it appears to happen with certain video hardware - Intel HD 4000

@tito
Copy link
Contributor

tito commented Dec 27, 2017

I think that in order to understand what's going on, you need to figure out if VBO are correctly deallocated.
This can be checked in 2 ways:

  • use objgraph, and when the MemoryError happen, start pdb (bind it on a keybinding), and check for VBO objects still in memory. I won't do a objgraph tutorial, and it can be very time consuming to find what you want, and understand where it came from :). Maybe double check that Line are removed if you use LinePlot. You could monitor the number of Line object in memory every X seconds to see if there is any increase.
  • at low level, use apitrace. It will trace GL functions call, and then you can see if the VBO are correctly deallocated.

A MemoryError really indicate that something is not freed; we have already few driver-specific fixes in the Kivy codebase, maybe this error require one as well.

@brentpicasso
Copy link
Contributor Author

brentpicasso commented Dec 27, 2017

This problem reproduced on a specific configuration. However, this specific configuration is actually pretty common, because it is happening on Windows 7 with the Intel HD 4000 graphics, which shows up on many different computers, especially laptops.

I have recently acquired a Thinkpad T530 and I'm in the process of installing WIndows 7 on it; Fortunately I reproduced the problem with our app, so I'll be able to install the dev tools (after all of the Windows service packs are installed) and then see what I can figure out.

What I did notice from casual observation, is that the app seems to freeze for a while, then crashes - not an immediate crash. This has me guess that it is going into a loop, allocating memory until exhausted.

@matham matham transferred this issue from kivy-garden/garden.graph Jun 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants