Opened 10 years ago

Closed 8 years ago

#6945 closed Bugs (fixed)

Handle leak in filesystem::resize_file

Reported by: foryousail@… Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

I have handle leak with filesystem::resize_file if not enough free disk space for resize. File stay locked after exception.

P.S. Using filesystem3 OS: Windows 7

Attachments (1)

patchfile.patch (953 bytes ) - added by Kaylyn Bogle <code@…> 10 years ago.
fixes for aforementioned problem

Download all attachments as: .zip

Change History (4)

comment:1 by Kaylyn Bogle <code@…>, 10 years ago

In libs/filesystem/src/operations.cpp

    return handle != INVALID_HANDLE_VALUE
      && ::SetFilePointerEx(handle, sz, 0, FILE_BEGIN)
      && ::SetEndOfFile(handle)
      && ::CloseHandle(handle);

SetEndOfFile is failing and short-circuiting before CloseHandle is called.

by Kaylyn Bogle <code@…>, 10 years ago

Attachment: patchfile.patch added

fixes for aforementioned problem

comment:2 by anonymous, 8 years ago

still not fixed...

comment:3 by Beman Dawes, 8 years ago

Resolution: fixed
Status: newclosed

Fixed in develop by applying patch from Kaylyn Bogle. Fix should ship with 1.58.0

Thanks,

--Beman

Last edited 8 years ago by Beman Dawes (previous) (diff)
Note: See TracTickets for help on using tickets.