Web lists-archives.com

Re: Self-compiled xorg-server 1.20.0 crashes at startup, buffer overflow




On 31 July 2018 7:57 PM, Jon Turney wrote:
> > -   Dependencies installed as described in https://x.cygwin.com/docs/cg/prog-build-prerequisites.html, plus xcb-composite-devel
>
> Thanks for pointing out this oversight. I will amend the documentation.

Thanks for that. I typoed the package, it should be libxcb-composite-devel.

> I tried to reproduce this problem by following these steps, but the
> produced executable works ok for me.

I tried 3 new machines today, can reproduce the issue in all of them. All were Win7 x86_64. 2 VMs installed from scratch (one in English, the other German as in my first report) plus a system running on bare metal.

> > #7 0x000000018017e7e9 in __chk_fail () at /usr/src/debug/cygwin-2.10.0-1/newlib/libc/ssp/chk_fail.c:11
> > msg = "*** buffer overflow detected ***: terminated\n"
> > #8 0x000000018018c1c3 in __memcpy_chk (dst=0x60008e570, src=0x45, len=0, slen=0) at /usr/src/debug/cygwin-2.10.0-1/newlib/libc/ssp/memcpy_chk.c:48
>
> This is a wrapper around memcpy, which is being used as we are building
> with _FORTIFY_SOURCE
>
> I'd suggest setting a breakpoint on this line (after installing the
> cygwin-debuginfo package for relevant debug info) and trying to
> understand why it's not succeeding.

Attached the backtrace at memcpy_chk.c:48.
I've been trying to figure out what is going on from the source code, but I'm not really getting anywhere.

Does it suffice to install cygwin-debuginfo or do I need to set something up?
I ran gdb with `set cygwin-exceptions on` too, but no further information came up in the backtrace.

No source file named memcpy_chk.c.
Breakpoint 1 (memcpy_chk.c:48) pending.
Starting program: /usr/src/xorg-server-1.20.0-2.src/xorg-server-1.20.0-2.x86_64/src/xserver-cygwin-1.20.0-2/x86_64-pc-cygwin/hw/xwin/XWin -multiwindow
[New Thread 2728.0xb50]
[New Thread 2728.0xaac]
[New Thread 2728.0xa10]
[New Thread 2728.0xbc4]
[New Thread 2728.0xa24]

Thread 1 hit Breakpoint 1, __memcpy_chk (dst=0x60008c7a0, src=0x10059f4b0 <values>, len=8, slen=4)
    at /usr/src/debug/cygwin-2.10.0-1/newlib/libc/ssp/memcpy_chk.c:48
48	/usr/src/debug/cygwin-2.10.0-1/newlib/libc/ssp/memcpy_chk.c: No such file or directory.
#0  __memcpy_chk (dst=0x60008c7a0, src=0x10059f4b0 <values>, len=8, slen=4)
    at /usr/src/debug/cygwin-2.10.0-1/newlib/libc/ssp/memcpy_chk.c:48
No locals.
#1  0x00000001004b80d5 in RRConfigureOutputProperty (output=output@entry=0x60008c6c0, property=<optimized out>, 
    pending=pending@entry=0, range=range@entry=0, immutable=immutable@entry=0, num_values=num_values@entry=2, 
    values=values@entry=0x10059f4b0 <values>) at ../randr/rrproperty.c:385
        prop = 0x600028490
        add = <optimized out>
        new_values = 0x60008c7a0
#2  0x00000001004b682e in RROutputCreate (pScreen=pScreen@entry=0x600077c40, 
    name=name@entry=0x100586942 <__func__.9648+722> "default", nameLength=nameLength@entry=7, devPrivate=devPrivate@entry=0x0)
    at ../randr/rroutput.c:120
        values = {0, 1}
        output = 0x60008c6c0
        outputs = <optimized out>
        nonDesktopAtom = <optimized out>
#3  0x000000010040c11b in winRandRInit (pScreen=pScreen@entry=0x600077c40) at ../hw/xwin/winrandr.c:256
        crtc = 0x600079400
        output = <optimized out>
#4  0x0000000100416e00 in winFinishScreenInitFB (i=<optimized out>, pScreen=0x600077c40, argc=<optimized out>, 
    argv=<optimized out>) at ../hw/xwin/winscrinit.c:343
        pScreenInfo = 0x60004c7b0
        pVisual = <optimized out>
        iReturn = <optimized out>
#5  0x0000000100416a5f in winScreenInit (pScreen=pScreen@entry=0x600077c40, argc=argc@entry=2, argv=argv@entry=0xffffcba0)
    at ../hw/xwin/winscrinit.c:180
        pScreenInfo = 0x60004c7b0
        hdc = <optimized out>
        dwInitialBPP = 0
#6  0x0000000100473d60 in AddScreen (pfnInit=pfnInit@entry=0x100416910 <winScreenInit>, argc=argc@entry=2, 
    argv=argv@entry=0xffffcba0) at ../dix/dispatch.c:3919
        i = 0
        pScreen = 0x600077c40
#7  0x000000010040cd1f in InitOutput (pScreenInfo=pScreenInfo@entry=0x1005fc5e0 <screenInfo>, argc=argc@entry=2, 
    argv=argv@entry=0xffffcba0) at ../hw/xwin/InitOutput.c:972
        i = 0
#8  0x0000000100477aa8 in dix_main (argc=2, argv=0xffffcba0, envp=<optimized out>) at ../dix/main.c:193
        i = <optimized out>
        alwaysCheckForInput = {0, 1}
#9  0x00000001800479b2 in _cygwin_exit_return () at /usr/src/debug/cygwin-2.10.0-1/winsup/cygwin/dcrt0.cc:1018
        newargv = 0xffffcba0
        nav = <optimized out>
        oav = <optimized out>
        __PRETTY_FUNCTION__ = "void dll_crt0_1(void*)"
#10 0x0000000180045653 in _cygtls::call2 (this=0xffffce00, func=0x180046980 <dll_crt0_1(void*)>, arg=0x0, buf=buf@entry=0xffffcdf0)
    at /usr/src/debug/cygwin-2.10.0-1/winsup/cygwin/cygtls.cc:40
        res = <optimized out>
#11 0x0000000180045704 in _cygtls::call (func=<optimized out>, arg=<optimized out>)
    at /usr/src/debug/cygwin-2.10.0-1/winsup/cygwin/cygtls.cc:27
        buf = '\000' <repeats 408 times>...
#12 0x0000000000000000 in ?? ()
No symbol table info available.
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple