This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug stdio/18990] New: fopencookie broken w.r.t seek within buffered range
- From: "luoqi.chen at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 22 Sep 2015 09:36:01 +0000
- Subject: [Bug stdio/18990] New: fopencookie broken w.r.t seek within buffered range
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=18990
Bug ID: 18990
Summary: fopencookie broken w.r.t seek within buffered range
Product: glibc
Version: 2.24
Status: NEW
Severity: critical
Priority: P2
Component: stdio
Assignee: unassigned at sourceware dot org
Reporter: luoqi.chen at gmail dot com
Target Milestone: ---
The culprit is the _IO_cookie_seekoff() method, which invalidates the
fp->_offset before performing an actual seek. After fp->_offset is invalidated,
there's no way for the underlying seek algorithm (_IO_new_file_seekoff) to
determine if any part of the buffered data is reusable. This destruction of
buffered data effectively renders fopencookie() useless, except for the
simplest sequential access scenario.
--
You are receiving this mail because:
You are on the CC list for the bug.