본문으로 건너뛰기

이메일 #171 - #175

원본 출처: Satoshi - Sirius emails 2009-2011

이메일 #171

Date: Tue, 23 Feb 2010 16:47:59 +0200
From: [email protected]
To: Satoshi Nakamoto <[email protected]>
Subject: Re: Non-GUI option

한글 번역

같은 바이너리를 GUI 없이 실행하는 방법에 대해 찾은 단서가 몇 가지 있습니다:

  1. GTK는 디스플레이 없이 프로그램을 실행하는 것을 지원합니다: http://library.gnome.org/devel/gtk/2.12/gtk-General.html#gtk-init-check. 하지만 이것만으로는 wxWidgets에서 가능한지는 알 수 없습니다.

wxApp::Initialize에서 gtk-init-check를 호출하는 것을 확인했습니다.

Initialize를 하위 클래스로 만들어서 원래 함수를 호출하면서 오류 메시지는 나오지 않게 하고 반환 값은 무시할 수 있습니다. 동작하는 것 같습니다.

이 방법이 동작합니다. 몇 가지만 더 손보고 올리겠습니다.

사람들에게 GTK 라이브러리를 설치하라고 알려줘야 할 겁니다. GTK를 설치하는 apt-get 명령어가 기억나세요, 그리고 GUI가 설치되어 있지 않은 상태에서도 설치할 수 있나요?

아마 apt-get install libgtk2.0-0였을 겁니다. 설치 가능한 패키지는 이렇게 검색할 수 있습니다: "apt-cache search libgtk".

bitcoin.org 번역자들에게 Drupal 계정을 주겠습니다, 그래서 번역을 최신 상태로 유지할 수 있게 하겠습니다.

영어 원문

>>> Just a few clues I've found about running the same binary without a GUI:
>>>
>>> 1) GTK supports running a program without display:
>>> http://library.gnome.org/devel/gtk/2.12/gtk-General.html#gtk-init-check.
>>> This doesn't tell if it's possible in wxWidgets though.
>>
>> I see it calls gtk-init-check in wxApp::Initialize.
>>
>> I can subclass Initialize, call the original one while suppressing
>> the error message and ignore the return value. It seems to be
>> working.
>
> This is working. A few more things and I'll upload it.
>
> We'll need to tell people to install the GTK libraries. Do you
> remember the apt-get command to install GTK, and can you install it
> without having a GUI installed?

It was probably apt-get install libgtk2.0-0. You can search for
available packages like this: "apt-cache search libgtk".

I'll give Drupal accounts to the bitcoin.org translators, so they can
keep the translations up to date.

이메일 #172

Date: Wed, 24 Feb 2010 06:34:52 +0000
From: Satoshi Nakamoto <[email protected]>
Subject: Re: Non-GUI option
To: [email protected]

한글 번역

bitcoin.org 번역자들에게 Drupal 계정을 주겠습니다, 그래서 번역을 최신 상태로 유지할 수 있게 하겠습니다.

좋습니다, 그러면 그들에게 약간의 주인의식과 책임감을 주겠네요.

0.3 릴리스에 넣을 수 있도록 소프트웨어 번역용 .mo 파일을 적어도 하나는 제때 받을 수 있기를 바랍니다.

영어 원문

> I'll give Drupal accounts to the bitcoin.org translators, so they can 
> keep the translations up to date.

Good, that gives them a little sense of ownership and responsibility.

I hope we get at least one .mo file for the software translation in time
to put into the 0.3 release.

이메일 #173

Date: Sun, 28 Feb 2010 06:12:44 +0200
From: [email protected]
To: Satoshi Nakamoto <[email protected]>
Subject: Bitcoind

한글 번역

제 bitcoind 빌드를 ddd 디버거로 디버깅해 봤는데, 아직 별 성과를 거두지 못했습니다. 항상 시스템 메모리를 전부 차지하고 결국 충돌합니다. 최신 64비트 bitcoind 빌드를 다시 보내주실 수 있을까요, 그래서 제 빌드 문제인지 확인할 수 있게 해주세요.

영어 원문

I tried debugging my build of bitcoind with ddd debugger, but didn't  
have much success yet. It always ends up taking all the system's
memory and finally crashes. Could you please send me again the latest
64 bit build of bitcoind, so I can see if the problem is about my build?

이메일 #174

Date: Sun, 28 Feb 2010 14:47:01 +0000
From: Satoshi Nakamoto <[email protected]>
Subject: Re: Bitcoind
To: [email protected]

한글 번역

bitcoin.org/download/linux64-0.2.7.1.tar.gz에 올려 두었습니다. 받으시면 지우셔도 됩니다.

겪고 계신 문제의 원인일 수 있는 부분을 생각해 보고 이번 빌드에 들어간 변경을 하나 만들었습니다. 아마 항상 운 좋게 넘어갔겠지만, 안전하지 않은 코드였을 수 있습니다.

util.cpp에서, 기존 코드:

const char* wxGetTranslation(const char* pszEnglish) { // Wrapper of wxGetTranslation returning the same const char* type as was passed in static CCriticalSection cs; CRITICAL_BLOCK(cs) { // Look in cache static map<string, char*> mapCache; map<string, char*>::iterator mi = mapCache.find(pszEnglish); if (mi != mapCache.end()) return (*mi).second;

// wxWidgets translation const char* pszTranslated = wxGetTranslation(wxString(pszEnglish, wxConvUTF8)).utf8_str();

// We don't cache unknown strings because caller might be passing in a // dynamic string and we would keep allocating memory for each variation. if (strcmp(pszEnglish, pszTranslated) == 0) return pszEnglish;

// Add to cache, memory doesn't need to be freed. We only cache because // we must pass back a pointer to permanently allocated memory. char* pszCached = new char[strlen(pszTranslated)+1]; strcpy(pszCached, pszTranslated); mapCache[pszEnglish] = pszCached; return pszCached; } return NULL; }

변경 후:

const char* wxGetTranslation(const char* pszEnglish) { // Wrapper of wxGetTranslation returning the same const char* type as was passed in static CCriticalSection cs; CRITICAL_BLOCK(cs) { // Look in cache static map<string, char*> mapCache; map<string, char*>::iterator mi = mapCache.find(pszEnglish); if (mi != mapCache.end()) return (*mi).second;

// wxWidgets translation wxString strTranslated = wxGetTranslation(wxString(pszEnglish, wxConvUTF8));

// We don't cache unknown strings because caller might be passing in a // dynamic string and we would keep allocating memory for each variation. if (strcmp(pszEnglish, strTranslated.utf8_str()) == 0) return pszEnglish;

// Add to cache, memory doesn't need to be freed. We only cache because // we must pass back a pointer to permanently allocated memory. char* pszCached = new char[strlen(strTranslated.utf8_str())+1]; strcpy(pszCached, strTranslated.utf8_str()); mapCache[pszEnglish] = pszCached; return pszCached; } return NULL; }

이 코드가 여전히 의심스러우시면, 테스트용으로 이렇게 바꿔 보실 수 있습니다:

const char* wxGetTranslation(const char* pszEnglish) { return pszEnglish; }

[email protected]님이 쓰신 글:

제 bitcoind 빌드를 ddd 디버거로 디버깅해 봤는데, 아직 별 성과를 거두지 못했습니다. 항상 시스템 메모리를 전부 차지하고 결국 충돌합니다. 최신 64비트 bitcoind 빌드를 다시 보내주실 수 있을까요, 그래서 제 빌드 문제인지 확인할 수 있게 해주세요.

영어 원문

I put it at bitcoin.org/download/linux64-0.2.7.1.tar.gz.  You can delete 
it when you've got it.

I thought about what might cause the problem you're having and made a
change that this build includes. This might have been unsafe code,
although it would probably always get lucky.

in util.cpp, old:
const char* wxGetTranslation(const char* pszEnglish)
{
// Wrapper of wxGetTranslation returning the same const char* type
as was passed in
static CCriticalSection cs;
CRITICAL_BLOCK(cs)
{
// Look in cache
static map<string, char*> mapCache;
map<string, char*>::iterator mi = mapCache.find(pszEnglish);
if (mi != mapCache.end())
return (*mi).second;

// wxWidgets translation
const char* pszTranslated =
wxGetTranslation(wxString(pszEnglish, wxConvUTF8)).utf8_str();

// We don't cache unknown strings because caller might be
passing in a
// dynamic string and we would keep allocating memory for each
variation.
if (strcmp(pszEnglish, pszTranslated) == 0)
return pszEnglish;

// Add to cache, memory doesn't need to be freed. We only
cache because
// we must pass back a pointer to permanently allocated memory.
char* pszCached = new char[strlen(pszTranslated)+1];
strcpy(pszCached, pszTranslated);
mapCache[pszEnglish] = pszCached;
return pszCached;
}
return NULL;
}

new:
const char* wxGetTranslation(const char* pszEnglish)
{
// Wrapper of wxGetTranslation returning the same const char* type
as was passed in
static CCriticalSection cs;
CRITICAL_BLOCK(cs)
{
// Look in cache
static map<string, char*> mapCache;
map<string, char*>::iterator mi = mapCache.find(pszEnglish);
if (mi != mapCache.end())
return (*mi).second;

// wxWidgets translation
wxString strTranslated = wxGetTranslation(wxString(pszEnglish,
wxConvUTF8));

// We don't cache unknown strings because caller might be
passing in a
// dynamic string and we would keep allocating memory for each
variation.
if (strcmp(pszEnglish, strTranslated.utf8_str()) == 0)
return pszEnglish;

// Add to cache, memory doesn't need to be freed. We only
cache because
// we must pass back a pointer to permanently allocated memory.
char* pszCached = new char[strlen(strTranslated.utf8_str())+1];
strcpy(pszCached, strTranslated.utf8_str());
mapCache[pszEnglish] = pszCached;
return pszCached;
}
return NULL;
}

If you still suspect this code, for testing you could change it to:
const char* wxGetTranslation(const char* pszEnglish)
{
return pszEnglish;
}


[email protected] wrote:
> I tried debugging my build of bitcoind with ddd debugger, but didn't
> have much success yet. It always ends up taking all the system's memory
> and finally crashes. Could you please send me again the latest 64 bit
> build of bitcoind, so I can see if the problem is about my build?
>

이메일 #175

Date: Sun, 28 Feb 2010 20:09:07 +0000
From: Satoshi Nakamoto <[email protected]>
Subject: Re: Bitcoind
To: [email protected]

한글 번역

debug.log를 보내주실 수 있을까요?

[email protected]님이 쓰신 글:

제 bitcoind 빌드를 ddd 디버거로 디버깅해 봤는데, 아직 별 성과를 거두지 못했습니다. 항상 시스템 메모리를 전부 차지하고 결국 충돌합니다. 최신 64비트 bitcoind 빌드를 다시 보내주실 수 있을까요, 그래서 제 빌드 문제인지 확인할 수 있게 해주세요.

영어 원문

Could you send me the debug.log?

[email protected] wrote:
> I tried debugging my build of bitcoind with ddd debugger, but didn't
> have much success yet. It always ends up taking all the system's memory
> and finally crashes. Could you please send me again the latest 64 bit
> build of bitcoind, so I can see if the problem is about my build?
>
링크 복사하기X에 공유페이스북에 공유쓰레드에 공유