Opened 12 months ago

Last modified 4 months ago

#32340 assigned defect

[Android] FAIL src/test/test_process_slow.c:240: assert(smartlist_len(process_data->stdout_data) OP_EQ 12): 2 vs 12

Reported by: eighthave Owned by: ahf
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: Android, 043-should, 044-deferred
Cc: n8fr8, ahf Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Running the test-slow suite fails every time with this error on 0.4.1.x, 0.4.2.x, and master:

slow/process/callbacks: 
  FAIL src/test/test_process_slow.c:240: assert(smartlist_len(process_data->stdout_data) OP_EQ 12): 2 vs 12
  [callbacks FAILED]

The full build/test log is here:
https://gitlab.com/eighthave/tor/-/jobs/336701282

To try this yourself, it'll be easiest using the Guardian Project fork, which is in sync on GitHub and GitLab:

I looked into it a bit, but couldn't quite figure out what was being tested there. Is it Tor's "smartlist" functions? stdin/stdout/stderr have annoying, arbitrary restrictions in Android, so it could be related to that. For example, "native" code loaded from a shared library will have stdin/stdout/stderr redirected to /dev/null, while in Java code, it is reachable. There is a related example on #32036

Child Tickets

Change History (9)

comment:1 Changed 12 months ago by eighthave

Here's all the steps that fail from that test:

slow/process/callbacks: 
  FAIL src/test/test_process_slow.c:240: assert(smartlist_len(process_data->stdout_data) OP_EQ 12): 2 vs 12
  FAIL src/test/test_process_slow.c:243: assert(smartlist_len(process_data->stderr_data) OP_EQ 3): 0 vs 3
  FAIL src/test/test_process_slow.c:245: assert(process_data->exit_code OP_EQ 0): 256 vs 0
  FAIL src/test/test_process_slow.c:251: assert(smartlist_get(process_data->stdout_data, 0) OP_EQ argv0_expected): <<NULL>> vs <argv[0] = '/home/hans/code/guardianproject/tor-android/external/tor/src/test/test-process'>
  FAIL src/test/test_process_slow.c:279: assert(smartlist_get(process_data->stderr_data, 0) OP_EQ "Output on stderr"): <<NULL>> vs <Output on stderr>
  [callbacks FAILED]

Here's how I ran it easily:

$ git clone https://gitlab.com/eighthave/tor-android
$ cd tor-android/external
$ make APP_ABI=x86
# start Android x86 or x86_64 emulator
$ rm -f tor-build-stamp ; make APP_ABI=x86 \
    && adb -e push test/x86/test-slow /data/local/tmp/ \
    && adb -e shell /data/local/tmp/test-slow

comment:2 Changed 12 months ago by nickm

Cc: ahf added
Keywords: 043-should added
Milestone: Tor: 0.4.3.x-final
Summary: FAIL src/test/test_process_slow.c:240: assert(smartlist_len(process_data->stdout_data) OP_EQ 12): 2 vs 12[Android] FAIL src/test/test_process_slow.c:240: assert(smartlist_len(process_data->stdout_data) OP_EQ 12): 2 vs 12

comment:3 Changed 12 months ago by eighthave

And one intermittent failure:

hs_service/service_intro_point: [forking] 
  FAIL src/test/test_hs_service.c:696: assert(ip->time_to_expire OP_GE now + INTRO_POINT_LIFETIME_MIN_SECONDS - 500): 1572508083 vs 1572508798
  [service_intro_point FAILED]

https://gitlab.com/eighthave/tor/-/jobs/337312613

comment:4 Changed 12 months ago by eighthave

I can't quite pin down what is failing here, but it seems to happen in builds done with NDK r17b but not r20:

slow/crypto/fuzz_donna/ed25519_donna: [forking] OK
slow/crypto/fuzz_donna/ed25519_ref10: [forking] OK
slow/process/callbacks: $ exit $EXITVALUE
ERROR: Job failed: exit code 1

https://gitlab.com/guardianproject/tor/-/jobs/337775417

comment:5 Changed 10 months ago by ahf

The test checks if we can run a binary, get the output from a child process' standard out and standard error. We store each line read in a smartlist_t and check if we have received the expected number of lines. If the value is 0, it's often because we were not able to run the process.

Can you run the test binary manually?

comment:6 Changed 10 months ago by eighthave

The libtor.so generated from the same build works fine, that I've tested a lot. That's easily reproducible with my tor-android fork https://gitlab.com/eighthave/tor-android

comment:7 Changed 9 months ago by nickm

Owner: set to ahf
Status: newassigned

comment:8 Changed 5 months ago by nickm

Milestone: Tor: 0.4.3.x-finalTor: 0.4.4.x-final

0.4.3 was released: Move non merge-ready 0.4.3 tickets to 044.

comment:9 Changed 4 months ago by nickm

Keywords: 044-deferred added
Milestone: Tor: 0.4.4.x-finalTor: unspecified

Bulk-remove tickets from 0.4.4. Add the 044-deferred label to them.

Note: See TracTickets for help on using tickets.