When I try a simple tcp client with the tcp Server as above on my host
and the client on android.
I do:
>adb shell
>cd data/tmp/
>ls -la
-rwxrwxrwx root root 5500 2011-08-26 16:51 clientTcp
-rwxrwxrwx root root 5484 2011-08-26 13:28 tcpServer
>./clientTcp
My logcat output:
I/DEBUG ( 34): *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** ***
I/DEBUG ( 34): Build fingerprint: 'generic/sdk/generic:3.1/MASTER/
123685:eng/test-keys'
I/DEBUG ( 34): pid: 369, tid: 369 >>> ./clientTcp <<<
I/DEBUG ( 34): signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr
000086b0
I/DEBUG ( 34): r0 0000011c r1 bea49bc0 r2 00000000 r3 00000000
I/DEBUG ( 34): r4 000090e8 r5 bea49bbc r6 00000003 r7 00008644
I/DEBUG ( 34): r8 00000000 r9 00000000 10 00000000 fp 00000000
I/DEBUG ( 34): ip 00000000 sp bea49bb8 lr 000086ad pc
000086b0 cpsr 80000030
I/DEBUG ( 34): #00 pc 000086b0 /data/tmp/clientTcp
I/DEBUG ( 34): #01 lr 000086ad /data/tmp/clientTcp
I/DEBUG ( 34):
I/DEBUG ( 34): libc base address: aff00000
I/DEBUG ( 34):
I/DEBUG ( 34): code around pc:
I/DEBUG ( 34): 00008690 f7ff4478 e050ef98 ad014833 f7ff4478
I/DEBUG ( 34): 000086a0 2210ef92 46282100 ef92f7ff 1d29482f
I/DEBUG ( 34): 000086b0 0c02f04f f8ad4478 f7ffc004 f646ef90
I/DEBUG ( 34): 000086c0 4630021f 2006f8ad 22104629 ef8cf7ff
I/DEBUG ( 34): 000086d0 28004b27 58e0da08 4a274926 447930a8
I/DEBUG ( 34):
I/DEBUG ( 34): code around lr:
I/DEBUG ( 34): 0000868c 4835da04 f7ff4478 e050ef98 ad014833
I/DEBUG ( 34): 0000869c f7ff4478 2210ef92 46282100 ef92f7ff
I/DEBUG ( 34): 000086ac 1d29482f 0c02f04f f8ad4478 f7ffc004
I/DEBUG ( 34): 000086bc f646ef90 4630021f 2006f8ad 22104629
I/DEBUG ( 34): 000086cc ef8cf7ff 28004b27 58e0da08 4a274926
I/DEBUG ( 34):
I/DEBUG ( 34): stack:
I/DEBUG ( 34): bea49b78 aff4063c /system/lib/libc.so
I/DEBUG ( 34): bea49b7c ffffff24
I/DEBUG ( 34): bea49b80 00008644 /data/tmp/clientTcp
I/DEBUG ( 34): bea49b84 aff19a29 /system/lib/libc.so
I/DEBUG ( 34): bea49b88 b000a488
I/DEBUG ( 34): bea49b8c 000087c2 /data/tmp/clientTcp
I/DEBUG ( 34): bea49b90 00000011
I/DEBUG ( 34): bea49b94 aff374a7 /system/lib/libc.so
I/DEBUG ( 34): bea49b98 00000001
I/DEBUG ( 34): bea49b9c bea49b8c
I/DEBUG ( 34): bea49ba0 bea49bbc
I/DEBUG ( 34): bea49ba4 000090e8 /data/tmp/clientTcp
I/DEBUG ( 34): bea49ba8 bea49bbc
I/DEBUG ( 34): bea49bac 00000003
I/DEBUG ( 34): bea49bb0 df002777
I/DEBUG ( 34): bea49bb4 e3a070ad
I/DEBUG ( 34): #00 bea49bb8 ffffffff
I/DEBUG ( 34): bea49bbc 00000000
I/DEBUG ( 34): bea49bc0 00000000
I/DEBUG ( 34): bea49bc4 00000000
I/DEBUG ( 34): bea49bc8 00000000
I/DEBUG ( 34): bea49bcc a5b31914
I/DEBUG ( 34): bea49bd0 00000000
I/DEBUG ( 34): bea49bd4 bea49c04
I/DEBUG ( 34): bea49bd8 00000001
I/DEBUG ( 34): bea49bdc bea49c0c
I/DEBUG ( 34): bea49be0 00008644 /data/tmp/clientTcp
I/DEBUG ( 34): bea49be4 aff14a31 /system/lib/libc.so
I/DEBUG ( 34): bea49be8 00008648 /data/tmp/clientTcp
I/DEBUG ( 34): bea49bec 00000000
I/DEBUG ( 34): bea49bf0 00000000
I/DEBUG ( 34): bea49bf4 00000000
I/DEBUG ( 34): bea49bf8 00000000
I/DEBUG ( 34): bea49bfc b00045ed /system/bin/linker
However the same two codes work on my PC.
Any help?
> On Mon, Aug 29, 2011 at 2:53 PM, patrick Immling <
pimml...@googlemail.com>wrote:
>
> > Thanks David,
>
> > But I never used an y thread forking calls :(
>
> > there are no "thread forking calls". You either fork a process, but this is
>
> only safe if only one thread is running (the main one), or you handle
> multiple threads and do not fork. Anything else is signifcantly unsafe, even
> on traditional Linux land. Are you calling pthread_atfork() or not?
>
>
>
>
>
>
>
> > I just wrote a very basic TCP server which seem to wok without errors on my
> > linux PC but somehow on Android it just stops with this error :( :(
>
> > Please advise
>
> > On Fri, Aug 26, 2011 at 5:20 PM, David Turner <
di...@android.com> wrote:
>
> >> The stack trace indicates that pthread_atfork() is crashing for some
> >> reason.
> >> You probably shouldn't be calling this function anyway.
>
> >> Use the ndk-stack tool to see where you did call it.
>
> >> This doesn't seem to be related to sockets btw. And which data partition
> >> you run on doesn't affect your permissions, only your UID
>
> >> On Fri, Aug 26, 2011 at 1:57 PM, patrick Immling <
pimml...@googlemail.com