Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

issue with MIPS API #5126

Closed
Closed

Description

@cammace

Trying to build the SNAPSHOT on bitrise failed, with a little more investigating with @bleege we were able to determine that this issue is specific to MIPS ABI, all others seem to work fine. Running make apackage locally resulted in this output:

...
CXX(target) Debug/obj.target/core/src/mbgl/geometry/static_vertex_buffer.o
  CXX(target) Debug/obj.target/core/src/mbgl/geometry/text_buffer.o
  CXX(target) Debug/obj.target/core/src/mbgl/geometry/vao.o
  CXX(target) Debug/obj.target/core/src/mbgl/gl/debugging.o
  CXX(target) Debug/obj.target/core/src/mbgl/gl/gl.o
  CXX(target) Debug/obj.target/core/src/mbgl/gl/gl_config.o
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/annotation_manager-84c2c5.s: Assembler messages:
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/annotation_manager-84c2c5.s:166400: Warning: no .cprestore pseudo-op used in PIC code
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/annotation_manager-84c2c5.s:166400: Warning: macro instruction expanded into multiple instructions
  CXX(target) Debug/obj.target/core/src/mbgl/gl/gl_object_store.o
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/annotation_manager-84c2c5.s:220949: Warning: no .cprestore pseudo-op used in PIC code
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/annotation_manager-84c2c5.s:220949: Warning: macro instruction expanded into multiple instructions
  CXX(target) Debug/obj.target/core/src/mbgl/gl/texture_pool.o
  CXX(target) Debug/obj.target/core/src/mbgl/layer/background_layer.o
clang36++: error: unable to execute command: Segmentation fault: 11
clang36++: error: assembler command failed due to signal (use -v to see invocation)
clang version 3.6 
Target: mipsel-none-linux-android
Thread model: posix
clang36++: note: diagnostic msg: PLEASE submit a bug report to http://source.android.com/source/report-bugs.html and include the crash backtrace, preprocessed source, and associated run script.
  CXX(target) Debug/obj.target/core/src/mbgl/layer/circle_layer.o
clang36++: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang36++: note: diagnostic msg: /var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/annotation_manager-cd4044.cpp
clang36++: note: diagnostic msg: /var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/annotation_manager-cd4044.sh
clang36++: note: diagnostic msg: 

********************
make[1]: *** [Debug/obj.target/core/src/mbgl/annotation/annotation_manager.o] Error 254
make[1]: *** Waiting for unfinished jobs....
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/feature_index-bf683d.s: Assembler messages:
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/feature_index-bf683d.s:20314: Warning: no .cprestore pseudo-op used in PIC code
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/feature_index-bf683d.s:20314: Warning: macro instruction expanded into multiple instructions
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/feature_index-bf683d.s:23187: Warning: no .cprestore pseudo-op used in PIC code
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/feature_index-bf683d.s:23187: Warning: macro instruction expanded into multiple instructions
clang36++: error: unable to execute command: Segmentation fault: 11
clang36++: error: assembler command failed due to signal (use -v to see invocation)
clang version 3.6 
Target: mipsel-none-linux-android
Thread model: posix
clang36++: note: diagnostic msg: PLEASE submit a bug report to http://source.android.com/source/report-bugs.html and include the crash backtrace, preprocessed source, and associated run script.
clang36++: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang36++: note: diagnostic msg: /var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/feature_index-7df367.cpp
clang36++: note: diagnostic msg: /var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/feature_index-7df367.sh
clang36++: note: diagnostic msg: 

********************
make[1]: *** [Debug/obj.target/core/src/mbgl/geometry/feature_index.o] Error 254
make: *** [android-lib-mips] Error 2

cc: @jfirebaugh @kkaefer @tmpsantos @brunoabinader @bleege

Activity

  1. added
    Core
    on May 24, 2016
  2. added
    Android
    on May 24, 2016
  3. jfirebaugh commented on May 24, 2016

    @jfirebaugh
    Contributor

    Looks like a compiler bug. My first instinct would be to try upgrading to clang 3.7 or later.

  4. bleege commented on May 24, 2016

    @bleege
    Contributor

    Noting that this can be duplicated quicker using make android-lib-mips instead of running the full ABI building make apackage.

  5. jfirebaugh commented on May 24, 2016

    @jfirebaugh
    Contributor

    Does this still occur after the NDK revert in 6abd3d7?

  6. bleege commented on May 24, 2016

    @bleege
    Contributor

    Yep, that's actually how @cammace discovered it when he went to roll a new SNAPSHOT build from master after the NDK revert this afternoon.

  7. bleege commented on May 25, 2016

    @bleege
    Contributor

    My first instinct would be to try upgrading to clang 3.7 or later.

    I'm looking into this, but so far haven't found were the compiler is configured. So far I've looked in:

    • Makefile
    • mbgl.gypi
    • platform/android/scripts/configure.sh
    • platform/android/scripts/debug.sh
    • platform/android/scripts/toolchain.sh

    Will continue looking.

  8. bleege commented on May 25, 2016

    @bleege
    Contributor

    Running make android produces the following output from the Makefile. It looks like the Mason is actually setting the Clang version via the CXX and CC environment variables and that it's setting them to use the Clang that comes with the Android NDK. I'll dig into the Android NDK docs to see how customizable this version is.

    MASON_PLATFORM="android" MASON_ANDROID_ABI="arm-v7" CXX="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-clang++" CC="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-clang" LD="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-ld" LINK="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-clang++" AR="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-ar" RANLIB="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-ranlib" STRIP="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-strip" LDFLAGS="-target armv7-none-linux-androideabi -march=armv7-a -Wl,--fix-cortex-a8 -fuse-ld=gold -no-canonical-prefixes -Wl,--warn-shared-textrel -Wl,--fatal-warnings ${LDFLAGS:-}" CFLAGS="-target armv7-none-linux-androideabi -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -D_LITTLE_ENDIAN -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-integrated-as -fomit-frame-pointer -fstrict-aliasing -Wno-invalid-command-line-argument -Wno-unused-command-line-argument ${CFLAGS:-}" CXXFLAGS="-target armv7-none-linux-androideabi -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -D_LITTLE_ENDIAN -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-integrated-as -fomit-frame-pointer -fstrict-aliasing -Wno-invalid-command-line-argument -Wno-unused-command-line-argument ${CXXFLAGS:-}" CPPFLAGS="-D__ANDROID__ ${CPPFLAGS:-}" JNIDIR="armeabi-v7a" ./configure platform/android/scripts/configure.sh build/android-arm-v7/config.gypi android arm-v7
  9. bleege commented on May 25, 2016

    @bleege
    Contributor
  10. bleege commented on May 25, 2016

    @bleege
    Contributor

    Getting MIPS compiler name from Mason via make android-lib-mips, which is going to correspond to the following configs on Mason -->

    https://github.com/mapbox/mason/tree/master/scripts/android-ndk/mips-9-r10e

    MASON_PLATFORM="android" MASON_ANDROID_ABI="mips" CXX="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/mips-9-r10e/bin/mipsel-linux-android-clang++" CC="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/mips-9-r10e/bin/mipsel-linux-android-clang" LD="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/mips-9-r10e/bin/mipsel-linux-android-ld" LINK="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/mips-9-r10e/bin/mipsel-linux-android-clang++" AR="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/mips-9-r10e/bin/mipsel-linux-android-ar" RANLIB="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/mips-9-r10e/bin/mipsel-linux-android-ranlib" STRIP="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/mips-9-r10e/bin/mipsel-linux-android-strip" LDFLAGS="-target mipsel-none-linux-android -no-canonical-prefixes -Wl,--warn-shared-textrel -Wl,--fatal-warnings ${LDFLAGS:-}" CFLAGS="-target mipsel-none-linux-android -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-integrated-as -fomit-frame-pointer -fstrict-aliasing -Wno-invalid-command-line-argument -Wno-unused-command-line-argument ${CFLAGS:-}" CXXFLAGS="-target mipsel-none-linux-android -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-integrated-as -fomit-frame-pointer -fstrict-aliasing -Wno-invalid-command-line-argument -Wno-unused-command-line-argument ${CXXFLAGS:-}" CPPFLAGS="-D__ANDROID__ ${CPPFLAGS:-}" JNIDIR="mips" ./configure platform/android/scripts/configure.sh build/android-mips/config.gypi android mips
  11. bleege commented on May 25, 2016

    @bleege
    Contributor

    So looking at the script.sh for the MIPS compiler on Mason, it looks like we need to alter the LLVM version here in order to change LLVM / Clang to Version 3.7. I'm not quite sure how to make this change and test it without committing this change to master on Mason (aka, "how do I point my local Mason file at branch?"). I'll need some help on this one.

    From another angle, every time I run the MIPS compiler it consistently errors on the same file called background_layer.o as it did in @cammace's original debug log. I'm wondering if there's something that has recently changed (since Monday) in the source that MIPS isn't cool with? The reason being is that the last good nightly 4.1.0-SNAPSHOT is from Monday morning (Number 34 on the repo). Per commit CI only compiles on the default arm7 ABI to save a ton of processing time, while the nightly one builds for the entire 6 ABI suite (arm-v5, arm-v7, arm-v8, x86, x86-64, mips) so that it can produce a SNAPSHOT release.

  12. bleege commented on May 25, 2016

    @bleege
    Contributor

    Picking this up this morning, since I don't know much about the finer points of Mason I'm going to see if I can timebox when MIPS stopped compiling so that we can get some insight into what likely is causing this pain. To do this I'm first going to get the last commit before @kkaefer's NDK update ( 7272d7c ) and run make android-lib-mips on it. If it compiles then we have a baseline for when things stopped and I can then try again with a commit a little further in the future to narrow in on it.

  13. bleege commented on May 25, 2016

    @bleege
    Contributor

    Yep, we've found our baseline! make android-lib-mips compiles at 7272d7c. So something has changed since Monday morning that has caused MIPS to break. I'm going to try building next with @jfirebaugh's commit from the end of Monday 1f8de2b. This will use the new NDK stuff, but the issue there wasn't that it wouldn't compile but that it would crash at run time. Depending on how this goes I'll try to revert the NDK build locally again at that commit and see if it still compiles.

    screen shot 2016-05-25 at 9 08 01 am

  14. bleege commented on May 25, 2016

    @bleege
    Contributor

    I just ran make android-lib-mips on 1f8de2b and it compiled. I noticed that it was using Clang 3.8 which is likely related to the NDK bump. I'm going to revert the NDK bump locally now and try compiling with the old NDK to see if things are still good.

  15. 22 remaining items

  16. tobrun commented on May 31, 2016

    @tobrun
    Member

    @bleege per commit doesn't build mips

  17. bleege commented on May 31, 2016

    @bleege
    Contributor

    @tobrun Right. Just establishing a baseline here. 😉

  18. bleege commented on May 31, 2016

    @bleege
    Contributor

    Looking at the bitrise.yml on the release-android-v4.1.0 branch shows that it's building the Release Build type as it should. I'm going to update my local repo and try to build there to see if I can get more details than what Bitrise is sharing.

    https://github.com/mapbox/mapbox-gl-native/blob/release-android-v4.1.0/platform/android/bitrise.yml#L77

  19. bleege commented on May 31, 2016

    @bleege
    Contributor

    When building locally for MIPS with the latest commit from release-android-v4.1.0 c66cf0f it fails (as expected) but when I change the /Makefile back to Release from Debug it does compile as expected. This makes me wonder if somehow the bitrise.yml is having trouble setting the BUILDTYPE environment variable in time (or at all) for the build process to run.

  20. tmpsantos commented on May 31, 2016

    @tmpsantos
    Contributor

    When building locally for MIPS with the latest commit from release-android-v4.1.0 c66cf0f it fails (as expected) but when I change the /Makefile back to Release from Debug it does compile as expected.

    Works locally for me on Release too.

  21. bleege commented on May 31, 2016

    @bleege
    Contributor

    I just tried to recreate the Bitrise process locally by reverting /Makefile back to it's Debug state and setting the BUILDTYPE environment variable via the command line before firing off a make android-lib-mips build. This worked and produced a MIPS .so file. The issue has to be something with Bitrise. To test it out I'm running a new scheduled workflow on Bitrise right now to produce a new SNAPSHOT. This is the same process I originally used to verify that the reconfigured bitrise.yml was working. If it works then we're back to square one (but with a new fresh SNAPSHOT for the first time since last Friday), and if it doesn't then at least things are consistently broken. 😉

  22. tmpsantos commented on May 31, 2016

    @tmpsantos
    Contributor

    It turns out that the issue is disabling optimization when building Debug. I managed to build Debug just fine with the change below. Definitely a compiler bug.

    diff --git a/mbgl.gypi b/mbgl.gypi
    index c25e53e..9855c6b 100644
    --- a/mbgl.gypi
    +++ b/mbgl.gypi
    @@ -79,7 +79,7 @@
                   ],
                 },
               }, {
    -            'cflags_cc': [ '-g', '-O0', '-fno-omit-frame-pointer','-fwrapv', '-fstack-protector-all', '-fno-common' ],
    +            'cflags_cc': [ '-g', '-O1', '-fno-omit-frame-pointer','-fwrapv', '-fstack-protector-all', '-fno-common' ],
                 'conditions': [
                   ['coverage', { 'cflags_cc': [ '--coverage' ] }],
                 ],
    
  23. bleege commented on May 31, 2016

    @bleege
    Contributor

    The manually kicked off scheduled release in Bitrise just failed at the MIPS process again. @tmpsantos and I discussed this and it looks like it may actually be something with one of the arm ABIs but can't tell for sure as the Bitrise command is using compiled parallelization to do faster builds. To help bring clarity to this I'm going to change this to back to use the sequential build process and kick off another scheduled build (all from the release-android-v4.1.0 branch to minimize changes introduced to this debug effort). @tmpsantos was also able to confirm that the Bitrise process IS being compiled in Release mode based off the logs shown.

    // Parallelized Builds
    make apackage -j4
    
    // Sequential Builds
    make apackage
  24. added a commit that references this issue on May 31, 2016
  25. bleege commented on May 31, 2016

    @bleege
    Contributor

    @tmpsantos was able to use the failure in the Serialized Build process to isolate the issue. He's working on a solution now and will merge when complete.

  26. bleege commented on May 31, 2016

    @bleege
    Contributor

    @tmpsantos was able to find a solution this afternoon (evening in Finland!) and we tested it out locally. I'm going to merge the PR #5198 into master and the cherry pick to release-android-v4.1.0. After that I'll kick off a new scheduled build to produce a new SNAPSHOT.

  27. bleege commented on May 31, 2016

    @bleege
    Contributor

    Merged #5198 into master and cherry picked to release-android-v4.1.0. Time to kick off a SNAPSHOT build!

    screen shot 2016-05-31 at 5 14 24 pm

  28. bleege commented on May 31, 2016

    @bleege
    Contributor

    The SNAPSHOT build worked! It's build number 40 on SNAPSHOT server (see link below). We should be good to go again, but I'm going to leave this ticket open until we can confirm that tonight's automated build process works as expected again and produces a new SNAPSHOT. Will check tomorrow morning and hopefully close then.

    https://oss.sonatype.org/content/repositories/snapshots/com/mapbox/mapboxsdk/mapbox-android-sdk/4.1.0-SNAPSHOT/

  29. bleege commented on Jun 1, 2016

    @bleege
    Contributor

    Yep, last night's automated build ran on Bitrise and produced a brand new SNAPSHOT as expected from release-android-v4.1.0. We're back on track here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

AndroidCorebug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions