New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 851899 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jun 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Android: chromium linker test doesn't work

Project Member Reported by digit@google.com, Jun 12 2018

Issue description

content/shell/android_linker_test/ contains an APK to verify that the Chromium linker works properly (in particular that RELRO sharing is working as expected).

There seems to be two ways to call this, but none of them works:

1) Using "test_runner.py linker" as described in [1], which fails
   immediately because it cannot locate anything. It can be made to
   work a little better with arguments, i.e.:

    test_runner.py linker \
        --output-dir=out/Release \
        --test-apk=out/Release/apks/ChromiumTestLinker.apk

  Unfortunately, this fails with a weird Python Type Error:

     ....
     TypeError: GetTests() takes exactly 1 argument (2 given)

  So let's assume some Python function/script is broken somewhere.

2) Using 'out/Release/bin/cjro,iu,_linker_test_apk__apk run'
   (yes, it seems the _apk__apk suffix is an error in a BUILD.gn rule).

   This actually runs, but ends up with a runtime Java assertion
   failure, (see stack trace below).

   It seems that's because the code in ChromiumLinkerTestActivity
   never calls Linker.setTestRunnerClassNameForTesting() before
   LibraryLoader.ensureInitialized().

   This seems an error in the test setup itself, not in the Linker
   though :-/


06-12 11:52:31.258  8224  8224 E AndroidRuntime: FATAL EXCEPTION: main
06-12 11:52:31.258  8224  8224 E AndroidRuntime: Process: org.chromium.chromium_linker_test_apk, PID: 8224
06-12 11:52:31.258  8224  8224 E AndroidRuntime: java.lang.AssertionError
06-12 11:52:31.258  8224  8224 E AndroidRuntime: at org.chromium.base.library_loader.Linker.assertForTesting(Linker.java:292)
06-12 11:52:31.258  8224  8224 E AndroidRuntime: at org.chromium.base.library_loader.Linker.runTestRunnerClassForTesting(Linker.java:417)
06-12 11:52:31.258  8224  8224 E AndroidRuntime: at org.chromium.base.library_loader.Linker.finishLibraryLoad(Linker.java:736)
06-12 11:52:31.258  8224  8224 E AndroidRuntime: at org.chromium.base.library_loader.LibraryLoader.loadAlreadyLocked(LibraryLoader.java:418)
06-12 11:52:31.258  8224  8224 E AndroidRuntime: at org.chromium.base.library_loader.LibraryLoader.ensureInitialized(LibraryLoader.java:143)
06-12 11:52:31.258  8224  8224 E AndroidRuntime: at org.chromium.chromium_linker_test_apk.ChromiumLinkerTestActivity.onCreate(ChromiumLinkerTestActivity.java:86)

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/41ad01b919750c352db2269878708650cfad0d1e

commit 41ad01b919750c352db2269878708650cfad0d1e
Author: David 'Digit' Turner <digit@google.com>
Date: Tue Jun 12 22:52:50 2018

android: Fix chromium linker tests

As described by the corresponding bug entry, trying to run the
chromium linker test failed badly, due to a combination of Python
and Java related errors. This CL fixes it, i.e.:

- Change the GetTests() call in linker/test_case.py, avoiding
  a runtime TypeError exception.

- Add a missing call to Test.setTestRunnerClassNameForTesting()
  to properly setup the Linker class for testing (avoid a Java
  runtime assertion failure later in LibraryLoader.ensureInitialized())

- Add a 'false' parameter to the ActivityWindowAndroid() constructor
  call, in order to avoid a runtime assertion in ApplicationStatus
  later. The 'false' value prevents registering for listening to
  activity state changes, which is not needed by this test.

+ Remove the obsolete --use=legacy-linker command-line flag
  passed to the test APK, since there is now only one linker
  in use.

+ Update documentation in test_case.py on how to run the test,
  it is simply: out/Release/bin/run_chromium_linker_test_apk now.

BUG= 851899 
R=agrieve@chromium.org, pasko@chromium.org, yfriedman@chromium.org, tedchoc@chromium.org

Change-Id: I67d21faa2d7a3976ea342688d8366a25b52170ef
Reviewed-on: https://chromium-review.googlesource.com/1097125
Reviewed-by: agrieve <agrieve@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Egor Pasko <pasko@chromium.org>
Commit-Queue: David Turner <digit@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566616}
[modify] https://crrev.com/41ad01b919750c352db2269878708650cfad0d1e/build/android/pylib/linker/test_case.py
[modify] https://crrev.com/41ad01b919750c352db2269878708650cfad0d1e/build/android/pylib/local/device/local_device_linker_test_run.py
[modify] https://crrev.com/41ad01b919750c352db2269878708650cfad0d1e/content/shell/android/linker_test_apk/chromium_linker_test_linker_tests.cc
[modify] https://crrev.com/41ad01b919750c352db2269878708650cfad0d1e/content/shell/android/linker_test_apk/src/org/chromium/chromium_linker_test_apk/ChromiumLinkerTestActivity.java

Comment 2 by digit@google.com, Jun 13 2018

Status: Fixed (was: Assigned)

Sign in to add a comment