xpra icon
Bug tracker and wiki

Opened 6 years ago

Closed 6 years ago

#372 closed defect (worksforme)

client mesa crash with opengl enabled

Reported by: Antoine Martin Owned by: SmO
Priority: critical Milestone: 0.10
Component: client Version:
Keywords: opengl Cc:

Description

  • start server with one xterm
  • attach client (via tcp, x264 encoding)
  • attach gdb
  • start VirtualBox from the xterm
  • get this beautiful stacktrace (sanitized - full stacktrace attached):
    (gdb) py-bt
    #13 Frame 0x4025210, for file /usr/lib/python2.7/site-packages/OpenGL/wrapper.py, line 784, in wrapperCall \
        (args=(<IntConstant at remote 0x2b738c0>, 0, <IntConstant at remote 0x2631c80>, 1364, 710, 0, <...>, \
            <IntConstant at remote 0x20f8fa0>, 0), pyArgs=(<...>, 0, <...>, 1364, 710, 0, <...>, <...>, \
            <c_ubyte at remote 0x7f0f182cb200>), \
        cArguments=(...))
        result = self.wrappedOperation( *cArguments )
    #18 Frame 0x20889b0, for file /usr/lib/python2.7/site-packages/OpenGL/latebind.py, line 41, in __call__ \
        (self=<glTexImage2D(pyConverterNames=['target', 'level', 'internalformat', 'width', 'height', 'border', 'format', 'type', 'pixels'], \
        pyConverters=[None, None, None, <function at remote 0x28dc578>, <function at remote 0x28dc578>, None, None, None, \
        <ImageInputConverter(typeName='type', pixelsIndex=8, pixelsName='pixels', typeIndex=7, rank=3) at remote 0x28d64d0>], \
        _finalCall=<function at remote 0x1e731b8>) at remote 0x28dd368>, args=(<IntConstant at remote 0x2b738c0>, 0, \
        <IntConstant at remote 0x2631c80>, 1364, 710, 0, <...>, <IntConstant at remote 0x20f8fa0>, 0), named={})
        return self._finalCall( *args, **named )
    #28 Frame 0x1fa4820, for file /usr/lib64/python2.7/site-packages/xpra/client/gl/gl_window_backing.py, line 182, in gl_init \
        (self=<GLPixmapBacking(_last_pixmap_data=None, wid=2, yuv_shader=None, pixel_format=None, textures=<numpy.ndarray at remote 0x557ed10>, \
        _video_use_swscale=False, _has_alpha=False, _backing=None, idle_add=<built-in function idle_add>, size=(1364, 710), \
        paint_screen=False, glarea=<DrawingArea at remote 0x7f0f182d2aa0>, mmap=None, gl_setup=False, \
        draw_needs_refresh=False, offscreen_fbo=<numpy.uint32 at remote 0x55429e0>, texture_size=(0, 0), _video_decoder=None, \
        _decoder_lock=<thread.lock at remote 0x1d32c70>, _csc_decoder=None, \
        glconfig=<gtk.gdkgl.Config at remote 0x7f0f182d2a50>, mmap_enabled=False) at remote 0x1e8fd90>, \
        drawable=<gtk.gdk.GLWindowImplX11 at remote 0x7f0f182d2b40>, w=1364, h=710, glStringMarkerGREMEDY=None)
        glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, 0)
    #31 Frame 0x2c251f0, for file /usr/lib64/python2.7/site-packages/xpra/client/gl/gl_window_backing.py, line 265, in gl_expose_event \
        (self=<GLPixmapBacking(_last_pixmap_data=None, wid=2, yuv_shader=None, pixel_format=None, textures=<numpy.ndarray at remote 0x557ed10>, \
        _video_use_swscale=False, _has_alpha=False, _backing=None, idle_add=<built-in function idle_add>, size=(1364, 710), \
        paint_screen=False, glarea=<DrawingArea at remote 0x7f0f182d2aa0>, mmap=None, gl_setup=False, \
        draw_needs_refresh=False, offscreen_fbo=<numpy.uint32 at remote 0x55429e0>, texture_size=(0, 0), _video_decoder=None, \
        _decoder_lock=<thread.lock at remote 0x1d32c70>, _csc_decoder=None, \
        glconfig=<gtk.gdkgl.Config at remote 0x7f0f182d2a50>, mmap_enabled=False) at remote 0x1e8fd90>, \
        glarea=<...>, event=<gtk.gdk.Event at remote 0x1e889e0>)
        drawable = self.gl_init()
    #56 Frame 0x1f647d0, for file /usr/lib64/python2.7/site-packages/xpra/client/gtk_base/gtk_client_base.py, line 54, in run \
        (self=<XpraClient(_draw_thread=<Thread(_Thread__ident=139703134353152, \
        _Thread__block=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x1d32bf0>, \
        acquire=<built-in method acquire of thread.lock object at remote 0x1d32bf0>, _Condition__waiters=[], \
        release=<built-in method release of thread.lock object at remote 0x1d32bf0>) at remote 0x1e630d0>, \
        _Thread__name='draw', _Thread__daemonic=True, _Thread__started=<_Event(_Verbose__verbose=False, _Event__flag=True, \
        _Event__cond=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x1d32b70>, \
        acquire=<built-in method acquire of thread.lock object at remote 0x1d32b70>, _Condition__waiters=[], \
        release=<built-in method release of thread.lock object at remote 0x1d32b70>) at remote 0x1e63050>) at remote 0x1e5ffd0>, \
       _Thread__stderr=<file at remote 0x7f0f429b21e0>, _Thread__target=<instancemethod at remote 0...(truncated)
        gtk.main()
    #59 Frame 0x1f645f0, for file /usr/lib64/python2.7/site-packages/xpra/scripts/main.py, line 754, in do_run_client
    
(gdb) bt
#0  0x00007f0f2c2851d0 in _mesa_texstore_argb8888 () from /lib64/libdricore9.2.0-devel.so.1
#1  0x00007f0f2c2862c2 in store_texsubimage () from /lib64/libdricore9.2.0-devel.so.1
#2  0x00007f0f2c2864a9 in _mesa_store_teximage () from /lib64/libdricore9.2.0-devel.so.1
#3  0x00007f0f2c7699ce in intelTexImage () from /usr/lib64/dri/i965_dri.so
#4  0x00007f0f2c2746cc in teximage () from /lib64/libdricore9.2.0-devel.so.1
#5  0x00007f0f2c275d40 in _mesa_TexImage2D () from /lib64/libdricore9.2.0-devel.so.1
#6  0x000000372da05cfc in ffi_call_unix64 () from /lib64/libffi.so.6
#7  0x000000372da0562c in ffi_call () from /lib64/libffi.so.6
#8  0x00007f0f3a0af92b in _call_function_pointer (argcount=9, resmem=0x7fff8263e960, restype=<optimized out>, atypes=<optimized out>, 
    avalues=0x7fff8263e900, pProc=0x37352429c0 <glTexImage2D>, flags=4353) at /usr/src/debug/Python-2.7.5/Modules/_ctypes/callproc.c:832
#9  _ctypes_callproc ([email protected]=0x37352429c0 <glTexImage2D>, 
    [email protected]=(<IntConstant at remote 0x2b738c0>, 0, <IntConstant at remote 0x2631c80>, \
    1364, 710, 0, <...>, <IntConstant at remote 0x20f8fa0>, <c_ubyte at remote 0x7f0f182cb200>), flags=4353, 
    [email protected]=(<built-in method from_param of _ctypes.PyCSimpleType object at remote 0x12a3850>, \
        <built-in method from_param of _ctypes.PyCSimpleType object at remote 0x12a25a0>, \
        <built-in method from_param of _ctypes.PyCSimpleType object at remote 0x12a25a0>, \
        <built-in method from_param of _ctypes.PyCSimpleType object at remote 0x12a25a0>, \
        <built-in method from_param of _ctypes.PyCSimpleType object at remote 0x12a25a0>, \
        <built-in method from_param of _ctypes.PyCSimpleType object at remote 0x12a25a0>, \
        <built-in method from_param of _ctypes.PyCSimpleType object at remote 0x12a3850>, \
        <built-in method from_param of _ctypes.PyCSimpleType object at remote 0x12a3850>, \
        <instancemethod at remote 0x26c89b0>), \
    restype=None, 
    checker=0x0) at /usr/src/debug/Python-2.7.5/Modules/_ctypes/callproc.c:1179
#10 0x00007f0f3a0a9975 in PyCFuncPtr_call (self=<optimized out>, inargs=<optimized out>, kwds=<optimized out>)
    at /usr/src/debug/Python-2.7.5/Modules/_ctypes/_ctypes.c:3929
#11 0x000000372d249dd3 in PyObject_Call (
    [email protected]=<CFunctionType(extension=None, deprecated=False, \
       argNames=['target', 'level', 'internalformat', 'width', 'height', 'border', 'format', 'type', 'pixels'], \
       DLL=<CDLL(_FuncPtr=<_ctypes.PyCFuncPtrType at remote 0x212c7f0>, \
           glGetString=<_FuncPtr(__name__='glGetString', __doc__='glGetString( constant ) -> Current string value') at remote 0x26d4ef0>, \
           glXGetCurrentContext=<_FuncPtr(__name__='glXGetCurrentContext') at remote 0x1d35460>,
           _handle=22618672, _name='libGL.so.1', \
           glXGetProcAddressARB=<_FuncPtr(__name__='glXGetProcAddressARB') at remote 0x1d351f0>, \
           glGetError=<_FuncPtr(__name__='glGetError') at remote 0x1d35530>) at remote 0x20f41d0>, \
           __name__='glTexImage2D', \
           __doc__='glTexImage2D( GLenum(target), GLint(level), GLint(internalformat), GLsizei(width), GLsizei(height), \
                                  GLint(border), GLenum(format), GLenum(type), POINTER(GLvoid)(pixels) ) -> None') at remote 0x26d21f0>, 
    [email protected]=(<IntConstant at remote 0x2b738c0>, 0,
                   <IntConstant at remote 0x2631c80>, 1364, 710, 0, <...>, \
                   <IntConstant at remote 0x20f8fa0>, \
                   <c_ubyte at remote 0x7f0f182cb200>), [email protected]=0x0) at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2529
#12 0x000000372d2d9f1d in ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fff8263ed70, 
    func=<CFunctionType(extension=None, deprecated=False, \
        argNames=['target', 'level', 'internalformat', 'width', 'height', 'border', 'format', 'type', 'pixels'], \
        DLL=<CDLL(_FuncPtr=<_ctypes.PyCFuncPtrType at remote 0x212c7f0>, \
            glGetString=<_FuncPtr(__name__='glGetString', \
                                  __doc__='glGetString( constant ) -> Current string value') at remote 0x26d4ef0>, \
            glXGetCurrentContext=<_FuncPtr(__name__='glXGetCurrentContext') at remote 0x1d35460>, \
                                  _handle=22618672, _name='libGL.so.1', \
            glXGetProcAddressARB=<_FuncPtr(__name__='glXGetProcAddressARB') at remote 0x1d351f0>, \
            glGetError=<_FuncPtr(__name__='glGetError') at remote 0x1d35530>) at remote 0x20f41d0>, \
            __name__='glTexImage2D', \
            __doc__='glTexImage2D( GLenum(target), GLint(level), GLint(internalformat), GLsizei(width), GLsizei(height), \
                                   GLint(border), GLenum(format), GLenum(type), POINTER(GLvoid)(pixels) ) -> None') at remote 0x26d21f0>)
    at /usr/src/debug/Python-2.7.5/Python/ceval.c:4411
#13 PyEval_EvalFrameEx (
    [email protected]=Frame 0x4025210, for file /usr/lib/python2.7/site-packages/OpenGL/wrapper.py, line 784, in wrapperCall \
    (args=(<IntConstant at remote 0x2b738c0>, 0, \
           <IntConstant at remote 0x2631c80>, 1364, 710, 0, <...>, \
           <IntConstant at remote 0x20f8fa0>, 0), \
    pyArgs=(<...>, 0, <...>, 1364, 710, 0, <...>, <...>, <c_ubyte at remote 0x7f0f182cb200>), cArguments=(...)), \
    [email protected]=0) at /usr/src/debug/Python-2.7.5/Python/ceval.c:2779
#14 0x000000372d2dec7d in PyEval_EvalCodeEx (co=<optimized out>, globals=<optimized out>, [email protected]=0x0, [email protected]=0x1e8cbe8, 
    argcount=9, [email protected]=0x7f0f42997068, [email protected]=0, [email protected]=0x0, [email protected]=0, 
    closure=(<cell at remote 0x1e72130>, <cell at remote 0x1e72360>)) at /usr/src/debug/Python-2.7.5/Python/ceval.c:3330
#15 0x000000372d26dd7d in function_call (func=<function at remote 0x1e731b8>, 
    arg=(<IntConstant at remote 0x2b738c0>, 0, <IntConstant at remote 0x2631c80>, 1364, 710, 0, <...>, <IntConstant at remote 0x20f8fa0>, 0), kw={})
    at /usr/src/debug/Python-2.7.5/Objects/funcobject.c:526
#16 0x000000372d249dd3 in PyObject_Call ([email protected]=<function at remote 0x1e731b8>, 
    [email protected]=(<IntConstant at remote 0x2b738c0>, 0, \
                   <IntConstant at remote 0x2631c80>, 1364, 710, 0, <...>, \
                   <IntConstant at remote 0x20f8fa0>, 0), \
    [email protected]={}) at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2529
#17 0x000000372d2d9f1d in ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fff8263f030, 
    func=<function at remote 0x1e731b8>) at /usr/src/debug/Python-2.7.5/Python/ceval.c:4411

Maybe this is a driver bug?
See Bus error in _mesa_texstore_argb8888

And if so, how can we prevent that? Blacklist versions of mesa? (mine is very recent: 9.2)
If not, then we have to disable GL on Linux too... (again)

Attachments (3)

glxinfo.txt (15.3 KB) - added by Antoine Martin 6 years ago.
glxinfo for "Intel Corporation 3rd Gen Core processor Graphics Controller"
trap-all-X11errors-from-packets.txt (1.3 KB) - added by Antoine Martin 6 years ago.
ensures we synchronize and trap all X11 calls right out of the packet handler
gtkperf-crash-xtrace-debug.log.gz (152.5 KB) - added by Antoine Martin 6 years ago.
full log of crash in debug mode with xtrace

Download all attachments as: .zip

Change History (24)

comment:1 Changed 6 years ago by Antoine Martin

Component: androidclient
Keywords: opengl added

comment:2 Changed 6 years ago by Antoine Martin

Strangely enough, when I tried to reproduce without the xterm (by simply launching vbox with: DISPLAY=:10 VirtualBox, it didn't crash..)


Here is the xpra client debug log from the moment we launch VirtualBox:

new hidden group leader window <gtk.gdk.Window object at 0x7fdb78233aa0 (GdkWindow at 0x20875a0)> for ref=10485765
GLClientWindow(..)
<class 'xpra.client.gl.gl_client_window.GLClientWindow'>(<XpraClient object at 0x2505be0 (xpra+client+gtk2+client+XpraClient at 0x1d360c0)>, \
    <gtk.gdk.Window object at 0x7fdb78233aa0 (GdkWindow at 0x20875a0)>, 2, 1688, 180, 1364, 710, \
    {'size-constraints': {'minimum-size': (362, 209)}, 'fullscreen': False, 'has-alpha': False, 'xid': '0xa00017', \
     'title': 'Oracle VM VirtualBox Manager', 'icon-title': '', 'client-machine': 'desktop', 'pid': 3388, 'group-leader-xid': 10485765, \
     'window-type': ('NORMAL',), 'modal': False, 'maximized': False, 'class-instance': ('Qt-subapplication', 'VirtualBox')}, False, {}, 0) \
update_metadata({'size-constraints': {'minimum-size': (362, 209)}, 'fullscreen': False, 'has-alpha': False, 'xid': '0xa00017', \
    'title': 'Oracle VM VirtualBox Manager', 'icon-title': '', 'client-machine': 'desktop', 'pid': 3388, 'group-leader-xid': 10485765,  \
    'window-type': ('NORMAL',), 'modal': False, 'maximized': False, 'class-instance': ('Qt-subapplication', 'VirtualBox')})
set_modal(False) swallowed
set_window_type(['NORMAL'])
setting window type to NORMAL - <enum GDK_WINDOW_TYPE_HINT_NORMAL of type GdkWindowTypeHint>
set_alpha()
set_fullscreen(False)
make_new_backing(<class 'xpra.client.gl.gl_window_backing.GLPixmapBacking'>, 1364, 710) \
    effective backing class=<class 'xpra.client.gl.gl_window_backing.GLPixmapBacking'>, alpha=False
make_new_backing(<class 'xpra.client.gl.gl_window_backing.GLPixmapBacking'>, 1364, 710) calling init
window_state_updated(<GLClientWindow object at 0x7fdb78233a50 (xpra+client+gtk2+client_window+ClientWindow at 0x2761340)>,  \
    <gtk.gdk.Event at 0x2659ad0: GDK_WINDOW_STATE>) \
    new_window_state=<flags 0 of type GdkWindowState>, fullscreen=False, maximized=False
gl_expose_event(<DrawingArea object at 0x7fdb78233e60 (GtkDrawingArea at 0x27b9a40)>, <gtk.gdk.Event at 0x2659ad0: GDK_EXPOSE area=[0, 0, 200, 200]>)
GL Pixmap backing size: 1364 x 710, drawable=<gtk.gdk.GLWindowImplX11 object at 0x7fdb78233f00 (GdkGLWindowImplX11 at 0x20e6e80)>
textures for wid=2 of size (1364, 710) : [1 2 3 4 5]
Segmentation fault (core dumped)

And the server debug log which shows lots of window resizing before the window is actually mapped:

do_child_configure_request_event(<AdHocStruct object, contents: {'delivered_to': <gtk.gdk.Window object at 0x1cd4d20 (GdkWindow at 0x1681ea0)>, \
    'send_event': 0, 'value_mask': 12L, 'detail': 0, 'height': 432, 'width': 1644, \
    'window': <gtk.gdk.Window object at 0x7fc878a055f0 (GdkWindow at 0x1d9c120)>, 'above': None, 'y': 0, 'x': 0, 'serial': 3129L, \
    'border_width': 0, 'type': 23, 'display': <gtk.gdk.Display object at 0x1a4b3c0 (GdkDisplayX11 at 0x1b3d210)>}>)
Reconfigure on withdrawn window

Repeated with the following dimensions (and a new serial - the rest is unchanged):

'height': 21, 'width': 200
'height': 432, 'width': 1644
'height': 21, 'width': 200
'height': 432, 'width': 1644
'height': 21, 'width': 200
'height': 432, 'width': 1644
'height': 21, 'width': 200
'height': 432, 'width': 1644
'height': 21, 'width': 200
'height': 21, 'width': 132
'height': 21, 'width': 200
'height': 21, 'width': 132
'height': 21, 'width': 200
'height': 21, 'width': 132
'height': 21, 'width': 200
'height': 710, 'width': 1364
'height': 21, 'width': 482
'height': 21, 'width': 482
'height': 21, 'width': 482
'height': 21, 'width': 482

Then the actual map event:

Found a potential client
new window 0xa00017L - 0xa00017L
CompositeHelper.__init__(<gtk.gdk.Window object at 0x7fc878a055f0 (GdkWindow at 0x1d9c6c0)>,False)
call_setup()
call_setup() adding event receiver
call_setup() composite setup
invalidating named pixmap
CompositeHelper.setup() damage handle(0xa00017L)=0x400035L
setup() corral_window=<gtk.gdk.Window object at 0x7fc878a058c0 (GdkWindow at 0x1d9c7e0)>
Missing property WM_TRANSIENT_FOR (window)
Missing property _XPRA_SCALING (u32)
Missing property WM_WINDOW_ROLE (latin1)
Missing property _NET_WM_STATE (['atom'])
reading initial value for WM_HINTS
wm_hints.input = 1
reading initial value for WM_NORMAL_HINTS
_update_client_geometry: using initial size=(1364, 710) and position=(1688, 180)
_do_update_client_geometry: 1364x710
_do_update_client_geometry: hints=WMSizeHints({'min_size': (362, 209), 'max_aspect_ratio': None, 'win_gravity': 10, 'resize_inc': None, \
    'min_aspect_ratio': None, 'base_size': None, 'min_aspect': None, 'max_size': None, 'max_aspect': None})
_do_update_client_geometry: sanitized hints=WMSizeHints({'min_size': (362, 209), 'max_aspect_ratio': None, 'win_gravity': 10, 'resize_inc': None, \
    'min_aspect_ratio': None, 'base_size': None, 'min_aspect': None, 'max_size': None, 'max_aspect': None})
_do_update_client_geometry: size=(1364, 710, 1364, 710)
_do_update_client_geometry: position=(1688, 180)
reading initial value for WM_NAME
reading initial value for _NET_WM_NAME
Missing property _NET_WM_ICON_NAME (utf8)
Missing property WM_ICON_NAME (latin1)
Missing property _NET_WM_ICON_NAME (utf8)
Missing property WM_ICON_NAME (latin1)
Missing property _NET_WM_STRUT_PARTIAL (strut-partial)
Missing property _NET_WM_STRUT (strut)
_NET_WM_ICON changed on 10485783, re-reading
icon is now <cairo.ImageSurface object at 0x7fc8789ee070>
setup() adding to save set
setup() reparenting
setup() geometry
setup() resizing windows to 1364x710
Discovered new ordinary window: <WindowModel object at 0x7fc878a05820 (xpra+x11+gtk_x11+window+WindowModel at 0x7fc88001dc20)> \
    (geometry=(1688, 180, 1364, 710))
window_types=['_NET_WM_WINDOW_TYPE_NORMAL']
window_types=['NORMAL']
new_window(new-window, <WindowModel object at 0x7fc878a05820 (xpra+x11+gtk_x11+window+WindowModel at 0x7fc88001dc20)>, \
    2, 1688, 180, 1364, 710, None) \
    metadata={'size-constraints': {'minimum-size': (362, 209)}, 'fullscreen': False, 'has-alpha': False, 'xid': '0xa00017', \
    'title': 'Oracle VM VirtualBox Manager', \
    'pid': 3388, 'client-machine': 'desktop', 'icon-title': '', 'group-leader-xid': 10485765, 'window-type': ['NORMAL'], 'modal': False, \
    'maximized': False, 'class-instance': ['Qt-subapplication', 'VirtualBox']}
send_window_icon(<WindowModel object at 0x7fc878a05820 (xpra+x11+gtk_x11+window+WindowModel at 0x7fc88001dc20)>,2) \
    icon=<cairo.ImageSurface object at 0x7fc8789ee070>
found new window icon: 48x48, sending as png=True
WindowModel.do_xpra_configure_event(<AdHocStruct object, \
    contents: {'delivered_to': <gtk.gdk.Window object at 0x7fc878a055f0 (GdkWindow at 0x1d9c6c0)>, \
    'send_event': 0, 'height': 710, 'width': 1364, 'window': <gtk.gdk.Window object at 0x7fc878a055f0 (GdkWindow at 0x1d9c6c0)>, \
    'y': 0, 'x': 0, 'serial': 3439L, \
    'border_width': 0, 'type': 22, 'display': <gtk.gdk.Display object at 0x1a4b3c0 (GdkDisplayX11 at 0x1b3d210)>}>)
BaseWindowModel.do_xpra_configure_event(<AdHocStruct object, \
    contents: {'delivered_to': <gtk.gdk.Window object at 0x7fc878a055f0 (GdkWindow at 0x1d9c6c0)>, \
    'send_event': 0, 'height': 710, 'width': 1364, 'window': <gtk.gdk.Window object at 0x7fc878a055f0 (GdkWindow at 0x1d9c6c0)>, \
    'y': 0, 'x': 0, 'serial': 3439L, \
    'border_width': 0, 'type': 22, 'display': <gtk.gdk.Display object at 0x1a4b3c0 (GdkDisplayX11 at 0x1b3d210)>}>) \
    old geometry=(1688, 180, 1364, 710, 0), \
    new geometry=(0, 0, 1364, 710, 0)
new_geom(<WindowModel object at 0x7fc878a05820 (xpra+x11+gtk_x11+window+WindowModel at 0x7fc88001dc20)>,(<GParamBoxed 'geometry'>,))
XpraServer._window_resized_signaled(<WindowModel object at 0x7fc878a05820 (xpra+x11+gtk_x11+window+WindowModel at 0x7fc88001dc20)>, \
   (<GParamBoxed 'geometry'>,)) actual-size=1364x710, current geometry=[1688, 180, 1364, 710]
invalidating named pixmap
Property changed on 10485783: _NET_WM_ALLOWED_ACTIONS
Property changed on 10485783: _NET_FRAME_EXTENTS
Property changed on 10485783: _NET_WM_STATE
Property changed on 10485783: WM_STATE
invalidating named pixmap
Property changed on 10485783: WM_NORMAL_HINTS
Property changed on 10485783: _MOTIF_WM_HINTS
Property changed on 10485783: WM_NORMAL_HINTS
Property changed on 10485783: _MOTIF_WM_HINTS
Last edited 6 years ago by Antoine Martin (previous) (diff)

comment:3 Changed 6 years ago by Antoine Martin

Resolution: fixed
Status: newclosed

If the stacktrace isn't clear enough, adding debug statements in between each call:

            debug("glBindTexture(%s, %s)", GL_TEXTURE_RECTANGLE_ARB, self.textures[TEX_FBO])
            glBindTexture(GL_TEXTURE_RECTANGLE_ARB, self.textures[TEX_FBO])
            debug("glTexImage2D(..)")
            glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, 0)

            debug("glBindFramebuffer(..)")
            glBindFramebuffer(GL_FRAMEBUFFER, self.offscreen_fbo)
            debug("glFramebufferTexture2D(..)")
            glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ARB, self.textures[TEX_FBO], 0)
            debug("glClear(..)")
            glClear(GL_COLOR_BUFFER_BIT)

shows:

2013-07-09 11:22:59,727 textures for wid=2 of size (1364, 710) : [1 2 3 4 5]
2013-07-09 11:22:59,730 glBindTexture(GL_TEXTURE_RECTANGLE_ARB (34037), 5)
2013-07-09 11:22:59,730 glTexImage2D(..)
Segmentation fault (core dumped)

Which leads us to the data part of glTexImage2D where we pass 0... which is not a valid pointer:

            glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, 0)

0 (Zero) is not a valid pointer, it is an integer. If we want to pass the equivalent to NULL then we have to use Python's None.

Fixed in r3802

Last edited 6 years ago by Antoine Martin (previous) (diff)

comment:4 Changed 6 years ago by Antoine Martin

Resolution: fixed
Status: closedreopened

Got another crash, without gdb attached unfortunately...

Please review all the calls as there may well be other places where zero should be None, etc.

comment:5 Changed 6 years ago by Antoine Martin

Status: reopenednew

comment:6 Changed 6 years ago by Antoine Martin

Latest crash with gdb (not very helpful, X11 error coming up in gtk..):

(gdb) bt
#0  0x00007f4c81978e0d in g_logv () from /lib64/libglib-2.0.so.0
#1  0x00007f4c81978ff2 in g_log () from /lib64/libglib-2.0.so.0
#2  0x0000003abdc661eb in gdk_x_error () from /lib64/libgdk-x11-2.0.so.0
#3  0x00007f4c80b3ac2b in _XError () from /lib64/libX11.so.6
#4  0x00007f4c80b37c87 in handle_error () from /lib64/libX11.so.6
#5  0x00007f4c80b37d35 in handle_response () from /lib64/libX11.so.6
#6  0x00007f4c80b38675 in _XEventsQueued () from /lib64/libX11.so.6
#7  0x00007f4c80b2a7dd in XPending () from /lib64/libX11.so.6
#8  0x0000003abdc5aa82 in gdk_event_prepare () from /lib64/libgdk-x11-2.0.so.0
#9  0x00007f4c8197179d in g_main_context_prepare () from /lib64/libglib-2.0.so.0
#10 0x00007f4c81972013 in g_main_context_iterate.isra.22 () from /lib64/libglib-2.0.so.0
#11 0x00007f4c8197255a in g_main_loop_run () from /lib64/libglib-2.0.so.0
#12 0x0000003abe13fdb7 in gtk_main () from /lib64/libgtk-x11-2.0.so.0
#13 0x00007f4c805eac27 in _wrap_gtk_main () from /usr/lib64/python2.7/site-packages/gtk-2.0/gtk/_gtk.so

But still coming from the gl code, client debug log:

_do_paint_rgb24(x=1664, y=1030, width=16, height=16 rowstride=48)
GL Pixmap backing size: 1920 x 1048, drawable=<gtk.gdk.GLWindowImplX11 object at 0x7f4c64a4c2d0 (GdkGLWindowImplX11 at 0x19ceec0)>
present_fbo() drawable=<gtk.gdk.GLWindowImplX11 object at 0x7f4c64a4c2d0 (GdkGLWindowImplX11 at 0x19ceec0)>

(Xpra:14558): Gdk-ERROR **: The program 'Xpra' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
Last edited 6 years ago by Antoine Martin (previous) (diff)

comment:7 Changed 6 years ago by Antoine Martin

Just a thought: do we need clipping when painting with opengl?
How does it cope with us attempting to paint beyond the edges of the drawable?
(the app may resize itself and we get the new size before the previous damage pixels, which may well be sitting outside the window by then)

comment:8 Changed 6 years ago by ahuillet

Clipping should be done properly in that case, but I'm not entirely sure. Can you get an apitrace?

comment:9 Changed 6 years ago by Antoine Martin

Nope, trying to reproduce with debug added - no luck.
It looks like a race, and a pretty random one too.
I've also tried to use xdotool to resize the window size up and down (server side) hundreds of times per second, no luck triggering it, so it may be a red herring.

Last edited 6 years ago by Antoine Martin (previous) (diff)

comment:10 Changed 6 years ago by ahuillet

Does the crash happen all the time?

comment:11 Changed 6 years ago by Antoine Martin

Does the crash happen all the time?


No:

Nope, trying to reproduce with debug added - no luck.

SmO has seen crashes on osx too.

Last edited 6 years ago by Antoine Martin (previous) (diff)

comment:12 Changed 6 years ago by Antoine Martin

Owner: changed from ahuillet to SmO

Maybe this has been fixed by r3894?

SmO: how do I reproduce this? Can you give us a backtrace from osx?

comment:13 Changed 6 years ago by Antoine Martin

Easy way to get a gtk/X11 crash:

--- src/xpra/client/gl/gl_window_backing.py	(revision 3977)
+++ src/xpra/client/gl/gl_window_backing.py	(working copy)
@@ -360,7 +360,8 @@
         return True
 
     def do_video_paint(self, img, x, y, enc_width, enc_height, width, height, options, callbacks):
-        gobject.idle_add(self.gl_paint_planar, img, x, y, enc_width, enc_height, width, height, callbacks)
+        #gobject.idle_add(self.gl_paint_planar, img, x, y, enc_width, enc_height, width, height, callbacks)
+        gobject.timeout_add(3000, self.gl_paint_planar, img, x, y, enc_width, enc_height, width, height, callbacks)
 
     def gl_paint_planar(self, img, x, y, enc_width, enc_height, width, height, callbacks):
         #this function runs in the UI thread, no video_decoder lock held

Then just run "gtkperf -a" in a loop and you will soon get the dreaded X11 error:

(gdb) bt
#0  g_logv (log_domain=0x341a87c066 "Gdk", log_level=G_LOG_LEVEL_ERROR, \
    format=<optimized out>, [email protected]=0x7fffb0f8d6b8) at gmessages.c:981
#1  0x000000372d24eff2 in g_log (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>) at gmessages.c:1010
#2  0x000000341a8661eb in gdk_x_error () from /lib64/libgdk-x11-2.0.so.0
#3  0x0000003477243c2b in _XError ([email protected]=0x1e16310, [email protected]=0x20a76c0) at XlibInt.c:1463
(...)

Good thing is that this is easily reproducible and we can have -d all:

found transient-for: 83117 / <GLClientWindow object at 0x7f5e1459f500 (xpra+client+gtk2+client_window+ClientWindow at 0x5b57150)>
set_window_type(['COMBO']) hints=12
set_fullscreen(False)
make_new_backing(<class 'xpra.client.gtk2.pixmap_backing.PixmapBacking'>, 280, 270) \
    effective backing class=<class 'xpra.client.gtk2.pixmap_backing.PixmapBacking'>, alpha=False
make_new_backing(<class 'xpra.client.gtk2.pixmap_backing.PixmapBacking'>, 280, 270) calling init
window_state_updated(<ClientWindow object at 0x7f5e1459f820 \
    (xpra+client+gtk2+client_window+ClientWindow at 0x5b57260)>, <gtk.gdk.Event at 0x7f5e14597828: GDK_WINDOW_STATE>) \
    new_window_state=<flags 0 of type GdkWindowState>, fullscreen=False, maximized=False
Got configure event: <gtk.gdk.Event at 0x7f5e14597828: GDK_CONFIGURE x=133, y=134, width=280, height=270>
Got map event: <gtk.gdk.Event at 0x7f5e14597828: GDK_MAP> - OR=True
Got configure event: <gtk.gdk.Event at 0x7f5e14597828: GDK_CONFIGURE x=133, y=107, width=280, height=270>
destroy_window(83119, <ClientWindow object at 0x7f5e1459f820 (xpra+client+gtk2+client_window+ClientWindow at 0x5b57260)>)
PixmapBacking(None).close() video_decoder=None
_unfocus() wid=83119
last window for refs [4352] is gone, destroying the group leader <gtk.gdk.Window object at 0x7f5e1459f870 (GdkWindow at 0x1e29c60)>
new hidden group leader window <gtk.gdk.Window object at 0x7f5e1459fb40 (GdkWindow at 0x456bc60)> for ref=4352
get_client_window_class({'fullscreen': False, 'has-alpha': False, 'xid': '0xa0018c', 'pid': 4352, \
    'window-type': ('COMBO',), 'maximized': False, 'transient-for': 83117, 'override-redirect': True}, \
    True) GLClientWindowClass=<class 'xpra.client.gl.gl_client_window.GLClientWindow'>, \
    opengl_enabled=True, mmap_enabled=False, window_types=('COMBO',), encoding=x264
<class 'xpra.client.gtk2.client_window.ClientWindow'>(<XpraClient object at 0x215ffa0 \
    (xpra+client+gtk2+client+XpraClient at 0x1bd7cc0)>, <gtk.gdk.Window object at 0x7f5e1459fb40 (GdkWindow at 0x456bc60)>, \
    83121, 133, 80, 280, 270, \
    {'fullscreen': False, 'has-alpha': False, 'xid': '0xa0018c', 'pid': 4352, \
    'window-type': ('COMBO',), 'maximized': False, 'transient-for': 83117, 'override-redirect': True}, \
    True, {}, 0)
update_metadata({'fullscreen': False, 'has-alpha': False, 'xid': '0xa0018c', 'pid': 4352, \
    'window-type': ('COMBO',), 'maximized': False, 'transient-for': 83117, 'override-redirect': True})
found transient-for: 83117 / <GLClientWindow object at 0x7f5e1459f500 (xpra+client+gtk2+client_window+ClientWindow at 0x5b57150)>
set_window_type(['COMBO']) hints=12
set_fullscreen(False)
make_new_backing(<class 'xpra.client.gtk2.pixmap_backing.PixmapBacking'>, 280, 270) \
    effective backing class=<class 'xpra.client.gtk2.pixmap_backing.PixmapBacking'>, alpha=False
make_new_backing(<class 'xpra.client.gtk2.pixmap_backing.PixmapBacking'>, 280, 270) calling init
window_state_updated(<ClientWindow object at 0x7f5e1459fb90 \
    (xpra+client+gtk2+client_window+ClientWindow at 0x5b57370)>, <gtk.gdk.Event at 0x7f5e14597940: GDK_WINDOW_STATE>) \
    new_window_state=<flags 0 of type GdkWindowState>, fullscreen=False, maximized=False
Last edited 6 years ago by Antoine Martin (previous) (diff)

comment:14 Changed 6 years ago by Antoine Martin

Slightly different patch which delays all paints (inc for non gl windows):

--- src/xpra/client/window_backing_base.py	(revision 3969)
+++ src/xpra/client/window_backing_base.py	(working copy)
@@ -4,6 +4,7 @@
 # Xpra is released under the terms of the GNU GPL v2, or, at your option, any
 # later version. See the file COPYING for details.
 
+import gobject
 import os
 import zlib
 
@@ -307,6 +308,9 @@
 
 
     def draw_region(self, x, y, width, height, coding, img_data, rowstride, options, callbacks):
+        gobject.timeout_add(3000, self.do_draw_region, x, y, width, height, coding, img_data, rowstride, options, callbacks)
+
+    def do_draw_region(self, x, y, width, height, coding, img_data, rowstride, options, callbacks):
         """ dispatches the paint to one of the paint_XXXX methods """
         if DRAW_DEBUG:
             log.info("draw_region(%s, %s, %s, %s, %s, %s bytes, %s, %s, %s)", x, y, width, height, coding, len(img_data), rowstride, options, callbacks)

(still only crashes with gl)

comment:15 Changed 6 years ago by Antoine Martin

A better log sample:

GL do_configure_event(<gtk.gdk.Event at 0x23999b8: GDK_CONFIGURE x=1, y=32, width=500, height=300>)
GL do_configure_event(<gtk.gdk.Event at 0x23999b8: GDK_CONFIGURE x=1, y=32, width=500, height=300>)
GL do_configure_event(<gtk.gdk.Event at 0x23999b8: GDK_CONFIGURE x=1, y=32, width=500, height=300>)
gl_expose_event(<DrawingArea object at 0x5d5be60 (GtkDrawingArea at 0x5d13a70)>, \
    <gtk.gdk.Event at 0x23999b8: GDK_EXPOSE area=[0, 0, 500, 300]>)
GL Pixmap backing size: 500 x 300, drawable=<gtk.gdk.GLWindowImplX11 object at 0x5d609b0 (GdkGLWindowImplX11 at 0x22e7800)>
present_fbo(<gtk.gdk.GLWindowImplX11 object at 0x5d609b0 (GdkGLWindowImplX11 at 0x22e7800)>)
GL do_configure_event(<gtk.gdk.Event at 0x23999e0: GDK_CONFIGURE x=1, y=32, width=545, height=300>)
gl_expose_event(<DrawingArea object at 0x5d5be60 (GtkDrawingArea at 0x5d13a70)>, \
    <gtk.gdk.Event at 0x23999e0: GDK_EXPOSE area=[0, 0, 545, 300]>)
GL Pixmap backing size: 545 x 300, drawable=<gtk.gdk.GLWindowImplX11 object at 0x5d609b0 (GdkGLWindowImplX11 at 0x22e7800)>
present_fbo(<gtk.gdk.GLWindowImplX11 object at 0x5d609b0 (GdkGLWindowImplX11 at 0x22e7800)>)
gl_expose_event(<DrawingArea object at 0x5d5be60 (GtkDrawingArea at 0x5d13a70)>, \
    <gtk.gdk.Event at 0x23999e0: GDK_EXPOSE area=[500, 0, 45, 300]>)
GL Pixmap backing size: 545 x 300, drawable=<gtk.gdk.GLWindowImplX11 object at 0x5d609b0 (GdkGLWindowImplX11 at 0x22e7800)>
present_fbo(<gtk.gdk.GLWindowImplX11 object at 0x5d609b0 (GdkGLWindowImplX11 at 0x22e7800)>)
process_draw 1751 bytes for window 316502 using x264 encoding with \
    options={'quality': 10, 'frame': 1, 'speed': 86, 'csc': 'YUV420P'}

(Xpra:9108): Gdk-ERROR **: The program 'Xpra' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
  (Details: serial 19778 error_code 9 request_code 152 minor_code 4)
(...)

Probably due to window size changes (500x300 vs 545x300)

Maybe we need clipping, or maybe we aren't resizing the backing as we should?

Last edited 6 years ago by Antoine Martin (previous) (diff)

comment:16 Changed 6 years ago by ahuillet

I don't seem to be able to reproduce the problem with either Intel DRI or nvidia.
What OpenGL driver are you using? (glxinfo output)
Can you reproduce the problem with different drivers and machines?

comment:17 Changed 6 years ago by Antoine Martin

Another trace:

update_planar_textures((0, 0, 544, 300, <xpra.codecs.dec_avcodec.decoder.AVImageWrapper object at 0x67323d0>, 'YUV420P'))
Updating planar textures: 544x300 YUV420P
texture 0: div=(1, 1), rowstride=576, 544x300, data=172800 bytes
texture 1: div=(2, 2), rowstride=288, 272x150, data=43200 bytes
texture 2: div=(2, 2), rowstride=288, 272x150, data=43200 bytes
render_planar_update(0, 0, 544, 300, 1, 1) pixel_format=YUV420P
render_planar_update texture_size=(544, 300), size=(545, 300)
present_fbo(<gtk.gdk.GLWindowImplX11 object at 0x6733050 (GdkGLWindowImplX11 at 0x3b6a740)>)
_do_paint_rgb24(x=544, y=0, width=1, height=300 rowstride=3)
GL Pixmap backing size: 545 x 300, drawable=<gtk.gdk.GLWindowImplX11 object at 0x6733050 (GdkGLWindowImplX11 at 0x3b6a740)>
present_fbo(<gtk.gdk.GLWindowImplX11 object at 0x6733050 (GdkGLWindowImplX11 at 0x3b6a740)>)

[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
python: xcb_io.c:274: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.

And one more similar to comment:15:

new hidden group leader window <gtk.gdk.Window object at 0x6f2c370 (GdkWindow at 0x5809900)> for ref=12846
get_client_window_class({'fullscreen': False, 'has-alpha': False, 'xid': '0xa0018c', 'pid': 12846, \
    'window-type': ('COMBO',), 'maximized': False, 'transient-for': 461066, 'override-redirect': True}, \
    True) GLClientWindowClass=<class 'xpra.client.gl.gl_client_window.GLClientWindow'>, \
    opengl_enabled=True, mmap_enabled=False, window_types=('COMBO',), encoding=x264
<class 'xpra.client.gtk2.client_window.ClientWindow'>(\
    <XpraClient object at 0x32750f0 (xpra+client+gtk2+client+XpraClient at 0x2a6ecc0)>, \
    <gtk.gdk.Window object at 0x6f2c370 (GdkWindow at 0x5809900)>, 461108, 133, 107, 280, 270, \
    {'fullscreen': False, 'has-alpha': False, 'xid': '0xa0018c', 'pid': 12846, \
    'window-type': ('COMBO',), 'maximized': False, 'transient-for': 461066, 'override-redirect': True}, \
    True, {}, 0)
update_metadata({'fullscreen': False, 'has-alpha': False, 'xid': '0xa0018c', 'pid': 12846, \
    'window-type': ('COMBO',), 'maximized': False, 'transient-for': 461066, 'override-redirect': True})
found transient-for: 461066 / <GLClientWindow object at 0x6f165a0 (xpra+client+gtk2+client_window+ClientWindow at 0x349d350)>
set_window_type(['COMBO']) hints=12
set_fullscreen(False)
make_new_backing(<class 'xpra.client.gtk2.pixmap_backing.PixmapBacking'>, 280, 270) \
    effective backing class=<class 'xpra.client.gtk2.pixmap_backing.PixmapBacking'>, alpha=False
make_new_backing(<class 'xpra.client.gtk2.pixmap_backing.PixmapBacking'>, 280, 270) calling init
window_state_updated(<ClientWindow object at 0x6f2c5f0 (xpra+client+gtk2+client_window+ClientWindow at 0x701b570)>, \
    <gtk.gdk.Event at 0x6f13800: GDK_WINDOW_STATE>) \
    new_window_state=<flags 0 of type GdkWindowState>, fullscreen=False, maximized=False

(Xpra:12803): Gdk-ERROR **: The program 'Xpra' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
  (Details: serial 12348 error_code 9 request_code 152 minor_code 4)

Changed 6 years ago by Antoine Martin

Attachment: glxinfo.txt added

glxinfo for "Intel Corporation 3rd Gen Core processor Graphics Controller"

comment:18 Changed 6 years ago by Antoine Martin

r4021 improves debug logging.

For the most common crash trace, the normal flow would lead to:

set_window_type(['NORMAL']) hints=0
set_fullscreen(False)
make_new_backing(<class 'xpra.client.gl.gl_window_backing.GLPixmapBacking'>, 500, 300) \
    effective backing class=<class 'xpra.client.gl.gl_window_backing.GLPixmapBacking'>, alpha=False
make_new_backing(<class 'xpra.client.gl.gl_window_backing.GLPixmapBacking'>, 500, 300) calling init
window_state_updated(GLClientWindow(GLPixmapBacking(994927, (500, 300), None)), \
    <gtk.gdk.Event at 0x285b2b0: GDK_WINDOW_STATE>) \
    new_window_state=<flags 0 of type GdkWindowState>, fullscreen=False, maximized=False
GLPixmapBacking(994927, (500, 300), None).gl_expose_event(<DrawingArea object at 0x285ab90 (GtkDrawingArea at 0x5f7e040)>, \
    <gtk.gdk.Event at 0x285b2b0: GDK_EXPOSE area=[0, 0, 200, 200]>)
GLPixmapBacking(994927, (500, 300), None).gl_init() GL Pixmap backing size: 500 x 300, \
    drawable=<gtk.gdk.GLWindowImplX11 object at 0x285acd0 (GdkGLWindowImplX11 at 0x22fb340)>
GLPixmapBacking(994927, (500, 300), None).gl_marker(Initializing GL context for window size 500 x 300)
GLPixmapBacking(994927, (500, 300), None).gl_init() textures of size (500, 300) : [1 2 3 4 5]
GLPixmapBacking(994927, (500, 300), None).gl_marker(Presenting FBO on screen for drawable \
    <gtk.gdk.GLWindowImplX11 object at 0x285acd0 (GdkGLWindowImplX11 at 0x22fb340)>)
GLPixmapBacking(994927, (500, 300), None).gl_marker(Switching to RGB24 paint state)
GLPixmapBacking(994927, (500, 300), None).gl_frame_terminator()
2013-07-30 19:33:02,239 GLPixmapBacking(994927, (500, 300), None).gl_marker(Switching back to YUV paint state)
GLPixmapBacking(994927, (500, 300), None).present_fbo() done
GL do_configure_event(<gtk.gdk.Event at 0x285b2b0: GDK_CONFIGURE x=1, y=32, width=500, height=300>)
Got configure event: <gtk.gdk.Event at 0x285b2b0: GDK_CONFIGURE x=1, y=32, width=500, height=300>
configure-window for wid=994927 with client props={'maximized': False}
GL do_configure_event(<gtk.gdk.Event at 0x285b2b0: GDK_CONFIGURE x=1, y=32, width=500, height=300>)
Got configure event: <gtk.gdk.Event at 0x285b2b0: GDK_CONFIGURE x=1, y=32, width=500, height=300>
configure-window for wid=994927 with client props={'maximized': False}
GL do_configure_event(<gtk.gdk.Event at 0x285b2b0: GDK_CONFIGURE x=1, y=32, width=500, height=300>)
Got configure event: <gtk.gdk.Event at 0x285b2b0: GDK_CONFIGURE x=1, y=32, width=500, height=300>
configure-window for wid=994927 with client props={'maximized': False}
Got map event: <gtk.gdk.Event at 0x285b2b0: GDK_MAP> - OR=False
xget_u32_property(<gtk.gdk.Window object at 0x285acd0 (GdkWindow at 0x229bb40)>, _NET_WM_DESKTOP)=0
do_get_workspace() found value=0 from <gtk.gdk.Window object at 0x285acd0 (GdkWindow at 0x229bb40)> / _NET_WM_DESKTOP
map-window for wid=994927 with client props={'screen': 0, 'workspace': 0, 'maximized': False}
focus-in-event for wid=994927
_focus_change((<GLClientWindow object at 0x285ac80 (xpra+client+gtk2+client_window+ClientWindow at 0x5f6c820)>, \
    <GParamBoolean 'has-toplevel-focus'>)) wid=994927, has-toplevel-focus=True, _been_mapped=True
update_focus(994927, True) _focused=None
send_focus(994927)

So, the window_state_updated is followed by a gl_expose_event and do_configure_event / focus_change.

Also note:

found transient-for: 994927 / GLClientWindow(GLPixmapBacking(994927, (545, 300), None))

So the POPUP window is transient for the GL window (the main gtkperf window) which has a None pixel format (since it has not received its pixels yet)

One can get the crash 100% reliably using a delay of 10s:

--- src/xpra/client/window_backing_base.py	(revision 4007)
+++ src/xpra/client/window_backing_base.py	(working copy)
@@ -321,6 +321,10 @@
 
 
     def draw_region(self, x, y, width, height, coding, img_data, rowstride, options, callbacks):
+        import gobject
+        gobject.timeout_add(10000, self.do_draw_region, x, y, width, height, coding, img_data, rowstride, options, callbacks)
+
+    def do_draw_region(self, x, y, width, height, coding, img_data, rowstride, options, callbacks):
         """ dispatches the paint to one of the paint_XXXX methods """
         if DRAW_DEBUG:
             log.info("draw_region(%s, %s, %s, %s, %s, %s bytes, %s, %s, %s)", x, y, width, height, coding, len(img_data), rowstride, options, callbacks)
Last edited 6 years ago by Antoine Martin (previous) (diff)

Changed 6 years ago by Antoine Martin

ensures we synchronize and trap all X11 calls right out of the packet handler

comment:19 Changed 6 years ago by Antoine Martin

The patch above did not help....

Now here's an xtrace:

000:>:11c3:32: Reply to GetInputFocus: revert-to=Parent(0x02) focus=0x0420018c
2013-07-31 21:17:00,003 destroy_window(277988, <ClientWindow object at 0x7f8b380261e0 (xpra+client+gtk2+client_window+ClientWindow at 0x532ecc0)>)
2013-07-31 21:17:00,003 PixmapBacking(None).close() video_decoder=None
2013-07-31 21:17:00,003 _unfocus() wid=277988
000:<:11c4:  8: DRI2-Request(152,4): DestroyDrawable drawable=0x04200003
000:<:11c5: 28: Request(12): ConfigureWindow window=0x04200209 values={x=133 y=107 width=280 height=270}
000:<:11c6: 96: Request(18): ChangeProperty mode=Replace(0x00) window=0x04200209 property=0x28("WM_NORMAL_HINTS") \
    type=0x29("WM_SIZE_HINTS") \
    data=0x00000214,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, \
    0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001;
000:>:11c4:Error 9=Drawable: major=152, minor=4, bad=69206019
000:>:11c6: Event ConfigureNotify(22) event=0x04200209 window=0x04200209 above-sibling=0x04200098 \
    x=133 y=107 width=280 height=270 border-width=0 override-redirect=true(0x01)
000:<:11c7: 20: Request(12): ConfigureWindow window=0x04200209 values={x=133 y=107}
000:<:11c8: 44: Request(25): SendEvent propagate=false(0x00) destination=0x000000b1 \
    event-mask=SubstructureNotify,SubstructureRedirect ClientMessage(33) format=0x20 window=0x04200209 type=0x14e("_NET_WM_STATE") \
   data=0x00,0x00,0x00,0x00,0x52,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00;
000:>:11c8: Event PropertyNotify(28) window=0x04200209 atom=0x28("WM_NORMAL_HINTS") time=0x08ccf9fd state=NewValue(0x00)
000:<:11c9: 28: Request(18): ChangeProperty mode=Replace(0x00) \
    window=0x04200209 property=0x15b("_NET_WM_WINDOW_TYPE") type=0x4("ATOM") data=0x15c("_NET_WM_WINDOW_TYPE_COMBO");
000:<:11ca: 16: Request(12): ConfigureWindow window=0x04200209 values={stack-mode=Above(0x00)}
000:<:11cb: 60: Request(18): ChangeProperty mode=Replace(0x00) window=0x04200209 property=0x23("WM_HINTS") \
    type=0x23("WM_HINTS") data=0x00000043,0x00000001,0x00000001,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x0420018b;
000:>:11cb: Event PropertyNotify(28) window=0x04200209 atom=0x15b("_NET_WM_WINDOW_TYPE") time=0x08ccf9fe state=NewValue(0x00)
000:<:11cc: 12: Request(19): DeleteProperty window=0x04200209 property=0x14e("_NET_WM_STATE")
000:<:11cd: 12: Request(19): DeleteProperty window=0x04200209 property=0x148("_NET_WM_DESKTOP")
000:>:11cd: Event PropertyNotify(28) window=0x04200209 atom=0x23("WM_HINTS") time=0x08ccf9fe state=NewValue(0x00)
000:<:11ce: 16: Request(2): ChangeWindowAttributes window=0x04200209 value-list={background-pixmap=None(0x00000000)}
000:<:11cf:  8: Request(8): MapWindow window=0x04200209
000:<:11d0: 16: Request(2): ChangeWindowAttributes window=0x04200209 value-list={background-pixel=0x00ededed}
000:<:11d1:  8: Request(54): FreePixmap drawable=0x04200207
000:>:11d1: Event MapNotify(19) event=0x04200209 window=0x04200209 override-redirect=true(0x01)
000:>:11d1: Event VisibilityNotify(15) window=0x04200209 state=Unobscured(0x00)
000:<:11d2: 16: Request(2): ChangeWindowAttributes window=0x0420018b value-list={background-pixmap=None(0x00000000)}
000:>:11d2: Event Expose(12) window=0x04200209 x=0 y=0 width=280 height=270 count=0x0000
000:<:11d3: 16: Request(2): ChangeWindowAttributes window=0x0420004e value-list={background-pixmap=None(0x00000000)}
000:<:11d4: 16: Request(2): ChangeWindowAttributes window=0x04200007 value-list={background-pixmap=None(0x00000000)}
000:<:11d5:  8: Request(10): UnmapWindow window=0x04200209
000:<:11d6: 44: Request(25): SendEvent propagate=false(0x00) destination=0x000000b1 \
   event-mask=SubstructureNotify,SubstructureRedirect UnmapNotify(18) event=0x000000b1 window=0x04200209 from-configure=false(0x00)
000:<:11d7: 16: Request(2): ChangeWindowAttributes window=0x0420018b value-list={background-pixel=0x00ededed}
000:>:11d7: Event UnmapNotify(18) event=0x04200209 window=0x04200209 from-configure=false(0x00)
000:<:11d8: 16: Request(2): ChangeWindowAttributes window=0x0420004e value-list={background-pixel=0x00ededed}
000:<:11d9: 16: Request(2): ChangeWindowAttributes window=0x04200007 value-list={background-pixel=0x00000000}
000:<:11da:  8: SYNC-Request(134,6): DestroyCounter counter=0x0420020b
000:<:11db:  8: Request(4): DestroyWindow window=0x04200209

(Xpra:16438): Gdk-ERROR **: The program 'Xpra' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
  (Details: serial 4548 error_code 9 request_code 152 minor_code 4)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
000:>:11db: Event DestroyNotify(17) event=0x04200209 window=0x04200209
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x23("WM_HINTS") time=0x08ccfa00 state=Deleted(0x01)
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x44("WM_TRANSIENT_FOR") time=0x08ccfa00 state=Deleted(0x01)
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x15a("_NET_WM_SYNC_REQUEST_COUNTER") time=0x08ccfa00 state=Deleted(0x01)
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x15b("_NET_WM_WINDOW_TYPE") time=0x08ccfa00 state=Deleted(0x01)
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x166("_NET_WM_USER_TIME_WINDOW") time=0x08ccfa00 state=Deleted(0x01)
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x13d("WM_CLIENT_LEADER") time=0x08ccfa00 state=Deleted(0x01)
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x14c("_NET_WM_PID") time=0x08ccfa00 state=Deleted(0x01)
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x13f("WM_LOCALE_NAME") time=0x08ccfa00 state=Deleted(0x01)
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x24("WM_CLIENT_MACHINE") time=0x08ccfa00 state=Deleted(0x01)
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x28("WM_NORMAL_HINTS") time=0x08ccfa00 state=Deleted(0x01)
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x140("WM_PROTOCOLS") time=0x08ccfa00 state=Deleted(0x01)
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x43("WM_CLASS") time=0x08ccfa00 state=Deleted(0x01)
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x25("WM_ICON_NAME") time=0x08ccfa00 state=Deleted(0x01)
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x14a("_NET_WM_ICON_NAME") time=0x08ccfa00 state=Deleted(0x01)
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x27("WM_NAME") time=0x08ccfa00 state=Deleted(0x01)
000:>:11db: Event PropertyNotify(28) window=0x04200209 atom=0x14b("_NET_WM_NAME") time=0x08ccfa00 state=Deleted(0x01)

What stands out (the one that is reported as causing the crash):

000:<:11c4:  8: DRI2-Request(152,4): DestroyDrawable drawable=0x04200003
Last edited 6 years ago by Antoine Martin (previous) (diff)

Changed 6 years ago by Antoine Martin

full log of crash in debug mode with xtrace

comment:20 Changed 6 years ago by Antoine Martin

I was often getting some "non-existing PPS 0 referenced" decoding errors before the gl crash (that got fixes somewhere else), so I added code to strengthen error handling in r4049 and raised exceptions at random to see if that would cause the crash... no luck. So maybe the cause was the same (resizing), rather than one causing the other.

comment:21 Changed 6 years ago by Antoine Martin

Resolution: worksforme
Status: newclosed

Hopefully this is a driver thing that will get fixed upstream...
See also ticket:367#comment:9

Note: See TracTickets for help on using tickets.