STLport 崩溃(竞争条件,仅限达尔文?)

发布于 2024-08-23 22:51:12 字数 885 浏览 17 评论 0原文

当我在 Darwin 上运行 STLport 时,我遇到了奇怪的崩溃。 (除了 Mac 之外,我没有在其他地方见过它,但在 i686 和 PowerPC 上崩溃的情况完全相同。)这就是 gdb 中的样子:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
[Switching to process 21097]
0x000000010120f47c in stlp_std::__node_alloc_impl::_M_allocate ()

它可能是 STLport 中的某些设置,我注意到 Mac.h 和 MacOSX。 h 在功能上似乎远远落后。我还知道它一定是某种类型的竞争条件,因为它不仅仅通过调用此方法(隐式调用)而发生。崩溃主要发生在我推送系统时,运行 10 个同时执行大量字符串处理的线程。

我提出的其他理论与编译器标志(配置脚本)和 g++ 4.2 错误有关(似乎 4.4.3 尚未在 Mac 上支持 Objective-C,我需要链接)。

帮助!!! :)

编辑:我运行单元测试,它可以做各种各样的事情。当我启动 10 个推送系统的线程时,就会出现这个问题;它总是归结为 std::string::append 最终归结为 _M_allocate。由于我什至无法获得导致问题的代码的下降转储,我认为我做了一些坏事。难道是因为它试图在指令指针 0x000...000 处执行吗? dynlib 是否在 Windows 中构建为带有跳转表的 DLL?有没有可能这样的跳转表由于某种原因被覆盖了?这可能可以解释这种行为。 (代码很大,如果我没有其他想法,我会在这里发布一个最小崩溃示例。)

When I run STLport on Darwin I get a strange crash. (Haven't seen it anywhere else than on Mac, but exactly same thing crash on both i686 and PowerPC.) This is what it looks like in gdb:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
[Switching to process 21097]
0x000000010120f47c in stlp_std::__node_alloc_impl::_M_allocate ()

It may be some setting in STLport, I noticed that Mac.h and MacOSX.h seemed far behind on features. I also know that it it must be some type of race condition, since it doesn't occur just by calling this method (implicity called). The crash happens mainly when I push the system, running 10 simultaneous threads that do a lot of string handling.

Other theories I come up with have to do with compiler flags (configure script) and g++ 4.2 bugs (seems like 4.4.3 isn't on Mac yet with Objective-C support, which I need to link with).

HELP!!! :)

Edit: I run unit tests, which do all sorts of things. This problem arise when I start 10 threads that push the system; and it always comes down to std::string::append which eventually boils down to _M_allocate. Since I can't even get a descent dump of the code that's causing the problem, I figure I'm doing something bad. Could it be so since it's trying to execute at instruction pointer 0x000...000? Are dynlibs built as DLLs in Windows with a jump table? Could it perhaps be that such a jump table has been overwritten for some reason? That would probably explain this behavior. (The code is huge, if I run out of other ideas, I'll post a minimum crashing sample here.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

离不开的别离 2024-08-30 22:51:12

嗯.. STLPort 使用分配器来获取平台内存并在需要时将其内部池化到数据结构中。

只需检查崩溃发生时,分配给执行线程的堆是否足以发生分配。即使分配失败,也可能会发生这种崩溃。

我不确定您正在处理的当前配置中 STL 分配器的粒度。检查 stl_config.h 来了解这一点。

hmm.. STLPort uses allocaters which takes platform memory and pool it internally to the data structures when needed.

Just check when the crash happens, the heap given to the executing thread is enough for a alloc to happen. Even if an alloc fails, this crash can happen.

I am not sure about the granularity of the STL allocator in the current configuration you are working on. Check stl_config.h for that.

痴意少年 2024-08-30 22:51:12

此问题是由不相关的崩溃错误引起的,导致内存覆盖导致在我的例子中,STLport 崩溃了。

This problem was caused by an unrelated crash bug, causing memory overwrites leading to an STLport crash in my case.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文