From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26942 invoked by alias); 6 Oct 2006 06:00:37 -0000 Received: (qmail 26848 invoked by uid 48); 6 Oct 2006 06:00:26 -0000 Date: Fri, 06 Oct 2006 06:00:00 -0000 Message-ID: <20061006060026.26847.qmail@sourceware.org> From: "rsa at us dot ibm dot com" To: glibc-bugs@sources.redhat.com In-Reply-To: <20060214170527.2337.Petr.Salinger@seznam.cz> References: <20060214170527.2337.Petr.Salinger@seznam.cz> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/2337] libio in wide mode deallocates user supplied buffer X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00027.txt.bz2 List-Id: ------- Additional Comments From rsa at us dot ibm dot com 2006-10-06 06:00 ------- Created an attachment (id=1351) --> (http://sourceware.org/bugzilla/attachment.cgi?id=1351&action=view) libio patch to prevent spurious deallocation of user supplied buffer. Directing wide-character IO to use the user supplied buffer proved to be problematic because the wide character operations make use of the non-wide character buffer for write operations. The least intrusive solution was to clean up the IO file finish path. The wide character jump vtable is initialized such that wide-character IO uses the default (non-wide) _IO_file_finish() function (probably an oversight) which invokes _IO_default_finish(). This ends up checking and clearing the non-wide user buffer spuriously in _IO_new_fclose(). I created a wide-character oriented file finish function _IO_wfile_finish() which calls the already existing _IO_wdefault_finish() function and I added it to the wide IO jump table as the default IO file finish function. This solved the problem and wide character IO now finishes in a manner consistent with the IO orientation. I've only tested this on PowerPC thus far. -- http://sourceware.org/bugzilla/show_bug.cgi?id=2337 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.