boost::context::basic_segmented_stack 不是按需增长
boost::context::basic_segmented_stack not growing on demand
我有Boost 1.66,C++14,g++ 7.2.0,VM上的Ubuntu 16.04,Intel Core i5。
我正在使用 boost::fiber,就像这个例子 http://www.boost.org/doc/libs/1_65_1/libs/fiber/examples/segmented_stack.cpp 一样。
Boost::fiber relays on boost::context,我想使用 boost::context::basic_segmented_stack,如提供的示例所示。
我按照这些说明 http://www.boost.org/doc/libs/1_66_0/libs/context/doc/html/context/stack/segmented.html
。Boost.Context 必须使用属性分段堆栈构建,例如 工具集=GCC 分段堆栈=打开和应用 BOOST_USE_SEGMENTED_STACKS b2/bjam 命令行。
即第一次运行。/bootstrap.sh --with-libraries=system,program_options,fiber,context ..., then./b2 工具集=gcc segmented-stacks=on ...,并使用-DBOOST_USE_SEGMENTED_STACKS进行编译。
但是,上面的示例在迭代 321 时崩溃:
进程完成,退出代码 139(被信号 11 中断: 西格塞格夫)
使用 basic_fixedsize_stack,它在迭代 354 时崩溃。
但是有了basic_segmented_stack它不应该崩溃,因为堆栈应该按需增长,对吧?那么为什么它不增长呢?
我也用-fsplit-stack编译,但它没有区别。 当我也使用属性context-impl=ucontext运行b2并使用-BOOST_USE_UCONTEXT编译时,我得到了
CMakeFiles/BContext.dir/main.cpp.o:在函数中
boost::context::continuation::~continuation()': /usr/local/include/boost/context/continuation_fcontext.hpp:229: undefined reference to
ontop_fcontext' CMakeFiles/BContext.dir/main.cpp.o:在函数中boost::context::continuation::resume()': /usr/local/include/boost/context/continuation_fcontext.hpp:257: undefined reference to
jump_fcontext' CMakeFiles/BContext.dir/main.cpp.o:在函数'void* boost::context::d etail::create_context2 ...
b2 toolset=gcc segmented-stacks=on cxxflags="-DBOOST_USE_SEGMENTED_STACKS"
为我工作
- C++错误:"error: int aaa::bbb is protected within this context"
- std::stack 是连续的吗?
- 为什么我会收到"Run-Time Check Failure #2 - Stack around the variable 'pr' was corrupted"错误?
- Incomings Call with Android Sip stack in Embarcadero C++ bui
- 堆叠协程 + gdb = "previous frame inner to this frame (corrupt stack)?"
- 生成质数的程序,错误:"Stack overflow"
- 如何在 x64 上"stack oveflow"例外
- 为什么此代码中显示"*** stack smashing detected ***: <unknown> terminated Aborted (core dumped) "错误?
- Qt Creator 在执行步骤 "make" 时出现编译错误,-fno-stack-limit
- 无法在基于 DFS 的任务排序程序中填充"stack"
- std::stack的奇怪行为,pop()返回相同的值
- 使用双LL在C++中实现Stack失败,出现异常"EXC_BAD_ACCESS(代码=2,地址=0x7fff5
- 使用外部依赖项运行 VC++ 单元测试时"Failed to set up execution context"
- 如何获得"基于堆栈"的std::stack?(具有固定的最大尺寸)
- 为什么我会收到"invalid conversion from 'Queue*/Stack*' to 'int'"错误消息?
- 如何修复初始化后'stack around variable was corrupted.'变量未更改为分配的值
- 如何在Qt中调用context.getExternalFilesDir
- Ctypes: OSError: exception: stack overflow
- FLEX/BISON在不同的文件夹中生成location.hh,position.hh,stack.hh
- 'default-initialization in copy-initialization context'在C++中是什么意思?