原始文献 / 论坛帖 / Re: Command Line and JSON-RPC
Re: Command Line and JSON-RPC
Bitcointalk · 2010-02-25 22:54:17 UTC
好的,我加了一个构建目标 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(February 25, 2010, 04:32:17 PM)(https://bitcointalk.org/index.php?topic=63.msg538#msg538):
它一启动就开始涨。我看看 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(https://bitcointalk.org/index.php?topic=63.msg538#msg538):
> 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.
