From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113534 invoked by alias); 31 Jul 2018 17:57:48 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 113522 invoked by uid 89); 31 Jul 2018 17:57:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=tumtum00, H*RU:!192.168.1.102!, Hx-spam-relays-external:!192.168.1.102!, H*r:ip*192.168.1.102 X-HELO: out1-smtp.messagingengine.com Received: from out1-smtp.messagingengine.com (HELO out1-smtp.messagingengine.com) (66.111.4.25) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 31 Jul 2018 17:57:46 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 76DEB2188F; Tue, 31 Jul 2018 13:57:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 31 Jul 2018 13:57:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :reply-to:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=Kj1D+XhDa+755Szc1cp900Pw5u0ilazzp0QoaOonuIw=; b=MdTe6C/dMlpy wk/hdMz2g2JFU+9A8fAKStm1Y9vgxCcksB8em485bJpprxyxhPZo/HAbx+XHHLAW lBzluexx10biDcNs6uCiJVp2abCZmmdR4qSIu9xzPYaDLNcrZlpw0BWb2gymwXHD q4hKc9eXdwsDMBmDjhmGSe6+BAq6fp7MiCxpASG9flogCT2P2/iAjk0HxQK1hGlu etLLc8c9xbFU4bEoI22nMqPCfwJ7rXfSwzgDQpP3SbaF1AhyftNYTnpElDhoRs6f /udkXWtsFz/rCjXHaCBYbfZj6XLiYdDM974gCW7jr5QQyUZwPXFvtTll07KXOFxi /+wKmeD++w== Received: from [192.168.1.102] (host86-151-121-200.range86-151.btcentralplus.com [86.151.121.200]) by mail.messagingengine.com (Postfix) with ESMTPA id CF62810276; Tue, 31 Jul 2018 13:57:43 -0400 (EDT) Subject: Re: Self-compiled xorg-server 1.20.0 crashes at startup, buffer overflow To: The Cygwin Mailing List References: From: Jon Turney Cc: tumtum00 Reply-To: The Cygwin Mailing List Message-ID: Date: Tue, 31 Jul 2018 23:18:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2018-07/txt/msg00300.txt.bz2 On 30/07/2018 16:33, tumtum00 wrote: > after building xorg-server 1.20.0 without errors, the XWin binary crashes at startup due to a buffer overflow. XWin 1.20.0 from Cygwin repos works as expected. > > Setup: > - Freshly installed Win7 x86_64 VM > - Cygwin x86_64 > - 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. > - Applied the following patches to my Cygwin environment, otherwise the build would fail: > https://github.com/cygwinports/cygport/commit/1072fd872757bd7aa97fa8daf95ed13f70f56291 > https://github.com/cygwinports/cygport/commit/c4e0f0ec5f9a5a691fd19efe2bda3cdf278baef5 > - Downloaded patched xorg-server 1.20.0-2 sources as described in https://x.cygwin.com/docs/cg/prog-obtaining-source.html, "Obtaining via Cygwin setup" > > Build: > $ cygport --64 xorg-server.cygport prep > $ cygport --64 xorg-server.cygport compile > > XWin binary > /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 > is then executed. > > The `--buildtype=debug` option was added to `cygmeson` in `xorg-server.cygport` to generate the attached reports. > > I'm out of ideas on how to continue debugging this. Help would be much appreciated. I tried to reproduce this problem by following these steps, but the produced executable works ok for me. > #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. > No locals. > #9 0x00000001004b80d5 in RRConfigureOutputProperty (output=output@entry=0x60008e570, property=, pending=pending@entry=0, range=range@entry=0, > immutable=immutable@entry=0, num_values=num_values@entry=2, values=values@entry=0x10059f4b0 ) at ../randr/rrproperty.c:385 > prop = 0x60008cff0 > add = > new_values = 0x60008e650 > #10 0x00000001004b682e in RROutputCreate (pScreen=pScreen@entry=0x60008bff0, 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 = 0x60008e570 > outputs = > nonDesktopAtom = > #11 0x000000010040c11b in winRandRInit (pScreen=pScreen@entry=0x60008bff0) at ../hw/xwin/winrandr.c:256 > crtc = 0x60008e240 > output = -- Jon Turney Volunteer Cygwin/X X Server maintainer -- 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