문제

We have a test in our code that tries to tickle a stack-overflow bug (in an old modified version of OpenCV). AFAIK, the test should SEGV if there is actually a stack overflow.

One of our users is getting a test failure because of exception std::bad_alloc thrown. It sounds like this exception is only thrown for heap allocations (results of new operator - http://www.cplusplus.com/reference/std/new/bad_alloc/).

Could this be happening because of a large stack allocation?

For reference, the test is: http://code.google.com/p/modpagespeed/source/browse/trunk/src/net/instaweb/rewriter/image_test.cc#826

and the bug report is: http://code.google.com/p/modpagespeed/issues/detail?id=528

도움이 되었습니까?

해결책

No, this exception is thrown only from operator new/new[].

It could happen even if you don't use operator new/new[] anywhere - the reason - STL containers do use it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top