Bitcointalk · Command Line and JSON-RPC

中本聪,2010 年 2 月 25 日

SN-0379 已核对来源,附原文与上下文。

阅读语言
中文译文

好,我做了一个构建目标 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。

它是立刻开始增长的。我看看 valgrind 能不能帮上忙。

感觉很像是 wxWidgets 里有什么东西在无休止重试——某个 UI 东西失败或没正确初始化。我们那个"忽略初始化失败、照样运行"的 hack,意味着我们正走在无人涉足的地带。我们依赖的事实是:这种模式下我们几乎不用 wx。不过仍有少数东西在用,比如 wxGetTranslation 和 wxMutex。

另一种调试方法是放进 gdb 里运行,等一切安静、所有线程都该空闲时中断它,看看哪个线程在忙、在忙什么。

我猜 bitcoind 大概能正常工作,但还是希望你能把那个问题调试出来。

ORIGINAL · 英文原文
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.

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.
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-0379