[PATCH libXaw] obtaining textSink.textProperties by editres triggers sigsegv in inspected application

walter harms wharms at bfs.de
Tue Aug 18 08:35:39 PDT 2015



Am 17.08.2015 21:38, schrieb Yuriy M. Kaminskiy:
> Hello!
> 
> (copied from downstream bugreport: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790325):
> 
> 1. Run xconsole
> 2. Run editres
> 3. Do "Commands|Get Tree" in editres, point to xconsole window
> 4. In editres: select textSink widget (left mouse click), do
> "Commands|Show Resource Box"
> 5. In Resource box, do middle-click on textProperties (to get current
> "Resource Value").
> 
> xconsole dies with SIGSEGV:
> (gdb) bt
> #0  0xf7f75c2f in CvtPropertyListToString (dpy=0x80502f8, args=0x0,
> num_args=0xffffb004, fromVal=0xffffb158, toVal=0xffffb150,
> converter_data=0xffffafd8) at ../../src/TextSink.c:1812
> #1  0xf7ecdc20 in CallConverter (dpy=0x80502f8,
> converter=0xf7f75c10 <CvtPropertyListToString>, args=0x0, num_args=0,
> from=0xffffb158, to=0xffffb150, cache_ref_return=0xffffb0d8,
> cP=0x8068dc0)
>     at ../../src/Convert.c:733
> #2  0xf7ece8a5 in _XtConvert (widget=0x8068e18, from_type=680,
> from=0xffffb158, to_type=1, to=0xffffb150,
> cache_ref_return=0xffffb0d8)
>     at ../../src/Convert.c:904
> #3  0xf7ecef3e in XtConvertAndStore (object=0x8068e18,
> from_type_str=0xf7f8f910 "XawTextProperties", from=0xffffb158,
> to_type_str=0x804c225 <XtStrings+1797> "String", to=0xffffb150)
>     at ../../src/Convert.c:1013
> #4  0xf7f3209b in ?? () from /usr/lib/i386-linux-gnu/libXmu.so.6
> #5  0xf7f331de in ?? () from /usr/lib/i386-linux-gnu/libXmu.so.6
> #6  0xf7f339db in ?? () from /usr/lib/i386-linux-gnu/libXmu.so.6
> #7  0xf7ecad74 in HandleNormal (dpy=dpy at entry=0x80502f8,
> widget=widget at entry=0x80648a0, property=639, info=0x806ee38,
> closure=0x12,     selection=896) at ../../src/Selection.c:1325
> #8  0xf7eecb22 in HandleSelectionReplies (widget=0x80648a0,
> closure=0x806ee38,     ev=0xffffd57c, cont=0xffffd354 "\001") at
> ../../src/Selection.c:1425
> #9  0xf7ed9c9e in CallEventHandlers (mask=<optimized out>,
> event=0xffffd57c,     widget=0x80648a0) at ../../src/Event.c:773
> #10 XtDispatchEventToWidget (widget=0x80648a0, event=0xffffd57c)
>     at ../../src/Event.c:878
> #11 0xf7eda21d in DispatchEvent (widget=<optimized out>,
> event=<optimized out>)
>     at ../../src/Event.c:1288
> #12 _XtDefaultDispatcher (event=0xffffd57c) at ../../src/Event.c:1350
> #13 0xf7eda41b in XtDispatchEvent (event=0xffffd57c) at
> ../../src/Event.c:1423
> #14 0xf7ee6128 in XtAppProcessEvent (app=0x804f868, mask=15)
>     at ../../src/NextEvent.c:1397
> #15 0xf7eda86b in XtAppMainLoop (app=0x804f868) at ../../src/Event.c:1554
> #16 0xf7eda8ad in XtMainLoop () at ../../src/Event.c:1546
> #17 0x080493a8 in ?? ()
> #18 0xf7bd8a63 in __libc_start_main (main=0x80491f0, argc=1,
> argv=0xffffd754,     init=0x804a1b0, fini=0x804a220,
> rtld_fini=0xf7febc90 <_dl_fini>,     stack_end=0xffffd74c) at
> libc-start.c:287
> #19 0x08049418 in ?? ()
> (gdb) print propl
> $1 = (XawTextPropertyList *) 0x0
> 
> Attached patch plugs this SIGSEGV, but I'm not sure if it is 100%
> correct or sufficient.
> 
> 

this look more "natural" for me ...

propl = *(XawTextPropertyList**)fromVal[0].addr;
if (!propl)
   return (False);


otherwise the patch seems ok.

Reviewed-by: wharms <wharms at bfs.de>


More information about the xorg-devel mailing list