aMule Forum
English => Backtraces => Topic started by: kinoko20 on August 02, 2004, 10:44:08 AM
-
wxGTK : 2.5.1 (i compiled it with unicode, gtk2)
When i search in korean, aMule crashes.
my locale is ko_KR.UTF-8.
OOPS! - Seems like aMule crashed
--== BACKTRACE FOLLOWS: ==--
[0] amule(_ZN9CamuleApp16OnFatalExceptionEv+0x40) [0x836275a]
I'll run amule with wxGTK 2.5.2 later.
if there is a new error, i'll post here :rolleyes:
-
hey,
well, the bt isn't usefull.. u should compile amule next time with --disable-optimize --enable-debug .. then take a look at the very first post here in btc's forum
greets
-
i compiled wxgtk with unicode, gtk2.
when i search in korean, amule crashes.
this backtrace
OOPS! - Seems like aMule crashed
--== BACKTRACE FOLLOWS: ==--
[0] amule(_ZN9CamuleApp16OnFatalExceptionEv+0x40) [0x833c650]
[1] [0xbfffe2ed]
this is bt message.
#0 0x40cbe77a in memcpy () from /lib/libc.so.6
#1 0x0829110d in CMemFile::WriteRaw ()
#2 0x08e5a155 in ?? ()
#3 0x00000000 in ?? ()
#4 0x00000002 in ?? ()
#5 0x082361f7 in CMemFile::Write ()
#6 0x08236295 in CMemFile::Write ()
#7 0x08303fca in CSearchDlg::StartNewSearch ()
#8 0x404ac701 in wxAppConsole::HandleEvent ()
from /usr/lib/libwx_baseu-2.5.so.2
#9 0x40540ddb in wxEvtHandler::ProcessEventIfMatches ()
from /usr/lib/libwx_baseu-2.5.so.2
#10 0x40540369 in wxEventHashTable::HandleEvent ()
from /usr/lib/libwx_baseu-2.5.so.2
#11 0x40540f6b in wxEvtHandler::ProcessEvent ()
from /usr/lib/libwx_baseu-2.5.so.2
#12 0x40354e99 in wxWindowBase::TryParent ()
from /usr/lib/libwx_gtk2u_core-2.5.so.2
#13 0x40540f20 in wxEvtHandler::ProcessEvent ()
from /usr/lib/libwx_baseu-2.5.so.2
#14 0x402a3561 in wxButton::GetClassDefaultAttributes ()
from /usr/lib/libwx_gtk2u_core-2.5.so.2
#15 0x40952674 in g_cclosure_marshal_VOID__VOID ()
from /usr/lib/libgobject-2.0.so.0
and, this is bt full. :)
#0 0x40cbe77a in memcpy () from /lib/libc.so.6
No symbol table info available.
#1 0x0829110d in CMemFile::WriteRaw ()
No symbol table info available.
#2 0x08e5a155 in ?? ()
No symbol table info available.
#3 0x00000000 in ?? ()
No symbol table info available.
#4 0x00000002 in ?? ()
No symbol table info available.
#5 0x082361f7 in CMemFile::Write ()
No symbol table info available.
#6 0x08236295 in CMemFile::Write ()
No symbol table info available.
#7 0x08303fca in CSearchDlg::StartNewSearch ()
No symbol table info available.
#8 0x404ac701 in wxAppConsole::HandleEvent ()
from /usr/lib/libwx_baseu-2.5.so.2
No symbol table info available.
#9 0x40540ddb in wxEvtHandler::ProcessEventIfMatches ()
from /usr/lib/libwx_baseu-2.5.so.2
No symbol table info available.
#10 0x40540369 in wxEventHashTable::HandleEvent ()
from /usr/lib/libwx_baseu-2.5.so.2
No symbol table info available.
#11 0x40540f6b in wxEvtHandler::ProcessEvent ()
from /usr/lib/libwx_baseu-2.5.so.2
No symbol table info available.
#12 0x40354e99 in wxWindowBase::TryParent ()
from /usr/lib/libwx_gtk2u_core-2.5.so.2
No symbol table info available.
#13 0x40540f20 in wxEvtHandler::ProcessEvent ()
from /usr/lib/libwx_baseu-2.5.so.2
No symbol table info available.
#14 0x402a3561 in wxButton::GetClassDefaultAttributes ()
from /usr/lib/libwx_gtk2u_core-2.5.so.2
No symbol table info available.
#15 0x40952674 in g_cclosure_marshal_VOID__VOID ()
from /usr/lib/libgobject-2.0.so.0
No symbol table info available.
and...
log window, search result, download list shows broken character.
It's in my attachments. :)
Thanks.
-
kinoko20,
Your crash is probably due to your wx instalation. Please, test first with wx-2.4.2, this one is the only stable version we recommend. wx-2.5.1 has some problems, you should try either wx-2.5.2 or current wx-cvs. In those two last ones, you may end up seeing some bugs in the gui, but nothing so important.
Please, closely follow these instructions:
http://www.amule.org/wiki/index.php/Compilation_Installation
Cheers!
-
phoenix,
I'm using wx-2.5.2. :)
I need unicode in amule... so i used 2.5.2. :)
-
kinoko20,
I run a unicoded version of amule here and works fine. Searching works too. I am using current wx-cvs, but it is pretty close to wx-2.5.2.
Like I said before, it looks like there is some problem with your wx instalation. Can you try a current amule cvs tarball? http://amule.hirnriss.net/
Cheers!
-
phoenix,
yes. i can use amule without searching file named in korean.
did you find the file in korean, japanese or chinese?
when i do, it crashes.... ;(
-
kinoko20,
I can start amule with your locale, but i don't know how to enter korean chars with my keyboard. Any clue?
Cheers!
-
there is scim, iiimf. :)
and you need korean font.... (like baekmuk-font.)
-
kinoko20,
Ok, I did what you said and I got a crash :)
I am on the problem now, I know where it crashes, but I am still trying to figure out the problem. Unicode is really complicated ;)
Hope to have a fix soon.
Cheers!
-
kinoko20,
I am looking at the search problem, but i am not able to reproduce the crash in unicode anymore :(
Is there a deterministic way to do that? Can you tell me exactly what you type in search to get a crash?
I can choose an imput method (which one do you use?) and you could tell me the keys you type (in ascii, please :) )
Cheers!
-
phoenix,
Hmm.. I'm using nabi as an input method. (it's in http://nabi.kldp.net)
I didn't type special words. ;) I just typed common words (like hangul in Korean...)
ed2k-gtk-gui can use korean in gtk2.
Typing words in Japanese and Chinese, amule crashes too...
I think wxgtk has a problem....
By the way... Server's message(and filename) seems to be encoded in euc-kr(cp949).
I think it need to be converted to utf-8....
Thanks for reading :D
-
kinoko20,
I have got a crash, and it seems that there is a problem with the conversion function.
I still don't know exactly what is happening, the string length is 28, but we get a null pointer.
There is probably another problem, amule is using iso8859-1 for conversions, and the right thing to me seems to be UTF-8. The return value of the Length() function is in number of codes, not in number of bytes, so it seems to be wrong anyway.
Ok, here is what i get, i am posting it here so that other devs can take a look:
(gdb) bt
#0 0x00accc32 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x00b0b989 in raise () from /lib/tls/libc.so.6
#2 0x00b0d342 in abort () from /lib/tls/libc.so.6
#3 0x0073763e in wxFatalSignalHandler () at src/unix/utilsunx.cpp:964
#4
#5 0x00b5cdcc in memcpy () from /lib/tls/libc.so.6
#6 0x081e720c in CMemFile::Write(void const*, unsigned) (this=0x98eb958, buf=0x0, length=28) at filemem.cpp:214
#7 0x08126b19 in CSafeMemFile::Write(void const*, unsigned) (this=0x98eb958, pBuf=0x0, nCount=28)
at SafeFile.h:81
#8 0x08283fed in CFileDataIO::WriteString(wxString const&) (this=0x98eb98c, rstr=@0xbfe6eb10)
at SafeFile.cpp:132
#9 0x08285ff7 in CSearchDlg::StartNewSearch() (this=0x9069cd8) at SearchDlg.cpp:483
#10 0x08284d49 in CSearchDlg::OnBnClickedStarts(wxCommandEvent&) (this=0x9069cd8) at SearchDlg.cpp:191
#11 0x0069068c in wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const (
this=0x895c300, handler=0x9069cd8, func=
{__pfn = 0x8284c1a , __delta = 0}, event=@0xbfe6ed30)
at src/common/appbase.cpp:305
#12 0x007310d9 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) (
entry=@0x85a9320, handler=0x9069cd8, event=@0xbfe6ed30) at src/common/event.cpp:1169
#13 0x00730066 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) (this=0x85a92f8, event=@0xbfe6ed30,
self=0x9069cd8) at src/common/event.cpp:837
#14 0x007312ec in wxEvtHandler::ProcessEvent(wxEvent&) (this=0x9069cd8, event=@0xbfe6ed30)
at src/common/event.cpp:1231
#15 0x00364194 in wxWindowBase::TryParent(wxEvent&) (this=0x9076190, event=@0xbfe6ed30)
at src/common/wincmn.cpp:2401
#16 0x00731351 in wxEvtHandler::ProcessEvent(wxEvent&) (this=0x9076190, event=@0xbfe6ed30)
at src/common/event.cpp:1244
#17 0x0029efbd in gtk_button_clicked_callback (button=0x9076190) at src/gtk/button.cpp:58
#18 0x0050c051 in g_cclosure_marshal_VOID__VOID () from /usr/lib/libgobject-2.0.so.0
#19 0x004f9cb0 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#20 0x0050bbbf in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#21 0x0050ac36 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
(gdb) bt full
#0 0x00accc32 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
No symbol table info available.
#1 0x00b0b989 in raise () from /lib/tls/libc.so.6
No symbol table info available.
#2 0x00b0d342 in abort () from /lib/tls/libc.so.6
No symbol table info available.
#3 0x0073763e in wxFatalSignalHandler () at src/unix/utilsunx.cpp:964
No locals.
#4
No symbol table info available.
#5 0x00b5cdcc in memcpy () from /lib/tls/libc.so.6
No symbol table info available.
#6 0x081e720c in CMemFile::Write(void const*, unsigned) (this=0x98eb958, buf=0x0, length=28) at filemem.cpp:214
No locals.
#7 0x08126b19 in CSafeMemFile::Write(void const*, unsigned) (this=0x98eb958, pBuf=0x0, nCount=28)
at SafeFile.h:81
No locals.
#8 0x08283fed in CFileDataIO::WriteString(wxString const&) (this=0x98eb98c, rstr=@0xbfe6eb10)
at SafeFile.cpp:132
No locals.
#9 0x08285ff7 in CSearchDlg::StartNewSearch() (this=0x9069cd8) at SearchDlg.cpp:483
m_nSearchID = 1
stringParameter = 1 '\001'
typeParameter = 2 '\002'
numericParameter = 3 '\003'
andParameter = 0
typeNemonic = 196609
minNemonic = 33554689
maxNemonic = 33554690
avaibilityNemonic = 352321793
extensionNemonic = 262145
searchString = { = {static npos = 4294967195, m_pchData = 0x971e83c}, }
extension = { = {static npos = 4294967195, m_pchData = 0x765194}, }
typeText = { = {static npos = 4294967195, m_pchData = 0x994b394}, }
min = 0
max = 0
avaibility = 0
parametercount = 2
data = (CSafeMemFile *) 0x98eb958
packet = (Packet *) 0x1
#10 0x08284d49 in CSearchDlg::OnBnClickedStarts(wxCommandEvent&) (this=0x9069cd8) at SearchDlg.cpp:191
searchString = { = {static npos = 4294967195, m_pchData = 0x97ea70c}, }
choice = (class wxChoice *) 0x906e9e8
#11 0x0069068c in wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const (
this=0x895c300, handler=0x9069cd8, func=
{__pfn = 0x8284c1a , __delta = 0}, event=@0xbfe6ed30)
at src/common/appbase.cpp:305
No locals.
#12 0x007310d9 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) (
entry=@0x85a9320, handler=0x9069cd8, event=@0xbfe6ed30) at src/common/event.cpp:1169
tableId1 = 10012
tableId2 = -1
#13 0x00730066 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) (this=0x85a92f8, event=@0xbfe6ed30,
self=0x9069cd8) at src/common/event.cpp:837
n = 0
eventEntryTable = (const wxEventTableEntryPointerArray &) @0x908e584: { = {
m_nSize = 6, m_nCount = 6, m_pItems = 0x908ec28}, }
count = 6
eventType = 10066
eTTnode = (EventTypeTable * const) 0x908e580
#14 0x007312ec in wxEvtHandler::ProcessEvent(wxEvent&) (this=0x9069cd8, event=@0xbfe6ed30)
at src/common/event.cpp:1231
No locals.
#15 0x00364194 in wxWindowBase::TryParent(wxEvent&) (this=0x9076190, event=@0xbfe6ed30)
at src/common/wincmn.cpp:2401
propagateOnce = {m_event = @0xbfe6ed30}
parent = (class wxWindow *) 0x9069cd8
#16 0x00731351 in wxEvtHandler::ProcessEvent(wxEvent&) (this=0x9076190, event=@0xbfe6ed30)
at src/common/event.cpp:1244
No locals.
#17 0x0029efbd in gtk_button_clicked_callback (button=0x9076190) at src/gtk/button.cpp:58
event = { = { = {_vptr.wxObject = 0x83be340, static ms_classInfo = {
m_className = 0x760f20, m_objectSize = 8, m_objectConstructor = 0, m_baseInfo1 = 0x0,
m_baseInfo2 = 0x0, static sm_first = 0x83be868, m_next = 0x7bef08, static sm_classTable = 0x8938008},
m_refData = 0x0}, m_eventObject = 0x9076190, m_eventType = 10066, m_timeStamp = 0, m_id = 10012,
m_callbackUserData = 0x0, m_propagationLevel = 2147483646, m_skipped = false, m_isCommandEvent = true,
static ms_classInfo = {m_className = 0x772300, m_objectSize = 36, m_objectConstructor = 0,
m_baseInfo1 = 0x7beecc, m_baseInfo2 = 0x0, static sm_first = 0x83be868, m_next = 0x7bf394,
static sm_classTable = 0x8938008}}, m_commandString = { = {static npos = 4294967195,
m_pchData = 0x765194}, }, m_commandInt = 0, m_extraLong = 0, m_clientData = 0x0,
m_clientObject = 0x0, static ms_classInfo = {m_className = 0x3a3820, m_objectSize = 56,
m_objectConstructor = 0x21efb0 , m_baseInfo1 = 0x7bf3ac,
m_baseInfo2 = 0x0, static sm_first = 0x83be868, m_next = 0x46b2e4, static sm_classTable = 0x8938008}}
#18 0x0050c051 in g_cclosure_marshal_VOID__VOID () from /usr/lib/libgobject-2.0.so.0
No symbol table info available.
#19 0x004f9cb0 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
No symbol table info available.
#20 0x0050bbbf in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
No symbol table info available.
#21 0x0050ac36 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
No symbol table info available.
(gdb) frame 8
#8 0x08283fed in CFileDataIO::WriteString(wxString const&) (this=0x98eb98c, rstr=@0xbfe6eb10)
at SafeFile.cpp:132
132 Write( unicode2char(rstr), rstr.Length() );
(gdb) l
127
128 void CFileDataIO::WriteString(const wxString& rstr)
129 {
130 // We dont include the NULL terminator. Dont know why.
131 WriteUInt16( rstr.Length() );
132 Write( unicode2char(rstr), rstr.Length() );
133 }
134
135
136 ///////////////////////////////////////////////////////////////////////////////
(gdb) p rstr.m_pchData
$2 = (wxChar *) 0x971e83c
(gdb) x/32x rstr.m_pchData
0x971e83c: 0x00003141 0x00003134 0x00003147 0x00003139
0x971e84c: 0x0000d638 0x00003153 0x0000314f 0x00003163
0x971e85c: 0x00003157 0x00003163 0x00003157 0x00003157
0x971e86c: 0x00003153 0x00003157 0x0000314e 0x0000d640
0x971e87c: 0x00003157 0x0000314e 0x00003139 0x0000314e
0x971e88c: 0x00003139 0x0000b7f4 0x00003139 0x00003134
0x971e89c: 0x00003139 0x00003139 0x00003139 0x0000314e
0x971e8ac: 0x00000000 0x0000006b 0x00000073 0x00000000
(gdb) x/36x ((wxStringData*)rstr.m_pchData - 1)
0x971e830: 0x00000001 0x0000001c 0x00000023 0x00003141
0x971e840: 0x00003134 0x00003147 0x00003139 0x0000d638
0x971e850: 0x00003153 0x0000314f 0x00003163 0x00003157
0x971e860: 0x00003163 0x00003157 0x00003157 0x00003153
0x971e870: 0x00003157 0x0000314e 0x0000d640 0x00003157
0x971e880: 0x0000314e 0x00003139 0x0000314e 0x00003139
0x971e890: 0x0000b7f4 0x00003139 0x00003134 0x00003139
0x971e8a0: 0x00003139 0x00003139 0x0000314e 0x00000000
0x971e8b0: 0x0000006b 0x00000073 0x00000000 0x00000000
(gdb) x/32xb ((wxStringData*)rstr.m_pchData - 1)
0x971e830: 0x01 0x00 0x00 0x00 0x1c 0x00 0x00 0x00
0x971e838: 0x23 0x00 0x00 0x00 0x41 0x31 0x00 0x00
0x971e840: 0x34 0x31 0x00 0x00 0x47 0x31 0x00 0x00
0x971e848: 0x39 0x31 0x00 0x00 0x38 0xd6 0x00 0x00
(gdb) p ((wxStringData*)rstr.m_pchData - 1)->nDataLength
$3 = 28
(gdb) p (char *)rstr.m_pchData
$4 = 0x971e83c "A1"
(gdb) frame 7
#7 0x08126b19 in CSafeMemFile::Write(void const*, unsigned) (this=0x98eb958, pBuf=0x0, nCount=28)
at SafeFile.h:81
81 return CMemFile::Write( pBuf, nCount );
(gdb) l
76 virtual off_t Read(void *pBuf, off_t nCount) const {
77 return CMemFile::Read( pBuf, nCount );
78 }
79
80 virtual size_t Write(const void *pBuf, size_t nCount) {
81 return CMemFile::Write( pBuf, nCount );
82 }
83 };
84
85
(gdb)
I hope we can fix this soon.
Cheers!
-
I think i have a theory: we have this:
static wxCSConv aMuleConv(wxT("iso8859-1"));
#define unicode2char(x) (const char*) aMuleConv.cWX2MB(x)
but conversion to iso8859-1 is clearly not possible here, so the function returns a null pointer. We should definetly be using UTF-8
I'll talk to the other devs.
Cheers!
-
kinoko20,
The problem is actually bigger than i thought. I have talked to Kry and it seems that it is against ed2k network rules to use UTF-8. Also, there is some talk among devs about trying to find a common way to handle this character set diversity. I don't actually know what they will come up with, but I risk saying that UTF-8 will be involved, because it is the only way to go to and from unicode without loss of information.
I am really sorry, but I can't help you with that. The unicode version of amule is only good for displaying. Searches must be done in iso8859-1, but that is a limitation of ed2k network, not amule itself. As soon as protocol gets updated, we will implement it.
Cheers!
-
phoenix,
amule in gtk1 can use korean perfectly.
because gtk1 use euc-kr charset.. i think ;)
So.... How about it?
Please see my attachment...
-
Could you take the string being looked for and use wxString::ToAscii()? :]
-
kinoko20,
The conversion you say that happens, from euc-kr to iso8859-1 is a wrong conversion. Afaik, there is no way to do this properly. Although I agree that it could work (can actually, because you say it works :) ), but certainly the conversion performed must be the trivial one (copy the same bytes and see what happens).
The problem in a unicode build is that the string type used in wx, and consequently in amule, uses unicode as its internal representation. So, what actually happens in a unicode build is:
gui(input) -> UTF-8(gtk2) -> unicode(wx) -> iso8859-1 ----> server
server ----> iso8859-1 -> unicode(wx) -> UTF-8(gtk2) -> gui(display)
In non-unicode builds, with gtk1, i am not sure, but i imagine that it happens like you showed in the picture, but notice that the conversion from euc-kr to iso8859-1 must not be exactly a conversion, once that it is actually impossible to do that. As I said, must be a simple byte copy.
It will probably work among machines that have the same locale as yours. And among clients that also incorrectly do the conversion like this.
Anyway, like I said before, I can't help you with that, because we are talking about network protocol. It is important that network code be an agreement and I can't implement something against it. I am not totally aware of the problems, Kry is the one discussing this with the other devs, when he is back he can certainly explain the matters to you better than I can.
What feature do you miss when you use amule with gtk1?
Cheers!
-
Avi,
In non-unicode build, ToAscii does nothing but return the internal buffer representation, and is equivalent to c_str(). In an unicode build it just transforms everry char above SCHAR_MAX, which is 127, to an underscore '_', so I don't think that one can benefit from that.
Cheers!
-
Originally posted by phoenix
Avi,
In non-unicode build, ToAscii does nothing but return the internal buffer representation, and is equivalent to c_str(). In an unicode build it just transforms everry char above SCHAR_MAX, which is 127, to an underscore '_', so I don't think that one can benefit from that.
Cheers!
I see... Thanks for the info. :)
-
pheonix I was wondering how you get such detailed bt's. I have the enable-debug and disable optimise flags on my cvs build but I still do not seem to get the depth that you got on the bt.
-
codewarrior2,
This is a little off-topic here, but I'll try to be quick and not waste space. I searched for you yesterday on IRC, but you were not there at the moment.
I have both aMule and wxWidgets compiled for debug. My configure lines are:
1) For aMule: ./configure --enable-debug --disable-optimize --enable-verbose --enable-webserver --enable-webservergui --enable-amulecmd --enable-amulecmdgui --enable-ccache --with-wx-config=/usr/local/wxWidgets-cvs/bin/wx-config
2) For wxWidgets: ./configure --enable-debug --disable-optimise --enable-debug_flag --enable-debug_info --enable-debug_gdb --enable-gtk2 --disable-unicode --prefix=/usr/local/wxWidgets-cvs
Other questions about that, please call me on IRC, I think that in that matter we can be more productive there.
Cheers!