Boost logo

Boost :

From: (noreply_at_[hidden])
Date: 2006-03-18 14:08:48

Patches item #1452698, was opened at 2006-03-17 12:08
Message generated for change (Settings changed) made by mclow
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Jonathan Turkanis (turkanis)
Summary: iostreams // file_descriptor::seek BUG on files > 4 GB

Initial Comment:

Boost 1.33.1
iostreams library
file_descriptor::seek() method
file_descriptor.cpp, line 198
Win32, Visual C++ 2005

The method seek() can return a wrong value of a newly
set offset when the offset is further than 4 GB.

return offset_to_position((lDistanceToMoveHigh << 32)
+ dwResultLow);

The code above has a bug. On 32-bit systems the
expression (lDistanceToMoveHigh << 32) equals to

The correct code should first cast the
lDistanceToMoveHigh variable to 64-bit and then shift

return (static_cast<boost::intmax_t>
lDistanceToMoveHigh) << 32) + dwResultLow;

Sergey Kolodkin


You can respond by visiting:

This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
Boost-bugs mailing list

Boost list run by bdawes at, gregod at, cpdaniel at, john at