Web lists-archives.com

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




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

Hello all,

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

Attachment: gdb-bt-full
Description: Binary data

Could not load crashreporter dll
InitConnectionLimits: MaxClients = 2048
Welcome to the XWin X Server
Vendor: The Cygwin/X Project
Release: 1.20.0.0
OS: CYGWIN_NT-6.1 qwe-PC 2.10.0(0.325/5/3) 2018-02-02 15:16 x86_64
OS: Windows 7 Service Pack 1 [Windows NT 6.1 build 7601] (Win64)
Package: version 1.20.0-2 built 2018-07-30

XWin was started with the following command line:


 /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 
 -logverbose 3 -multiwindow 

ddxProcessArgument - Initializing default screens
winInitializeScreenDefaults - primary monitor w 1920 h 1200
winInitializeScreenDefaults - native DPI x 96 y 96
ddxProcessArgument - arg: -logverbose
ddxProcessArgument - arg: -multiwindow
[  8311.718] Could not load crashreporter dll
[  8311.718] OsVendorInit - Creating default screen 0
[  8311.718] winInitializeScreens - 1
[  8311.718] winInitializeScreen - 0
[  8312.015] InitOutput
[  8312.015] winValidateArgs - Returning.
[  8312.015] (II) xorg.conf is not supported
[  8312.015] (II) See http://x.cygwin.com/docs/faq/cygwin-x-faq.html for more information
[  8312.015] LoadPreferences: /home/qwe/.XWinrc not found
[  8312.015] LoadPreferences: Loading /etc/X11/system.XWinrc
[  8312.015] LoadPreferences: Done parsing the configuration file...
[  8312.015] winGetDisplay: DISPLAY=:0.0
[  8312.015] winDetectSupportedEngines - RemoteSession: no
[  8312.156] winDetectSupportedEngines - DirectDraw4 installed, allowing ShadowDDNL
[  8312.156] winDetectSupportedEngines - Returning, supported engines 00000005
[  8312.156] winMsgWindowThreadProc - Hello
[  8312.156] winScreenInit - dwWidth: 1920 dwHeight: 1200
[  8312.156] winAllocateScreenPrivates - g_ulServerGeneration: 0 serverGeneration: 1
[  8312.156] winSetEngine - Multi Window or Rootless => ShadowGDI
[  8312.156] winScreenInit - Using Windows display depth of 32 bits per pixel
[  8312.156] winCreateBoundingWindowWindowed - User w: 1920 h: 1200
[  8312.156] winCreateBoundingWindowWindowed - Current w: 1920 h: 1200
[  8312.156] winGetWorkArea - Primary Monitor WorkArea: 0 0 1170 1920
[  8312.156] winGetWorkArea - Virtual screen is 1920 x 1200
[  8312.156] winGetWorkArea - Virtual screen origin is 0, 0
[  8312.156] winGetWorkArea - Primary screen is 1920 x 1200
[  8312.156] winGetWorkArea - Adjusted WorkArea for multiple monitors: 0 0 1170 1920
[  8312.156] winAdjustForAutoHide - Original WorkArea: 0 0 1170 1920
[  8312.156] winAdjustForAutoHide - Adjusted WorkArea: 0 0 1170 1920
[  8312.156] winCreateBoundingWindowWindowed - User did not give height and width
[  8312.156] winCreateMsgWindow - Created msg window hwnd 0x0x7038e
[  8312.171] winWindowProc - WM_CREATE
[  8312.171] winWindowProc - WM_SIZE
[  8312.171] winCreateBoundingWindowWindowed - CreateWindowEx () returned
[  8312.171] winCreateBoundingWindowWindowed - WindowClient w 1920  h 1200 r 1920 l 0 b 1200 t 0
[  8312.171] winCreateBoundingWindowWindowed -  Returning
[  8312.171] winQueryScreenDIBFormat - First call masks: 00000000 00000000 00000000
[  8312.171] winQueryScreenDIBFormat - First call masks: 00000000 00000000 00000000
[  8312.171] winQueryRGBBitsAndMasks - Masks: 00ff0000 0000ff00 000000ff
[  8312.171] winQueryRGBBitsAndMasks - Bitmap: 1x1 32 bpp 1 planes
[  8312.171] winQueryRGBBitsAndMasks - Compression: 3 (BI_BITFIELDS)
[  8312.171] winAllocateFBShadowGDI - Creating DIB with width: 1920 height: 1200 depth: 32
[  8312.171] winAllocateFBShadowGDI - Shadow buffer allocated
[  8312.171] winAllocateFBShadowGDI - Dibsection width: 1920 height: 1200 depth: 32 size image: 9216000
[  8312.171] winAllocateFBShadowGDI - Attempting a shadow blit
[  8312.171] winAllocateFBShadowGDI - Shadow blit success
[  8312.171] winAllocateFBShadowGDI - Created shadow stride: 1920
[  8312.171] winFinishScreenInitFB - Masks: 00ff0000 0000ff00 000000ff
[  8312.171] winInitVisualsShadowGDI - Masks 00ff0000 0000ff00 000000ff BPRGB 8 d 24 bpp 32
[  8312.171] winInitVisualsShadowGDI - Returning
[  8312.171] winRandRInit ()

Attachment: cygckeck.out
Description: Binary data

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