After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 569184 - vte generates unnecessary ioctl(I_FIND) kernel warnings
vte generates unnecessary ioctl(I_FIND) kernel warnings
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.16.x
Other All
: Normal minor
: ---
Assigned To: VTE Maintainers
VTE Maintainers
: 562540 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-01-26 12:49 UTC by Thorsten Klein
Modified: 2009-10-24 05:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
isastream patch (976 bytes, patch)
2009-07-03 19:19 UTC, Piotr Engelking
committed Details | Review

Description Thorsten Klein 2009-01-26 12:49:41 UTC
vte should be adjusted to avoid the related ioctl(I_FIND) calls.

Other information:
In pty.c there are three STREAMS-based I_FIND ioctl() calls. STREAMS is not supported in Linux. The code assumes that the existence of the <stropts.h> header file indicates support for this functionality and hence calls it unconditionally. In a 32-bit userland on 64-bit machines this leads to irritating warnings that there is 32-bit compatible implementation of that ioctl():

ioctl32(gnome-terminal:4419): Unknown cmd fd(20) cmd(0000530b){t:'S';sz:0} arg(4eed91aa) on /dev/pts/1

Well, there is no 64-bit compatible version to start with, so this is slightly misleading to start with. I am not sure if a kernel message is also generated in the 64 bit case. But nevertheless, vte could at least have a check around these three ioctl()s to only call them if the fd it is dealing with is a stream. It looks as if <stropts.h> provides the isastream() function for that.

Searching for the above kernel message comes back with quite a lot of hits, so I am not sure whether this has been reported yet. But I was not able to find a bug report.
Comment 1 Christian Persch 2009-01-26 13:08:34 UTC
*** Bug 562540 has been marked as a duplicate of this bug. ***
Comment 2 Christian Persch 2009-01-27 20:21:41 UTC
Just for reference, this code was added back in http://svn.gnome.org/viewvc/vte?view=revision&revision=392 ; it seems this is (or, at least, was) necessary for solaris.
Comment 3 Piotr Engelking 2009-07-03 19:19:23 UTC
Created attachment 137809 [details] [review]
isastream patch

The STREAMS ioctl numbers, as defined by glibc, conflict with Linux CD
ioctls. The bug is caused by vte attempting to use the I_FIND ioctl, which
the kernel interprets as CDROMSUBCHNL, instead.

The attached patch fixed the problem by making sure that the ioctl is used
only on actual STREAMS files.
Comment 4 Behdad Esfahbod 2009-07-04 23:33:23 UTC
My only comment is, how portable is isastream()?
Comment 5 Piotr Engelking 2009-07-05 03:20:17 UTC
Generally, if a system has <stropts.h>, it has isastream(). It is also standardized by SVID and POSIX. See:

http://www.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap02.html#tag_02_01_05_09
Comment 6 Piotr Engelking 2009-09-05 12:50:56 UTC
In case someone might have problems reproducing this, fs/compat_ioctl.c in the Linux kernel limits these messages to only appear 50 times per boot.

(also cc-ing Brian Cameron, perhaps he might want to comment on the patch)
Comment 7 Behdad Esfahbod 2009-09-05 21:29:47 UTC
Can you update the patch to add the autoconf magic for isastream()?
Comment 8 Behdad Esfahbod 2009-10-23 23:13:05 UTC
Ok, committed.  My only question is, why does your Linux system advertise having stropts.h to begin with?  Mine doesn't.
Comment 9 Piotr Engelking 2009-10-24 05:29:58 UTC
Thank you!

I can only guess, but I presume that Debian ships <stropts.h> because glibc upstream does so, and that glibc upstream does so for compatibility with SVID.

I find myself a bit surprised to learn from you that Fedora removed this header, especially considering the historical inclusion of STREAMS in the Red Hat kernel. Such a change must have broken a number of programs.