GNOME Bugzilla – Bug 126554
vte doesn't work on NetBSD/sparc-1.5
Last modified: 2005-08-15 01:29:26 UTC
$ vte ** (vte:16110): WARNING **: Error setting PTY size: Bad file descriptor. ** (vte:16110): WARNING **: Error reading PTY size, using defaults: Bad file descriptor. (vte:16110): GLib-WARNING **: giounix.c:397:g_io_unix_get_flags()Error while getting flags for FD: Bad file descriptor (9) (vte:16110): GLib-WARNING **: giounix.c:397:g_io_unix_get_flags()Error while getting flags for FD: Bad file descriptor (9) ** (vte:16110): WARNING **: Error reading PTY size, using defaults: Bad file descriptor. ** (vte:16110): WARNING **: Error setting PTY size: Bad file descriptor. ** (vte:16110): WARNING **: Error reading PTY size, using defaults: Bad file descriptor. Detected child exit. $
Adding the portability keyword.
Created attachment 34518 [details] [review] patch The problem is in gnome-pty-helper. It assumes that CMSG_DATA() points to the byte immediately after the end of the struct cmsghdr, but if you look at sys/socket.h, you'll see it actually adds padding in some cases to make CMSG_DATA be longword-aligned. On Linux, cmsghdr is 12 bytes long on 32bit platforms and 16 bytes long on 64bit platforms, so there never ends up being any padding. But on NetBSD, you do end up with padding on some architectures (including Sparc apparently, and anything 64bit). The attached patch fixes the definition of CONTROLLEN to take the padding into account.
Adrian, can you confirm that this patch fixes the problem for you?
Unfortunately, I do no longer have access to any NetBSD machines.
Ah, this bug affects OpenBSD 3.7 and -current on macppc as well. That happens to be what I'm running and how I found this bug. I'll download the patch and apply it tonight, will update with my results later.
Created attachment 50250 [details] [review] Corrected patch Originally proposed patch doesn't work... need to set CONTROLLEN to a value before malloc()ing based on it. :) Swapped those two lines, however, and all works great! Gnome-terminal no longer crashes due to vte. I have recreated the patch and attached here. Patch is against 0.11.12.
Commited this. Will be in 0.11.15. Thanks to everyone involved in tracking down this problem.