This is the mail archive of the glibc-bugs@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]

[Bug stdio/18990] New: fopencookie broken w.r.t seek within buffered range


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.


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