Bugs item #1520818, was opened at 2006-07-11 14:38 Message generated for change (Comment added) made by nnorwitz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1520818&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Mark Eichin (eichin) Assigned to: Nobody/Anonymous (nobody) Summary: fcntl.ioctl fails to copy back exactly-1024 buffer Initial Comment: The appended code is a simple call of the SCSI Inquiry ioctl, based on what scsi-tools scsiinfo.c does. The intended behaviour is simple - pass it /dev/sg0 (or any scsi device, really) and it pulls out the vendor, product and revision from the returned buffer. However, if you change PAD_SIZE, the behaviour changes: at 1023 and 1025, it does what is expected; at 1024, the second assertion fires, because the array b on output hasn't changed at all. Not sure if there's a different ioctl that can demonstrate this more easily (this needs root and a scsi device, though it does explicitly open it readonly) but it points in the direction of a fencepost error in the "if the supplied buffer is less than 1024 bytes long it is first copied into a static buffer 1024 bytes long which is then passed to ioctl and copied back into the supplied buffer" behaviour in current documentation. observed under: Python 2.4.1 (#2, May 5 2005, 11:32:06) [GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2 (on debian sarge.) I didn't see it mentioned among the ioctl bugs in the sourceforge tracker... ---------------------------------------------------------------------- >Comment By: Neal Norwitz (nnorwitz) Date: 2006-07-11 22:33 Message: Logged In: YES user_id=33168 This code was recently changed. It is not in any released version AFAIK. Can you try 2.5b2 which recently came out? If not, can you try 2.4.3+ from SVN? This is the version that will become 2.4.4. I think the problem may be fixed. The patch was for http://python.org/sf/1433877 . ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1520818&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com