Forum: GNU Radio OpenBTS question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5d71adb993dad7c2b0c31a6cda32c5b4?d=identicon&s=25 Timur Alperovich (Guest)
on 2009-06-07 19:57
(Received via mailing list)
Hey guys,

I wasn't able to find an OpenBTS mailing list. Let me know if there is
one and I'll post the question there.

I was looking through the OpenBTS source and was trying to extend it
to decode the waveforms I recorded previously. In the process I
stumbled upon the following in CommonLibs/Threads.h:

~Thread() { assert(!pthread_attr_destroy(&mAttrib)); }

The problem is that the RadioInterface class has 3 Thread members for
the processing that it does. The initialization of the mAttrib field
in Thread happens only when Thread::start() is called. Since I'm not
using the Threads for processing and simply trying to extend the class
and use its methods to process an input file this results in a
segfault when pthread_attr_destroy() is called on the uninitialized
attribute. It seems that moving the pthread_attr_init() call to the
constructor should be the right thing to do. Alternatively, one could
set the mAttrib to some value in the constructor so it can be checked
in the destructor.

Is this correct or am I missing something here? I'll supply the patch
that initializes mAttrib in the constructor, unless that is not the
preferred way of doing things.

--
Cheers,
Timur
This topic is locked and can not be replied to.