From: Sven Eckelmann <sven.eckelmann@gmx.de>
To: b.a.t.m.a.n@open-mesh.net
Cc: Marek Lindner <lindner_marek@yahoo.de>
Subject: Re: [B.A.T.M.A.N.] Problem with B.A.T.M.A.N. 0.3.1 rv1206 (compatibility version 5)
Date: Tue, 24 Mar 2009 20:17:47 +0100 [thread overview]
Message-ID: <200903242017.51987.sven.eckelmann@gmx.de> (raw)
In-Reply-To: <200903232305.39161.sven.eckelmann@gmx.de>
[-- Attachment #1: Type: text/plain, Size: 2503 bytes --]
On Monday 23 March 2009 23:05:34 Sven Eckelmann wrote:
> On Monday 23 March 2009 18:13:32 Marek Lindner wrote:
> > I downloaded the OpenWRT trunk and compiled the i386 image before loading
> > it into a qemu environment. I can confirm that batman does nothing if
> > started without a debug level. It seems the main thread is not doing
> > anything. Interestingly, if I compile & run batman on my debian machine
> > it runs without problems. I guess OpenWRT uses some different libs /
> > compile time options / etc that provoke that problem.
>
> Seems to a different behaviour when doing a fork+pthreads_create...
> somehow. Try to remove the fork and the setgid from posix/init.c:my_daemon
> and compile it again (against uclib of course). You should notice that it
> works without any problems.
> If you do a static build against a current glibc on i386 (2.7 here) it
> works as expected.
> So I would guess a uClibc specific behaviour when calling pthread_create
> after a fork. The thread (unix_listen) itself runs without any problems but
> the main thread seems to be blocked at
> pthread_create( &unix_if.listen_thread_id, NULL, &unix_listen, NULL );
> in posix/init.c:apply_init_args.
Forgot to add my minimal testcase:
#include <unistd.h>
#include <stdio.h>
#include <pthread.h>
void* dummy_thread(void* unused)
{
printf("from thread\n");
return NULL;
}
int main(void)
{
pthread_t t;
if (fork() == 0) {
printf("from child\n");
pthread_create(&t, NULL, &dummy_thread, NULL);
printf("after create\n");
}
return 0;
}
The output should be (last two lines can be swapped):
from child
from thread
after create
I used the x86 toolchain from the current openwrt trunk to compile it.
openwrt/build_dir/toolchain-i386_gcc-4.1.2_uClibc-0.9.29/gcc-4.1.2-final/gcc/gcc-cross fork_thread.c -static -lpthread -o fork_thread
The result was a stopping main thread at pthread_create. I did the same test
with 0.9.28.2 and 0.9.30.1
Advanced configuration options --->
Toolchain Options --->
uClibc Version
0.9.28 worked without any problems and 0.9.30.1 without nptl showed the same
problem - the nptl version doesn't compile at the moment. So changing the
uclibc is a possible solution. Otherwise ask the openwrt developers to take
a look at the problem. Please add this example (or a similar one) and the
expected results + a list of uclibc versions which worked.
Best regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2009-03-24 19:17 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-18 14:43 [B.A.T.M.A.N.] Problem with B.A.T.M.A.N. 0.3.1 rv1206 (compatibility version 5) Max
2009-03-19 2:55 ` Marek Lindner
2009-03-19 13:38 ` Max
2009-03-20 12:47 ` Marek Lindner
2009-03-20 13:03 ` Max
2009-03-21 1:13 ` Marek Lindner
2009-03-21 13:07 ` Max
2009-03-23 17:13 ` Marek Lindner
2009-03-23 22:05 ` Sven Eckelmann
2009-03-24 19:17 ` Sven Eckelmann [this message]
2009-03-25 2:44 ` Marek Lindner
2009-03-26 12:59 ` [B.A.T.M.A.N.] [PATCH] Don't detach batmand to background by default Sven Eckelmann
2009-03-31 18:26 ` Marek Lindner
2009-04-01 10:28 ` Sven Eckelmann
2009-04-01 10:31 ` [B.A.T.M.A.N.] [PATCH 1/2] Add parameter to disable fork to background Sven Eckelmann
2009-04-01 10:31 ` [B.A.T.M.A.N.] [PATCH 2/2] Sanitise batmand process by reexecuting it Sven Eckelmann
2009-04-01 22:20 ` [B.A.T.M.A.N.] [PATCHv2 " Sven Eckelmann
2009-03-24 12:45 ` [B.A.T.M.A.N.] Problem with B.A.T.M.A.N. 0.3.1 rv1206 (compatibility version 5) P. Mazart
2009-04-11 0:54 ` Marek Lindner
-- strict thread matches above, loose matches on Subject: below --
2009-03-19 12:55 Marco Tozzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200903242017.51987.sven.eckelmann@gmx.de \
--to=sven.eckelmann@gmx.de \
--cc=b.a.t.m.a.n@open-mesh.net \
--cc=lindner_marek@yahoo.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.