Using the function __pthread_initialize() and variable
__pthread_initial_thread_bos were highly risky, but it was necessary to do
it

due to a bug in libpthread with uclibc. After the main-process forked a new
process and died, I had to re-initialize libpthread from the child to make
mutexes work.

 

I'm not sure how to fix this without reordering lots of code in owlib  (and
use pthread-function first time after deamon is called). This should fix the
problem, but I never tried to do those changes before. The quick fix was to
re-initialize pthread and it worked for all platforms I used at that time.

 

        /* Have to re-initialize pthread since the main-process is gone.

         *

         * This workaround will probably be fixed in uClibc-0.9.28

         * Other uClibc developers have noticed similar problems which are

         * trigged when pthread functions are used in shared libraries. */

        __pthread_initial_thread_bos = NULL;

        __pthread_initialize();

 

 

It's strange that you don't have PTHREAD_MUTEX_ADAPTIVE_NP defined in
pthread.h. It's defined in all uclibc versions I have seen.

 

Which uclibc-version do you have?

 

/Christian

 

 

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Eric
Allen
Sent: den 16 maj 2007 06:04
To: [email protected]
Subject: Re: [Owfs-developers] OWFS on DD-WRT

 

It looks like there are three files it's used in: ow_cache.c, ow_locks.c,
and ow_tree.c. The first two can be disabled with config options.

When I attempted to build with gcc-mipsel-linux-uclibc 4.1 I got the
following error 
owlib.c: In function 'LibStart':
owlib.c:215: error: '__pthread_initial_thread_bos' undeclared (first use in
this function)
owlib.c:215: error: (Each undeclared identifier is reported only once
owlib.c:215: error: for each function it appears in.)
owlib.c:216: warning: implicit declaration of function
'__pthread_initialize'
owlib.c:219: warning: implicit declaration of function
'pthread_mutexattr_init' 
owlib.c:219: error: 'mattr' undeclared (first use in this function)
owlib.c:220: warning: implicit declaration of function
'pthread_mutexattr_settype'
owlib.c:220: error: 'PTHREAD_MUTEX_ADAPTIVE_NP' undeclared (first use in
this function) 
owlib.c:221: error: 'pmattr' undeclared (first use in this function)
make[4]: *** [owlib.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1 
make: *** [all-recursive] Error 1

On 5/15/07, Eric Allen <[EMAIL PROTECTED]> wrote:

Ah. Okay. How tough is it to build owfs for dd-wrt? Is it simply a matter of
taking the source distro and compiling with mipsel-uclibc?

 

On 5/15/07, Paul Alfille <[EMAIL PROTECTED] mail> wrote:

tsearch is the binary tree search that is part of glibc and some
implementations of uClibc.  It may not have been included in the dd-wrt
version of uClibc. It could be an optional part of owlib, like some of the
semaphore and other code. 

Does that give you a place to look?

Paul Alfille

On 5/15/07, Eric Allen < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
mailError! Filename not specified.> wrote:

I've gotten as far as the previous poster with install OWFS on DD- 
WRT: when I try to start the daemon I get a "can't resolve symbol
'tsearch' "-error. I tried installing uclibc from http://
downloads.openwrt.org/whiterussian/packages/ and reordering
LD_LIBRARY_PATH to load that libc, but then I just got a segfault.
Any ideas how to proceed?

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express 
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/ 
_______________________________________________
Owfs-developers mailing list
[email protected]  mailError! Filename not specified.
https://lists.sourceforge.net/lists/listinfo/owfs-developers



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now. 
http://sourceforge.net/powerbar/db2/
_______________________________________________
Owfs-developers mailing list 
[email protected] mailError! Filename not specified.
https://lists.sourceforge.net/lists/listinfo/owfs-developers

 

 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to