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

x/mobile: loading prevents android errors from printing to logcat #9482

dskinner opened this issue Dec 31, 2014 · 3 comments


Copy link

@dskinner dskinner commented Dec 31, 2014

Given a that is loaded via Go.init(this) in Application class can cause regular app errors to not print to logcat.

I've seen this behavior using the v7 RecyclerView and not setting a layout manager which would normally print an error to logcat and exit. Instead, the go runtime starts and is followed by a WIN DEATH and nothing is printed in regards to the RecyclerView error.

Disabling Go.init(this) and any other related Go code will allow the error to print to logcat.

I can put together a minimal sample upon request if the above is not clear enough.

Copy link

@crawshaw crawshaw commented Dec 31, 2014

By WIN DEATH, do you mean the process exited? If so, that's why you're not seeing any subsequent errors.

I'd need more information to guess why your application is crashing. A copy of the log and some code would be helpful.

Copy link
Member Author

@dskinner dskinner commented Jan 1, 2015

Here is a minimal sample application with the already built:

Built with go at 6ceb604
and gobind at 3d879bb1b3c296099c6d8ea545d18e259aab1f2d

Tested on a Nexus 10 running Android 5.0.1

This line is intentionally commented out to produce an error:

In the repo, the shared library is not loaded as can be seen here:

This produces the following stack trace as expected

01-01 11:52:10.612    7316-7316/cc.dasa.sample E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: cc.dasa.sample, PID: 7316
    java.lang.NullPointerException: Attempt to invoke virtual method 'void$LayoutManager.onMeasure($Recycler,$State, int, int)' on a null object reference
            at android.view.View.measure(
            at android.widget.RelativeLayout.measureChildHorizontal(
            at android.widget.RelativeLayout.onMeasure(
            at android.view.View.measure(
            at android.view.ViewGroup.measureChildWithMargins(
            at android.widget.FrameLayout.onMeasure(
            at android.view.View.measure(
            at android.view.ViewGroup.measureChildWithMargins(
            at android.widget.LinearLayout.measureChildBeforeLayout(
            at android.widget.LinearLayout.measureVertical(
            at android.widget.LinearLayout.onMeasure(
            at android.view.View.measure(
            at android.view.ViewGroup.measureChildWithMargins(
            at android.widget.FrameLayout.onMeasure(
            at android.view.View.measure(
            at android.view.ViewRootImpl.performMeasure(
            at android.view.ViewRootImpl.measureHierarchy(
            at android.view.ViewRootImpl.performTraversals(
            at android.view.ViewRootImpl.doTraversal(
            at android.view.ViewRootImpl$
            at android.view.Choreographer$
            at android.view.Choreographer.doCallbacks(
            at android.view.Choreographer.doFrame(
            at android.view.Choreographer$
            at android.os.Handler.handleCallback(
            at android.os.Handler.dispatchMessage(
            at android.os.Looper.loop(
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(

Once this line is uncommented:

Launching the application produces the following output:

01-01 12:02:45.003      400-413/? I/ActivityManager﹕ START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=cc.dasa.sample/.MainActivity (has extras)} from uid 10012 on display 0
01-01 12:02:45.072     400-2043/? I/ActivityManager﹕ Start proc cc.dasa.sample for activity cc.dasa.sample/.MainActivity: pid=8117 uid=10079 gids={50079, 9997} abi=armeabi-v7a
01-01 12:02:45.098    8117-8117/? I/art﹕ Late-enabling -Xcheck:jni
01-01 12:02:45.182    8117-8117/cc.dasa.sample W/linker﹕ has text relocations. This is wasting memory and prevents security hardening. Please fix.
01-01 12:02:45.222    8117-8134/cc.dasa.sample I/Go﹕ app.Run
01-01 12:02:45.224    8117-8134/cc.dasa.sample I/go/Seq﹕ loaded go/Seq
01-01 12:02:45.225    8117-8117/cc.dasa.sample I/Go﹕ Runtime started
01-01 12:02:45.374     400-2043/? I/art﹕ Explicit concurrent mark sweep GC freed 54700(2MB) AllocSpace objects, 21(4MB) LOS objects, 28% free, 40MB/56MB, paused 1.031ms total 92.567ms
01-01 12:02:45.380    8117-8141/cc.dasa.sample D/OpenGLRenderer﹕ Render dirty regions requested: true
01-01 12:02:45.384    8117-8117/cc.dasa.sample D/Atlas﹕ Validating map...
01-01 12:02:45.409      400-413/? I/WindowState﹕ WIN DEATH: Window{1c8f3738 u0 cc.dasa.sample/cc.dasa.sample.MainActivity}
01-01 12:02:45.441      130-130/? I/Zygote﹕ Process 8117 exited due to signal (11)
01-01 12:02:45.461      400-979/? I/ActivityManager﹕ Process cc.dasa.sample (pid 8117) has died
01-01 12:02:45.462      400-979/? W/ActivityManager﹕ Force removing ActivityRecord{123fa723 u0 cc.dasa.sample/.MainActivity t513}: app died, no saved state
01-01 12:02:45.483     909-1094/? D/mali_winsys﹕ new_window_surface returns 0x3000

Noticeably, the stacktrace for the recyclerview error is lacking above.

It's worth noting I suppose that setting the layoutmanager for recyclerview and loading the does allow the application to launch successfully.

@mikioh mikioh added the repo-mobile label Jan 2, 2015
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title mobile: loading prevents android errors from printing to logcat x/mobile: loading prevents android errors from printing to logcat Apr 14, 2015
@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015
@rsc rsc removed the repo-mobile label Apr 14, 2015
Copy link
Member Author

@dskinner dskinner commented Sep 1, 2017

unable to reproduce on latest, closing.

@dskinner dskinner closed this Sep 1, 2017
@golang golang locked and limited conversation to collaborators Sep 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.