public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: tumtum00 <tumtum00@protonmail.com>
To: The Cygwin Mailing List <cygwin@cygwin.com>
Subject: Re: Self-compiled xorg-server 1.20.0 crashes at startup, buffer overflow
Date: Fri, 03 Aug 2018 17:19:00 -0000	[thread overview]
Message-ID: <3bFLcaKIbW2ReAFfPR_VyPdeLOkhOtZMYWF_LXmhPBuysKqgz4kVUVRqtnu4RsPrGGfgMJSQzeFdAj3HMJgqWzDunzDSdF5kuycnE42YA08=@protonmail.com> (raw)
In-Reply-To: <e95c0d44-ed2f-691f-9605-bb94833453ed@dronecode.org.uk>

[-- Attachment #1: Type: text/plain, Size: 1607 bytes --]

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.


[-- Attachment #2: gdb.txt --]
[-- Type: text/plain, Size: 3579 bytes --]

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?)

[-- Attachment #3: Type: text/plain, Size: 219 bytes --]


--
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

  reply	other threads:[~2018-08-03 17:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-30 17:27 tumtum00
2018-07-30 19:06 ` Marco Atzeri
2018-07-31 16:15 ` tumtum00
2018-07-31 23:18 ` Jon Turney
2018-08-03 17:19   ` tumtum00 [this message]
2018-08-03 18:14     ` Jon Turney
2018-08-06 14:52       ` tumtum00

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='3bFLcaKIbW2ReAFfPR_VyPdeLOkhOtZMYWF_LXmhPBuysKqgz4kVUVRqtnu4RsPrGGfgMJSQzeFdAj3HMJgqWzDunzDSdF5kuycnE42YA08=@protonmail.com' \
    --to=tumtum00@protonmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).