Skip to content

回复:命令行和 JSON-RPC ​

原始发布页

打开来源页面
查看 1 个交叉存档

好的,我做了一个 bitcoind 构建目标,只链接 wxBase,不链接 GTK。SVN 中的版本是 0.2.7。

我把 ui.cpp 中的初始化和关闭部分拆到 init.cpp,现在 ui.cpp 是纯 UI。ui.h 在 wxUSE_GUI=0 时提供内联存根。我们只有四个从节点接口到 UI 的函数。在 bitcoind 构建中,我们不链接 ui.o 或 uibase.o。

引用 sirius-m 于 2010 年 2 月 25 日下午 04:32:17 的帖子

它马上就开始增加了。我看看 valgrind 能不能帮上忙。

确实感觉可能是 wxWidgets 因为某个 UI 事情失败或某项没有正确初始化而无限重试。我们忽略初始化失败、继续运行的 hack 意味着我们进入了未知领域。我们依赖的是这个模式几乎不使用 wx。它确实还使用少数东西,比如 wxGetTranslation 和 wxMutex。

另一种调试方法是运行 gdb,等一切安静、所有线程都应空闲时中断程序,看看哪个线程正忙于做什么。

我猜 bitcoind 可能会运行正常,但希望你仍然能调试这个问题。

英文原文 ​

展开英文原文

OK, I made a build target bitcoind that only links wxBase and does not link GTK. Version 0.2.7 on SVN.

I split out the init and shutdown stuff from ui.cpp into init.cpp, so now ui.cpp is pure UI. ui.h provides inline stubs if wxUSE_GUI=0. We only have four functions that interface from the node to the UI. In the bitcoind build, we don't link ui.o or uibase.o.

Quote from: sirius-m on February 25, 2010, 04:32:17 PM

It started increasing right away. I'll see if valgrind can help me.

Sure feels like it could be something in wxWidgets retrying endlessly because some UI thing failed or something wasn't inited correctly. Our hack to ignore the initialize failure and run anyway means we're in uncharted territory. We're relying on the fact that we hardly use wx in this mode. We do still use a few things like wxGetTranslation and wxMutex.

Another way to debug would be to run in gdb, wait until everything is quiet and all threads should be idle, and break it and see which thread is busily doing something and what it's doing.

I suspect bitcoind will probably work fine, but I hope you can still debug the problem.

为历史保存,为中文读者整理。每篇档案均附来源与英文原文。