Closed GoogleCodeExporter closed 9 years ago
Can you describe how you have compiled Mongoose for android.
Building applications for Android/Linux requires the use of a cross-compiler
tool
chain from CodeSourcery or You can also use Android NDK.
Problem may be in the dynamic linking process if you have used the
cross-compiler.
Original comment by gallina....@gmail.com
on 25 Jan 2011 at 5:37
A friend of mine managed to use another android device libpthread and it worked.
So I think it's the embedded pthread in androind 2.2 that have a problem with
mongoose.
Mini httpd seems not to be affected by this problem.
Also: If I create a custom cgi bin in C, everything works.
So the problem is with mongoose >> pthread >> "toolbox" (which is a sort of
busybox).
I compiled it normally using the Android NDK:
$ /toolchain/bin/arm-linux-androideabi-gcc mongoose.c main.c -o mongoose
$ file mongoose
mongoose: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (
uses shared libs), not stripped
Original comment by zibree
on 25 Jan 2011 at 5:59
Nope.. the problem is not in dynamic linking but in the way pthread is
implemented in android devices.
The nice thing is that it doesn't just crash the app but it crashes all the
phone :)
Original comment by zibree
on 25 Jan 2011 at 6:00
According to the zibree reports:
“the problem is not in dynamic linking but in the way pthread is implemented
in android devices.”
thrue!!
“It works normally when browsing..
As soon as I run test.cgi... BOOM.”
I think that dipends on the Handle_CGI_Request() at line 2835 av mongoose.c
this method call SpawnProcess() at line 1209 and at line 1217 there is the real
problem
fork().
Dianne Hackborn one af the Android framework engineer`s said:
“Please don't use fork(). If you need multiple processes you should use
the platform's facilities through android:processes attributes in the manifest.
“
Why?
Because the pthread implementation appears to be completely new and developed
by Google specifically for Android. It is, quite deliberately, not a complete
implementation of pthreads. It implements those features necessary to support
threads in the Dalvik JVM, and only selectively thereafter.
At last according to the Issue 11393 of the Android projekt:
“the pthread kernel_id of the main thread is broken in Android because the
kernel id is not adjusted after a fork.”
“A friend of mine managed to use another android device libpthread and it
worked.”
Sorry but I could’t find any nice way around the fork problem on Android.
It would be nice to see the code of your friend.
Original comment by gallina....@gmail.com
on 26 Jan 2011 at 6:53
Is there a solution for this CGI problem. I have seen Mongoose implimented on
Android with webkey app, although this needs to be rooted. Also is there any
chance of providing an apk.
Original comment by simwa...@googlemail.com
on 21 Jan 2012 at 6:02
please have a look at
https://github.com/valenok/mongoose/issues/9
for a fix for this CGI problem...
Original comment by h.koe...@science-computing.de
on 23 Aug 2012 at 7:30
Submitted
https://github.com/valenok/mongoose/commit/c92d7c3bc8c6d9c15424711bed198b8a43bba
a58
Original comment by valenok
on 25 Aug 2012 at 9:24
Original issue reported on code.google.com by
zibree
on 3 Jan 2011 at 1:38