This is the mail archive of the cygwin-xfree mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin/X crashes when combined with ssh/nx tunneling and -multiwindow


  > I've applied a fix to address the immediate problem of not checking
  > for the failure, and I've uploaded a snapshot at [1]. Perhaps you
  > could try that and see if it fixes the issue for you?

Yes, this solves the crash problem (thank you!).

  > I would also be interested to know how the icon for the window which
  > was causing this issue appears.

I've attached some screenshots of the taskbar and titlebar icons for Eclipse 4.2 using your XWin.exe build running with an without nx.

The titlebar icon does NOT appear when running Eclipse with vanilla X. The taskbar icon also uses full colors; I do not know if it's a different icon or if nx is using some kind of compression.

The second set of images (eclipse-4_2-nx_2 and eclipse-4_2-nonx_2) indicate the time of crash. When Eclipse starts up is displays a splash image which initially does not have an icon in its titlebar. Notably, a window border only appears when running Eclipse with nx. Despite not having a border, the icon is still relevant because it is the same one used to display in the taskbar.

The crash occurs when the icon is being loaded onto the splash window. To reiterate, the window is NOT created with this icon. It is loaded sometime later while Eclipse is initializing.

  > Hmm... this seems to indicate that icon was of size -1x-1, which
  > doesn't seem right...

Perhaps it has to do with the icon being applied after the window has already been created?

  > From the backtrace, it looks like the crash is occurring due to a
  > failure when converting the X11 icon to a Windows icon, and then not
  > checking properly for that failure.

It looked to me like the crash was occurring at line 264 of icon_convert.c; a memcpy to DIB_pixels which I believe was uninitialized. Regardless, the memcpy is one without verifying DIB_pixels or checking the return value of CreateBitmap.

This is what I has planned to look into.. if I ever get XWin.exe to compile.


(I can't seem to send images to the mailing list, so here they are)

These images illustrate the small titlebar icon and its accompanying taskbar icon:
http://codespunk.com/files/upload/eclipse-4_2-nonx.png
http://codespunk.com/files/upload/eclipse-4_2-nx.png

These images show the splash image and the visible border when using nx:
http://codespunk.com/files/upload/eclipse-4_2-nonx_2.png
http://codespunk.com/files/upload/eclipse-4_2-nx_2.png


On 2:59 PM, Jon TURNEY wrote:
On 15/06/2013 13:06, Matt D. wrote:
"Caught signal 11 (Segmentation fault). Server aborting"

So far I've only been able to duplicate this when tunneling Eclipse. I
tried writing a simple java program that creates a JFrame window but could
not replicate the crash with anything smaller (sorry!). The problem exists
in the two versions I tried: Eclipse 3.6 and 4.2.

I'm afraid your diagnosis is a bit speculative.

From the backtrace, it looks like the crash is occurring due to a failure when
converting the X11 icon to a Windows icon, and then not checking properly for
that failure.

I've applied a fix to address the immediate problem of not checking for the
failure, and I've uploaded a snapshot at [1]. Perhaps you could try that and
see if it fixes the issue for you?  If it does, I would also be interested to
know how the icon for the window which was causing this issue appears.

[1] ftp://cygwin.com/pub/cygwinx/XWin.20130615-git-9a3cc6b8d6f94f74.exe.bz2

Although the error message pops up, Cygwin/X doesn't actually terminate
until the error window that reports the segfault is closed. X continues to
work if I ignore it, however all of the newly created windows do not have
any titlebars or frame borders.

This is because the crash is occurring in the window manager thread, not the
server thread.

This problem does NOT occur when running with either a root window or with the '-rootless' option.

I've attached the XWin backtrace.

Thank you, this was very useful.

#27 0x0042c0fd in NetWMToWinIconAlpha (icon=0xff8d0030)
     at /usr/src/debug/xorg-server-1.14.1-1/hw/xwin/wmutil/icon_convert.c:264
         hdc =<optimized out>
         ii = {fIcon = 1, xHotspot = 0, yHotspot = 0, hbmMask = 0x0,
           hbmColor = 0x0}
         bmh = {bV4Size = 108, bV4Width = -1, bV4Height = 1, bV4Planes = 1,
           bV4BitCount = 32, bV4V4Compression = 3, bV4SizeImage = 0,
           bV4XPelsPerMeter = 0, bV4YPelsPerMeter = 0, bV4ClrUsed = 0,
           bV4ClrImportant = 0, bV4RedMask = 16711680, bV4GreenMask = 65280,
           bV4BlueMask = 255, bV4AlphaMask = 4278190080, bV4CSType = 0,
           bV4Endpoints = {ciexyzRed = {ciexyzX = 0, ciexyzY = 0,
               ciexyzZ = 0}, ciexyzGreen = {ciexyzX = 0, ciexyzY = 0,
               ciexyzZ = 0}, ciexyzBlue = {ciexyzX = 0, ciexyzY = 0,
               ciexyzZ = 0}}, bV4GammaRed = 0, bV4GammaGreen = 0,
           bV4GammaBlue = 0}
         width =<optimized out>
         height = 0
         pixels = 0xff8d0038
         result =<optimized out>
         DIB_pixels = 0x0

Hmm... this seems to indicate that icon was of size -1x-1, which doesn't seem
right...

#28 NetWMToWinIcon (bpp=<optimized out>, icon=0xff8d0030)
     at /usr/src/debug/xorg-server-1.14.1-1/hw/xwin/wmutil/icon_convert.c:358
         hasIconAlphaChannel = true
         versionChecked = true
#29 0x0042c687 in winXIconToHICON (conn=0x802d0cf8, id=10485914, iconSize=32)
     at /usr/src/debug/xorg-server-1.14.1-1/hw/xwin/wmutil/icon_convert.c:438
         mask =<optimized out>
         image = 0x0
         imageMask =<optimized out>
         dst =<optimized out>
         src =<optimized out>
         planes = 1
         bpp = 32
         i =<optimized out>
         biggest_size =<optimized out>
         hDC =<optimized out>
         ii = {fIcon = -1812266357, xHotspot = 2150436088,
           yHotspot = 10485914, hbmMask = 0x1a19be, hbmColor = 0x20}
         hints = {flags = 11, input = 2150436088, initial_state = -2176016,
           icon_pixmap = 1975673360, icon_window = 1710526, icon_x = 1024,
           icon_y = -2175960, icon_mask = 1975680452,
           window_group = 1975680403}
         hIcon = 0x0
         biggest_icon =<optimized out>
         _XA_NET_WM_ICON = 235
         generation = 1
         icon =<optimized out>
         icon_data =<optimized out>
         size =<optimized out>
         cookie =<optimized out>
         reply = 0xff890008
#30 0x004085ff in winUpdateIcon (hWnd=0x1a19be, pDisplay=0x8028efd8,
     id=10485914, hIconNew=0x0)
     at /usr/src/debug/xorg-server-1.14.1-1/hw/xwin/winmultiwindowicons.c:71
         conn = 0x802d0cf8
         hIcon =<optimized out>
         hIconSmall = 0x0
         hIconOld =<optimized out>
#31 0x0041d987 in UpdateIcon (iWindow=10485914, pWMInfo=<optimized out>)
     at /usr/src/debug/xorg-server-1.14.1-1/hw/xwin/winmultiwindowwm.c:666
         hWnd = 0x1a19be
         hIconNew =<optimized out>
         attr = {x = 2014, y = 389, width = 452, height = 302,
           border_width = 0, depth = 24, visual = 0x802dc4e0, root = 534,
           class = 1, bit_gravity = 1, win_gravity = 1, backing_store = 0,
           backing_planes = 4294967295, backing_pixel = 0, save_under = 0,
           colormap = 10485886, map_installed = 0, map_state = 2,
           all_event_masks = 6537343, your_event_mask = 0,
           do_not_propagate_mask = 0, override_redirect = 0,
           screen = 0x802dc430}
#32 0x0041f3b9 in winMultiWindowWMProc (pArg=0x80046368)
     at /usr/src/debug/xorg-server-1.14.1-1/hw/xwin/winmultiwindowwm.c:928
         pNode = 0x8031fab0
         __cleanup_handler = {function = 0x41d260<winMultiWindowThreadExit>,
           arg = 0x0, next = 0x0}
         pProcArg = 0x80046368
         pWMInfo = 0x80046378
#33 0x610ffe1a in pthread::thread_init_wrapper(void*)@4 (arg=0x80040090)
     at /usr/src/debug/cygwin-1.7.20-1/winsup/cygwin/thread.cc:1947
         thread = 0x80040090
         __PRETTY_FUNCTION__ = "static DWORD pthread::thread_init_wrapper(void*)"
         ret =<optimized out>
#34 0x6108974c in thread_wrapper (arg=0x0)
     at /usr/src/debug/cygwin-1.7.20-1/winsup/cygwin/miscfuncs.cc:600
         dealloc_addr =<optimized out>
         count =<optimized out>
         wrapper_arg = {func = 0x0, arg = 0x0, stackaddr = 0x0,
           stackbase = 0x0, stacklimit = 0x0}
         old_start = 0x610d9285<_sigbe>





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]