Opened 9 years ago

Closed 9 years ago

#9334 closed Bugs (fixed)

Boost 1.55.0 beta1: circular_buffer incompatible with shared memory allocators?

Reported by: Dr Leonid Timochouk <L.Timochouk@…> Owned by: Antony Polukhin
Milestone: Boost 1.56.0 Component: circular_buffer
Version: Boost 1.55.0 Severity: Regression
Keywords: circular buffer interprocess shared memory allocator Cc:

Description

Apparently, because of the use of "placement new" instead of "m_alloc.construct()" used in previous versions, Circular Buffer can no longer be used with allocators which return a pointer type different from void*. In particular, shared memory allocators provided by the Interprocess library result in a compile-time error. This seems to be a serious regression.

Attachments (2)

circular_buffer.patch (2.9 KB ) - added by saleyn@… 9 years ago.
Patch that fixes reported issue with circular buffer
9334.patch (22.6 KB ) - added by Antony Polukhin 9 years ago.
More advanced patch, based on the previous one.

Download all attachments as: .zip

Change History (15)

comment:1 by Jan Gaspar, 9 years ago

Owner: changed from Jan Gaspar to No-Maintainer

comment:2 by anonymous, 9 years ago

I am afraid that this bug has now been hidden away from view because of the owner change, and no Cc: added.

This isssue is making it impossible for me to use the circular_buffer from 1.55.

comment:3 by Jan Gaspar, 9 years ago

Sorry about this, but I'm not maintaining circular_buffer any more.

by saleyn@…, 9 years ago

Attachment: circular_buffer.patch added

Patch that fixes reported issue with circular buffer

comment:4 by saleyn@…, 9 years ago

Who is in charge of maintaining this project, can we get this fix applied to to the new release?

comment:5 by Jan Gaspar, 9 years ago

Sure, you can fix the issue and also you can start maintaining the library if you wish.

in reply to:  5 comment:6 by Serge Aleynikov <saleyn@…>, 9 years ago

Replying to jano_gaspar:

Sure, you can fix the issue and also you can start maintaining the library if you wish.

Do you mind pushing this fix into the release area? Aside from fixing this issue, unfortunately, I have no resources to be able to become the maintainer of this project.

comment:7 by Jan Gaspar, 9 years ago

You need to ask someone at boost dev mailing list to push it for you I'm afraid.

Last edited 9 years ago by Jan Gaspar (previous) (diff)

comment:8 by Antony Polukhin, 9 years ago

Owner: changed from No-Maintainer to Antony Polukhin

comment:9 by Antony Polukhin, 9 years ago

This issue is not as easy as it looks like:

  • Replacing placement new with allocator's construct() breaks move emulation under C++03, where construct accepts parameter by const reference, while Boost.Move requires nonconst reference.
  • Older versions of circular buffer did not work well in DEBUG mode: std::memset was attempting to convert typename Allocator::pointer to void*.

Attached a patch that fixes the issue. Will be applied as soon as the GIT migration will be finished.

by Antony Polukhin, 9 years ago

Attachment: 9334.patch added

More advanced patch, based on the previous one.

comment:10 by Antony Polukhin, 9 years ago

Status: newassigned

in reply to:  9 comment:11 by Serge Aleynikov <saleyn@…>, 9 years ago

Thanks for looking into it!

Replying to apolukhin:

This issue is not as easy as it looks like:

  • Replacing placement new with allocator's construct() breaks move emulation under C++03, where construct accepts parameter by const reference, while Boost.Move requires nonconst reference.
  • Older versions of circular buffer did not work well in DEBUG mode: std::memset was attempting to convert typename Allocator::pointer to void*.

Attached a patch that fixes the issue. Will be applied as soon as the GIT migration will be finished.

comment:12 by Antony Polukhin, 9 years ago

In commit1 and commit2 to GIT's developer branch this issue was addressed.

comment:13 by Antony Polukhin, 9 years ago

Milestone: To Be DeterminedBoost 1.56.0
Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.