This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [RFC][PATCH]BZ#2337 Fix for spurious free of user buffer on fclose with wide char orientation.


On Fri, 2006-10-06 at 08:42 -0700, Ulrich Drepper wrote:
> Ryan S. Arnold wrote:
> > RFC regarding bugzilla 2337 -libio in wide mode deallocates user
> > supplied buffer:
> 
> This issue is much more complicated.  Wide streams and user-provided
> buffers are not correctly handled at all in the moment.  The buffer
> should be used for the wide buffers, not the buffers for FILE back
> streams used to store the result of the conversion.  I have been working
> on and off on this.  It'll eventually get fixed, it's just not important
> enough to not be interrupted by other work.
> 
Thanks for the comment Ulrich.

I noticed exactly what you described when I experimented with having
_IO_fwide() set the fp->_wide_data pointers to the non-wide user
supplied buffers fp->_IO_buf_base (et al) during orientation to
wide-char mode.

As you said, and my investigation indicated, the deep write functions
still make use of the non-wide buffers even in wide-char orientation.

I started working on a fix and could continue working on this if you'd
like?  I suspect it'll require providing wide-character functions for
most of the _IO_wfile_jumps vtable entries that currently re-use the
non-wide character oriented functions.

Ryan S. Arnold
IBM Linux Technology Center


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