Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test failures on Android #1430

Closed
shigeki opened this issue Apr 15, 2015 · 5 comments
Closed

test failures on Android #1430

shigeki opened this issue Apr 15, 2015 · 5 comments
Labels
test Issues and PRs related to the tests.

Comments

@shigeki
Copy link
Contributor

shigeki commented Apr 15, 2015

As commented in #1396 (comment) , several tests fails on Android.
Some of them can be tentatively fixed by a small patch but 18 failures still remains.
The patch and full test results( --mode=release message parallel sequential) are show in
https://gist.github.com/shigeki/fd25f15657f058ceccea and the list of failures are

$ grep 'not ok' test_out.txt
not ok 16 - test-child-process-default-options.js
not ok 20 - test-child-process-env.js
not ok 23 - test-child-process-exec-env.js
not ok 59 - test-cluster-bind-privileged-port.js
not ok 87 - test-cluster-shared-handle-bind-privileged-port.js
not ok 202 - test-fs-access.js
not ok 229 - test-fs-readfile-pipe.js
not ok 230 - test-fs-readfile-pipe-large.js
not ok 233 - test-fs-readfilesync-pipe-large.js
not ok 262 - test-http-304.js
not ok 307 - test-http-curl-chunk-problem.js
not ok 321 - test-http-full-response.js
not ok 415 - test-https-simple.js
not ok 477 - test-net-pipe-connect-errors.js
not ok 514 - test-process-config.js
not ok 577 - test-stdio-closed.js
not ok 779 - test-child-process-execsync.js
not ok 785 - test-fs-watch.js

4 failures are because process.getuid is undefined on Android and some of them can be fixed by changing to invoke external commands. It needs more investigations.

CC: @Gioyik

@shigeki shigeki added the test Issues and PRs related to the tests. label Apr 15, 2015
@Gioyik
Copy link
Contributor

Gioyik commented Apr 16, 2015

Tomorrow I am going to run the tests and check if I can patch some tests. I am seeing that the build of iojs is not working on armv7l devices, I am getting this on armv7l devices:

assertion "(err) == (0)" failed: file "../src/node.cc", line 3481, function "void node::PlatformInit()"
[1] + Stopped (signal)     ./iojs 

@shigeki could you give the result of uname -a on the device you tested? I want to identify on what armv7 is working and on which one is not.

Added to it, I want to work on fix the way configure is detecting the macros of compiler binaries from Android NDK, but maybe that should be discussed in other issues after solve this first.

@bnoordhuis
Copy link
Member

I suspect that's because of the pthread_sigmask() in PlatformInit; IIRC, in Android it was broken until Jellybean. Can you try this patch?

diff --git a/src/node.cc b/src/node.cc
index 67cf140..f32a1a0 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -3463,7 +3463,13 @@ inline void PlatformInit() {
   sigset_t sigmask;
   sigemptyset(&sigmask);
   sigaddset(&sigmask, SIGUSR1);
-  const int err = pthread_sigmask(SIG_SETMASK, &sigmask, nullptr);
+  int err = pthread_sigmask(SIG_SETMASK, &sigmask, nullptr);
+
+#ifdef __ANDROID__
+  // Android < 4.1 has a broken pthread_sigmask() implementation.
+  if (err == EINVAL)
+    err = sigprocmask(SIG_SETMASK, &sigmask, nullptr);
+#endif

   // Make sure file descriptors 0-2 are valid before we start logging anything.
   for (int fd = STDIN_FILENO; fd <= STDERR_FILENO; fd += 1) {

@shigeki
Copy link
Contributor Author

shigeki commented Apr 16, 2015

@Gioyik I never had such an error on my Android (Lolipop) so probably it comes from the issue that is pointed out by Ben. My device's output is

root@mako:/ # uname -a
Linux localhost 3.4.0-perf-g16e203d #1 SMP PREEMPT Wed Nov 19 05:47:52 UTC 2014 armv7l GNU/Linux
root@mako:/ # grep -e ro.product.cpu  -e ro.build.version /system/build.prop

and build.prop is in https://gist.github.com/shigeki/9a5db4c9ea0e3da978fd .

I made tentative fixes to pass all the tests on my Android in https://github.com/shigeki/io.js/tree/android-fix .
Please test it if it works on your device.

@Trott
Copy link
Member

Trott commented Feb 11, 2016

Is it not-onerous to get an update on this? I don't suppose it's been quietly fixed in the last nine months or something?

@shigeki
Copy link
Contributor Author

shigeki commented Mar 22, 2016

I don't have an android device to run tests on Android now. So I close this.

@shigeki shigeki closed this as completed Mar 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

No branches or pull requests

4 participants