[LLVMbugs] [Bug 15659] New: std::vector + emplaced std::istringstream .seekg(0, std::ios_base::beg) leads to missize and trash at end of the stream .str()

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 3 09:07:05 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=15659

            Bug ID: 15659
           Summary: std::vector + emplaced std::istringstream .seekg(0,
                    std::ios_base::beg) leads to missize and trash at end
                    of the stream .str()
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: All Bugs
          Assignee: hhinnant at apple.com
          Reporter: iamtakingiteasy at eientei.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10279
  --> http://llvm.org/bugs/attachment.cgi?id=10279&action=edit
Example testcase

When std::istringstream emplaced into std::vector alongside with other
std::istringstream and then seeked to begening with .seekg(0,
std::ios_base::beg), it size becames largally bigger than original and end of
the stream filled with trash (probably, uninitalized or miss-accessed) data.

It is also known to work as expected on VC++ 2012.

The problem was reproduced with exact observed output by other person with
libc++.

Attaching a simple test-case; compiled with line

$ clang++ -std=c++11 -stdlib=libc++ tmp.cpp && ./a.out

Expected output:

3
MSG
3
31
hub started at [00 6b 8b 45 69]
31


Observed output:

3
MSG
3
31
hub started at [00 6b 8b 45 69]
593

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130403/d60f87c6/attachment.html>


More information about the llvm-bugs mailing list