PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 993 - Segfault when using phonon VideoWidget
: Segfault when using phonon VideoWidget
Status: CLOSED INVALID
Product: PySide
Classification: Unclassified
Component: phonon
: 1.0.6
: Macintosh Mac OS
: P3 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2011-08-30 18:01 EEST by slowrobot
Modified: 2011-09-21 21:19 EEST (History)
8 users (show)

See Also:


Attachments
C++ test (1.76 KB, application/octetstream)
2011-09-01 22:39 EEST, renato filho
Details

Note You need to log in before you can comment on or make changes to this bug.
Description slowrobot 2011-08-30 18:01:13 EEST
Example code and stack trace at the end.  Steps to reproduce: pass the path to
a video file (one playable by Phonon) as a command line argument, click the
delete button, and then move the window.  I get this on MacOS 10.7 / Apple
Python 2.7 / PySide 1.0.6.  I also got it on MacOS 10.6 and previous versions
of Python and PySide.  I do not seem able to reproduce under Linux, though.  It
seems to have something to do with the interaction of tracking the Phonon
objects in an array and also deleting them.  This is just stripped down example
code to make the problem as simple as possible, but my goal is to be able to
track several Phonon VideoWidgets in an array, and also be able to delete them
(both remove them from the array and delete the VideoWidgets and their
associated MediaObjects, to free up their memory).  Any help appreciated. 
Thanks,

Code:

#!/usr/bin/env python

import sys
from PySide.QtGui import QApplication, QWidget, QPushButton, QGridLayout
from PySide.phonon import Phonon

def video(file):
  global vwidgets
  global mobjects
  media_source = Phonon.MediaSource(file)
  media_object = Phonon.MediaObject()
  media_object.setCurrentSource(
media_source)
  video_widget = Phonon.VideoWidget()
  Phonon.createPath(media_object, video_widget)
  media_object.play()
  vwidgets.append(video_widget)
  mobjects.append(media_object)

def delvideo():
  global vwidgets
  global mobjects
  vw = vwidgets[0]
  mo = mobjects[0]
  vwidgets.remove(vw)
  mobjects.remove(mo)
  mo.deleteLater()
  vw.deleteLater()

vwidgets = []
mobjects = []

app = QApplication([])
app.setApplicationName('test')

video(sys.argv[1])

button1 = QPushButton('delete')
button1.clicked.connect(delvideo)

layout = QGridLayout()
layout.addWidget(vwidgets[0], 0, 0)
layout.addWidget(button1, 0, 1)

window = QWidget()
window.setLayout(layout)
window.show()

app.exec_()

Stack:

Application Specific Information:
objc_msgSend() selector name: _windowFrameDidChange:
objc[32009]: garbage collection is OFF

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib                   0x00007fff8f8d9e90 objc_msgSend + 16
1   com.apple.Foundation              0x00007fff8b442716
__-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_1 + 47
2   com.apple.CoreFoundation          0x00007fff8df1d51a _CFXNotificationPost +
2634
3   com.apple.Foundation              0x00007fff8b42e9cb -[NSNotificationCenter
postNotificationName:object:userInfo:] + 65
4   com.apple.AppKit                  0x00007fff8ead941f -[NSWindow
_windowMovedToRect:] + 247
5   com.apple.AppKit                  0x00007fff8ead9311 -[NSWindow
_windowMoved:] + 158
6   com.apple.AppKit                  0x00007fff8ea0aad2 -[NSWindow sendEvent:]
+ 7404
7   QtGui                             0x000000010c266251 -[QCocoaWindow
sendEvent:] + 241
8   com.apple.AppKit                  0x00007fff8e9a2ae8 -[NSApplication
sendEvent:] + 4592
9   QtGui                             0x000000010c26992a -[QNSApplication
sendEvent:] + 74
10  com.apple.AppKit                  0x00007fff8e93942b -[NSApplication run] +
548
11  QtGui                             0x000000010c273614
QEventDispatcherMac::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) +
1588
12  QtCore                            0x000000010afbab34
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 68
13  QtCore                            0x000000010afbae54
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 180
14  QtCore                            0x000000010afbc47c
QCoreApplication::exec() + 188
15  QtGui.so                          0x000000010b44b552
Sbk_QApplicationFunc_exec_ + 34
16  org.python.python                 0x000000010a841b58 PyEval_EvalFrameEx +
13318
17  org.python.python                 0x000000010a844cd8 PyEval_EvalCodeEx +
1996
18  org.python.python                 0x000000010a844d4d PyEval_EvalCode + 54
19  org.python.python                 0x000000010a85c08f 0x10a7ba000 + 663695
20  org.python.python                 0x000000010a85c14f PyRun_FileExFlags +
157
21  org.python.python                 0x000000010a85d2a2
PyRun_SimpleFileExFlags + 392
22  org.python.python                 0x000000010a86d2af Py_Main + 2715
23  org.python.python                 0x000000010a7b1e88 0x10a7b1000 + 3720
Comment 1 Hugo Parente Lima 2011-08-31 17:46:35 EEST
Ooops, I marked the wrong bug as alreadyfixed, sorry.
Comment 2 renato filho 2011-09-01 22:39:48 EEST
Created attachment 415 [details]
C++ test
Comment 3 renato filho 2011-09-01 22:42:49 EEST
I created a C++ test and I still getting the bug. This prove that this is not a
PySide bug, this is probability a phonon bug. I recommend to you report this
bug with C++ example on qt bug tracker.

https://bugreports.qt.nokia.com/secure/Dashboard.jspa


I will mark this bug as invalid since this is not a PySide bug, but fell free
to reopen if you have more problems.
Comment 4 slowrobot 2011-09-11 01:32:25 EEST
Thank you.  I opened https://bugreports.qt.nokia.com/browse/QTBUG-21387 for Qt.
Comment 5 renato filho 2011-09-21 21:19:49 EEST
Release 1.0.7