Hey everybody,
I encountered several problems using Mutella on NetBSD
1.6 with GNU pth.
First of all the Mutex usage in event.cpp is wrong:
In MAsyncEventReceiver::OnEvent() it locks m_mutex and
calls
MAsyncEventReceiver::FlushToFit() afterwards, while the
mutex is locked.
But Unix 98 states:
"If the mutex type is PTHREAD_MUTEX_DEFAULT, attempting
to recursively lock the mutex results in undefined
behavior."
So I changed event.cpp:153 and added m_mutex(TRUE) to
the constructor, which
fixes the problem (atleast, it looks like its fixed
now). So Peter, can
you please change it as well. The line should look like
this:
MAsyncEventReceiver::MAsyncEventReceiver(int nMaxTime,
int nMaxMem
/*=INT_MAX*/) : m_nMaxTime(nMaxTime),
m_nMaxMem(nMaxMem), m_mutex(TRUE)
But then mutella segfaults later on, giving the
following backtrace:
(gdb) backtrace
#0 TString<char>::c_str (this=0x63206588) at
tstring.h:315
#1 0x8057377 in MAsyncDnsThread::run (this=0x813e180)
at asyncdns.cpp:68
#2 0x80ae169 in MThreadPrivate::internalRun
(that=0x813e180)
at mthread_p.h:956
#3 0x80ab9a2 in start_thread (t=0x813e180) at
mthread_p.h:1209
#4 0x48152e64 in pth_spawn_trampoline () from
/usr/pkg/lib/libpthread.so.20
#5 0x481503ad in pth_mctx_set_bootstrap () from
/usr/pkg/lib/libpthread.so.20
#6 0x48150321 in pth_mctx_set_trampoline () from
/usr/pkg/lib/libpthread.so.20
#7 0x82d3fa0 in ?? ()
#8 0x1f in ?? ()
Cannot access memory at address 0x1f
Any ideas? My guess is that the thread handling in
mutella is generally wrong, but I haven't looked at
that in detail.
regards,
Benedikt
Logged In: NO
I'm sorry, I forgot to supply an email address:
benedikt.meurer@unix-ag.uni-siegen.de
regards,
Benedikt