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

Segfault when running touch tracer app #201

Closed
girivs opened this issue Jul 18, 2011 · 11 comments
Closed

Segfault when running touch tracer app #201

girivs opened this issue Jul 18, 2011 · 11 comments
Assignees
Milestone

Comments

@girivs
Copy link

girivs commented Jul 18, 2011

Kivy segfaults when running the touchtracer app. This happens in Mac OS X Snow Leopard with the Kivy development stream from github as well as the stable versions. Looks like a memory leak.

http://paste.pocoo.org/show/441545/

@geekynils
Copy link

Seems to happen when you put a lot of fingers on the touchpad here are the error messages from the terminal:

[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
* Recognized (0x62) family* (20 cols X 12 rows) using raw16bitRange= 460, thresh8bits= 3, zsignal_per_pixelsum= 46
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
2011-07-18 22:59:41.631 Python[465:5f03] *** __NSAutoreleaseNoPool(): Object 0x1018a9ae0 of class SDL_QuartzWindow autoreleased with no pool in place - just leaking
2011-07-18 22:59:41.633 Python[465:5f03] *** __NSAutoreleaseNoPool(): Object 0x101bf2fb0 of class NSCFNumber autoreleased with no pool in place - just leaking
2011-07-18 22:59:41.634 Python[465:5f03] *** __NSAutoreleaseNoPool(): Object 0x1002f8f60 of class NSConcreteValue autoreleased with no pool in place - just leaking
2011-07-18 22:59:41.634 Python[465:5f03] *** __NSAutoreleaseNoPool(): Object 0x101886b10 of class NSCFNumber autoreleased with no pool in place - just leaking
2011-07-18 22:59:41.635 Python[465:5f03] *** __NSAutoreleaseNoPool(): Object 0x1018cfc20 of class NSConcreteValue autoreleased with no pool in place - just leaking
2011-07-18 22:59:41.635 Python[465:5f03] *** __NSAutoreleaseNoPool(): Object 0x119b55790 of class NSCFDictionary autoreleased with no pool in place - just leaking
Fatal Python error: (pygame parachute) Segmentation Fault
Abort trap
examples > [ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
examples >
examples > [ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second

examples > [ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second

examples > [ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
jobs
examples > [ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second
[ERROR ] [OSC ] Address 0.0.0.0:3333 already in use, retry in 2 second

@ghost ghost assigned dennda Jul 19, 2011
@tito
Copy link
Member

tito commented Jul 19, 2011

  1. First, if you have taken the upstream (master) version, ensure that everything is compiled by doing:

    make distclean && make

  2. Change the log level to debug (and comment TUIO line in the config file). Edit ~/.kivy/config.ini and change log_level to debug. Add # in the "default = tuio, ..." line.

  3. Use the kivy package to have a clean kivy environment (you should have used make-symlinks before):

    kivy

  4. Extend the PYTHONPATH to use your latest compiled Kivy:

    export PYTHONPATH=~/path/to/your/upstream/kivy:$PYTHONPATH

  5. Ensure that the PYTHONPATH is ok by testing the import of kivy. It should show the 1.0.8-dev version too. If the path if not good, back to 4. point:

    python -c 'import kivy; print kivy.file'

  6. Try to remake the crash:

    python /path/to/touchtracer/main.py

  7. If you still got the crash, try with gdb:

    gdb --args python /path/to/touchtracer/main.py
    run

  8. When the crash have happened, show the backtrace:

    bt

  9. Send the complete output from the 1. to 9. in your console to paste.pocoo.org. Everything is important, please don't try to cut the output :)

Thanks !

@geekynils
Copy link

Well I just downloaded the (binary?) osx Version from the kivy website. Maybe I'll check it out from github later. Do you not have access to a Mac yourself?

@dennda
Copy link
Contributor

dennda commented Jul 19, 2011

We do.

Your log is not complete, however. Please paste everything from start to finish.

@geekynils
Copy link

Here it is:

Kivy > kivy examples/demo/touchtracer/main.py
[INFO ] Kivy v1.0.7
[WARNING] [Config ] Older configuration version detected (0 instead of 3)
[WARNING] [Config ] Upgrading configuration in progress.
[DEBUG ] [Config ] Upgrading from 0 to 1
[DEBUG ] [Config ] Upgrading from 1 to 2
[DEBUG ] [Config ] Upgrading from 2 to 3
[INFO ] [Logger ] Record log in /Users/nils/.kivy/logs/kivy_11-07-19_5.txt
[INFO ] [Factory ] 95 symbols loaded
[WARNING] [Image ] Unable to use as loader!
[INFO ] [Text ] using as text provider
[INFO ] [Window ] using as window provider
[INFO ] [GL ] OpenGL version <2.1 NVIDIA-1.6.36>
[INFO ] [GL ] OpenGL vendor
[INFO ] [GL ] OpenGL renderer <NVIDIA GeForce 9600M GT OpenGL Engine>
[INFO ] [GL ] Shading version <1.20>
[INFO ] [GL ] Texture max size <8192>
[INFO ] [GL ] Texture max units <16>
[INFO ] [Shader ] fragment compiled successfully
[INFO ] [Shader ] vertex compiled successfully
[INFO ] [GL ] NPOT texture support is available
[INFO ] [Loader ] using as thread loader
[INFO ] [OSC ] using for socket
[INFO ] [Base ] Start application main loop
* Recognized (0x62) family* (20 cols X 12 rows) using raw16bitRange= 460, thresh8bits= 3, zsignal_per_pixelsum= 46
[INFO ] [OSC ] listening for Tuio on 0.0.0.0:3333
2011-07-19 14:12:34.187 Python[2263:5f03] *** __NSAutoreleaseNoPool(): Object 0x101d261f0 of class SDL_QuartzWindow autoreleased with no pool in place - just leaking
2011-07-19 14:12:34.189 Python[2263:5f03] *** __NSAutoreleaseNoPool(): Object 0x1018d7cd0 of class NSCFNumber autoreleased with no pool in place - just leaking
2011-07-19 14:12:34.190 Python[2263:5f03] *** __NSAutoreleaseNoPool(): Object 0x1018618c0 of class NSConcreteValue autoreleased with no pool in place - just leaking
2011-07-19 14:12:34.191 Python[2263:5f03] *** __NSAutoreleaseNoPool(): Object 0x101d09450 of class NSCFNumber autoreleased with no pool in place - just leaking
2011-07-19 14:12:34.192 Python[2263:5f03] *** __NSAutoreleaseNoPool(): Object 0x101d33810 of class NSConcreteValue autoreleased with no pool in place - just leaking
2011-07-19 14:12:34.192 Python[2263:5f03] *** __NSAutoreleaseNoPool(): Object 0x119c2eab0 of class NSCFDictionary autoreleased with no pool in place - just leaking
Fatal Python error: (pygame parachute) Segmentation Fault
Abort trap

@a-zb
Copy link

a-zb commented Jul 22, 2011

I would like to add that a crash also is reproducible in touchtracer on my OSX 10.6.8. I downloaded the 1.0.7 dmg image
from Kivy website and run the demos by running Kivy in terminal and passing the main.py as an argument.

Complete stacktrace: http://paste.pocoo.org/show/444275/

It seems to happen in the vbo.so module.

Edit: In addition, the error is triggered by the drawing routines since, when I take out code from from all 4 on_* handlers in Touchtracer class , it doesn't happen: http://paste.pocoo.org/show/444278/

2nd edit: If I only take out the code that draws the label, it does not crash anymore. So that's good news that narrows it down a bit: http://paste.pocoo.org/show/444282/

3rd edit: The crash seems to be caused by the three lines of code inside on_touch_up handler. If that code is executed, the app doesn't crash. http://paste.pocoo.org/show/444431/

That code only removes the group and the widget so that the drawn lines and labels disappear when a user raises their finger.

4th edit: this line causes the crash
self.remove_widget(ud['label'])
without it, the demo doesn't crash

@tito
Copy link
Member

tito commented Jul 28, 2011

Thanks a lot for the analysis. I still doesn't understand how to trigger it :/ Can you tell me if it's as soon as your using it ?
Or after some times ?

One test i would like you to do too, is to check how many times the on_touch_up is called ?

@tito tito closed this as completed Jul 28, 2011
@tito
Copy link
Member

tito commented Jul 28, 2011

Ow ow ow ow ow ! I see why it's crashing. I don't think it's an issue about remove_widget (is it random or not ?)
In another thread, it's written:

The 6 libGL.dylib 0x00007fff8769b022 glDeleteBuffers + 18

Never do gl command in another thread than main thread... Now why it's happening, i've absolutly no fucking idea >_<

@tito tito reopened this Jul 28, 2011
@tito
Copy link
Member

tito commented Jul 28, 2011

That's very weird. I'll do the same approach than texture: put the vbo deletion in a list, and trigger the list in a Clock, from the main thread. Thanks a lot for reporting !

@a-zb
Copy link

a-zb commented Jul 29, 2011

I don't think it's an issue about remove_widget (is it random or not ?)

Happens randomly - yes, but always on touch_up . If the remove_widget is commented out, it works forever - it does not crash. Also, if I keep my finger on the touchpad the whole time and don't lift it up, it runs forever as well. ...
I wish I knew more about kivy to help out with the fix, so that's all that I know for now.

@tito tito closed this as completed in e4d702c Aug 4, 2011
@tito
Copy link
Member

tito commented Aug 4, 2011

areksb, can you pull the master version, recompile, and test if it's works better for your case ? Since i didn't be able to trigger it, i want to ensure that this fix will do the job. Thanks !

@ghost ghost assigned tito Aug 4, 2011
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

5 participants