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!