Opened 10 years ago

Closed 10 years ago

#7965 closed Bugs (fixed)

make_shared causes stack overflow with large objects

Reported by: Gregor Jasny <gjasny@…> Owned by: Peter Dimov
Milestone: To Be Determined Component: smart_ptr
Version: Boost 1.52.0 Severity: Problem
Keywords: make_shared stack overflow Cc:

Description

Hello,

if #4256 really fixed the problem, then this is a regression. I encountered the bug with Boost 1.42, 1.44, 1.50, and 1.52.

In my project I have relatively small stack sizes due to a large amount of threads I have to support. Creating objects via boost::make_shared crashes due to large object size. I've attached a test case that shows the problem in MacOSX. If I enable C++11 support and use the smart pointers from std instead of the boost one, everything works fine.

Thanks, Gregor

Attachments (1)

main.cpp (915 bytes ) - added by Gregor Jasny <gjasny@…> 10 years ago.

Download all attachments as: .zip

Change History (3)

by Gregor Jasny <gjasny@…>, 10 years ago

Attachment: main.cpp added

comment:1 by viboes, 10 years ago

Summary: make_chared causes stack overflow with large objectsmake_shared causes stack overflow with large objects

comment:2 by Peter Dimov, 10 years ago

Resolution: fixed
Status: newclosed

(In [83341]) Merged revision(s) 83198 from trunk: Avoid stack overflow in make_shared. Fixes #4256. Fixes #7965.

Note: See TracTickets for help on using tickets.