ArcticaProject / nx-libs

nx-libs
Other
120 stars 39 forks source link

Drag and Drop crashes nxagent #986

Closed uli42 closed 2 years ago

uli42 commented 3 years ago

I accidently moved an icon of the kde taskbar The icon was display during the move but then then session got unresponsive and nxagent crashed. Famous last words:

nxagentSendNotificationToSelfViaXServer: Received SendNotify from client: property [0][(null)] target [0][(null)] selection [350][XdndSelection] requestor [0x5a0b634] time [93526292].
nxagentFindCurrentSelectionIndex: selection [350][XdndSelection] belongs to index [8]
nxagentSendNotificationToSelfViaXServer: lastServers[index].requestor is [0x20].
replyOutstandingRequestSelectionToXServer: Sending negative SelectionNotify event to requestor [0x20].
sendSelectionNotifyEventToXServer: XSendEvent() successfully sent to [0x20]
kded4: Fatal IO error: client killed
Gdk-Message: 11:24:49.627: thunderbird: Fatal IO error 11 (Resource temporarily unavailable) on X server :7834.

The backtrace found in the core dump:

#0  0x00007f5ee573843a in ?? () from /lib64/libstdc++.so.6
#1  0x00007f5ee799ca2c in operator-- (this=<synthetic pointer>) at /usr/include/c++/4.8.2/bits/stl_tree.h:204
#2  _M_get_insert_unique_pos (__k=@0x7fff0b4ee070: 0x2815070 "Lg\006s\265:\244~\f\r\024\240\220\032\265$\377\377\377\377", this=0x1b792b0) at /usr/include/c++/4.8.2/bits/stl_tree.h:1333
#3  std::_Rb_tree<unsigned char*, std::pair<unsigned char* const, int>, std::_Select1st<std::pair<unsigned char* const, int> >, T_less, std::allocator<std::pair<unsigned char* const, int> > >::_M_insert_unique (this=0x1b792b0, __v=...)
    at /usr/include/c++/4.8.2/bits/stl_tree.h:1377
#4  0x00007f5ee799b13c in insert (__x=..., this=<optimized out>) at /usr/include/c++/4.8.2/bits/stl_map.h:595
#5  MessageStore::findOrAdd (this=this@entry=0xd0895d0, message=message@entry=0x1bd1a50, checksumAction=checksumAction@entry=use_checksum, dataAction=dataAction@entry=discard_data, added=@0x7fff0b4ee108: 0, locked=@0x7fff0b4ee10c: 0)
    at Message.cpp:827
#6  0x00007f5ee79377c1 in Channel::handleEncodeCached (this=this@entry=0x4550c10, encodeBuffer=..., channelCache=channelCache@entry=0xadae5d0, store=store@entry=0xd0895d0, buffer=buffer@entry=0xd13dadc "\213\n\020", size=size@entry=64)
    at Channel.cpp:738
#7  0x00007f5ee7938b06 in Channel::handleEncode (this=this@entry=0x4550c10, encodeBuffer=..., channelCache=0xadae5d0, store=0xd0895d0, opcode=<optimized out>, buffer=0xd13dadc "\213\n\020", size=64) at Channel.cpp:213
#8  0x00007f5ee7942b03 in ClientChannel::handleRead (this=0x4550c10, encodeBuffer=..., message=<optimized out>, length=<optimized out>) at ClientChannel.cpp:3016
#9  0x00007f5ee79a9653 in Proxy::handleRead (this=0x3426f40, fd=<optimized out>, data=data@entry=0xd13cd10 "8\032\004", size=8164) at Proxy.cpp:1800
#10 0x00007f5ee795c1cd in NXTransWriteVector (fd=52, iovdata=0x7fff0b4ee3b0, iovsize=2) at Loop.cpp:2181
#11 0x00007f5ee7c68313 in _XSend (dpy=0x1b092b0, data=0x12aad5a8 "", size=40) at XlibInt.c:1871
#12 0x00007f5ee74e405f in XRenderCompositeTrapezoids () from /lib64/libXrender.so.1
#13 0x00000000004a8d5b in nxagentTrapezoids (op=<optimized out>, pSrc=pSrc@entry=0x3974f10, pDst=pDst@entry=0x89fd410, maskFormat=maskFormat@entry=0x17ada20, xSrc=<optimized out>, ySrc=<optimized out>, ntrap=ntrap@entry=1, 
    traps=traps@entry=0x12aad5a8) at Render.c:1846
#14 0x00000000004382bc in ProcRenderTrapezoids (client=0x3a59c50) at NXrender.c:761
#15 0x0000000000432618 in xorg_ProcRenderDispatch (client=<optimized out>) at ../../mi/../render/render.c:2043
#16 ProcRenderDispatch (client=<optimized out>) at NXrender.c:1771
#17 0x0000000000431c23 in Dispatch () at NXdispatch.c:486
#18 0x000000000040f10a in main (argc=20, argv=0x7fff0b4ee778, envp=<optimized out>) at main.c:350

I think this must be a bug in the clipboard code as it only knows about two selections (primary and clipboard, index 0 and 1) but finds index 8, which will read data outside of the array:

nxagentFindCurrentSelectionIndex: selection [350][XdndSelection] belongs to index [8]