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

SIGSEGV crash with ART library on Android #6760

Closed
mpatric opened this issue Apr 1, 2016 · 49 comments
Closed

SIGSEGV crash with ART library on Android #6760

mpatric opened this issue Apr 1, 2016 · 49 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@mpatric
Copy link
Contributor

mpatric commented Apr 1, 2016

This issue is somewhat intermittent, but I have managed to create a minimal example that will crash with some regularity. When the ART library is used to render a component it seems it will cause a crash on Android after it has rendered several times. This issue happens looks to have started with React Native 0.21 and only happens on Android.

Unfortunately the crash happens deep in libc and tracing the cause of the issue has been difficult. The code below reproduces the issue on Android. It will sometimes crash quite quickly (within seconds) and sometimes takes a bit longer (tens of seconds) with an error in the log like:

A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x9fa40028 in tid 4388 (mqt_js)

import React, { Text, View } from 'react-native';
const { Surface, Group, Shape } = React.ART;

const Smiley = React.createClass({
  render() {
    return (
      <Surface width={32} height={32}>
        <Group scaleX={1} scaleY={1} rotation={this.props.rotation} originX={16} originY={16} opacity={this.props.opacity}>
          <Group>
            <Shape fill="#222" d="M16 .004 c-8.837 0 -16 7.164 -16 16 0 8.837 7.163 16 16 16 s16 -7.163 16 -16 c0 -8.836 -7.163 -16 -16 -16 z m0 29 c-7.16 0 -12.985 -5.832 -12.985 -13 s5.825 -13 12.985 -13 c7.16 0 12.985 5.832 12.985 13 s-5.825 13 -12.985 13 z"/>
            <Shape fill="#222" d="M7.932 12.77 A2.513 2.5 0 1 0 12.958 12.77 A2.513 2.5 0 1 0 7.932 12.77 z"/>
            <Shape fill="#222" d="M18.872 12.77 A2.513 2.5 0 1 0 23.898000000000003 12.77 A2.513 2.5 0 1 0 18.872 12.77 z"/>
            <Shape fill="#222" d="M24.054 18.39 a1.006 1.006 0 0 0 -.85 .01 c-.005 .004 -.01 .003 -.015 .006 l-.98 .506 c-.62 .278 -1.4 .664 -2.43 .992 -1.04 .328 -2.53 .503 -4.09 .575 -1.56 -.08 -3.05 -.25 -4.09 -.58 -1.04 -.33 -1.82 -.72 -2.43 -.99 l-.97 -.51 -.02 -.01 a1 1 0 0 0 -.85 -.01 .992 .992 0 0 0 -.5 1.32 c1.59 3.502 4.93 5.79 8.58 5.946 .05 .01 .5 .01 .552 0 3.65 -.16 6.99 -2.444 8.582 -5.946 a1 1 0 0 0 -.503 -1.322 z"/>
          </Group>
        </Group>
      </Surface>
    );
  },
});

class CrashTestDummy extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      count: 0,
    };
  }

  componentDidMount() {
    setInterval(() => { this.state && this.setState({count: this.state.count + 1}) }, 20);
  }

  render() {
    return (
      <View style={{flex: 1, justifyContent: "center", alignItems: "center"}}>
        <Text>
          Count: {this.state.count}
        </Text>
        <Smiley/>
      </View>
    );
  }
}

React.AppRegistry.registerComponent('CrashTestDummy', () => CrashTestDummy);

I've noticed that when I use a more complex component that contains more ART elements, it crashes more quickly, suggesting a memory issue.

@dantman
Copy link
Contributor

dantman commented Apr 8, 2016

I'm having this issue too. I started using react-native-art-svg to implement a radial progress/timer bar around a button; now after an inconsistent amount of time of that bar ticking away my app crashes on Android.

Here's the console output for when my app crashes:

04-08 11:28:54.660 202-202/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-08 11:28:54.660 202-202/? A/DEBUG: Build fingerprint: 'google/hammerhead/hammerhead:6.0.1/MMB29V/2554798:user/release-keys'
04-08 11:28:54.660 202-202/? A/DEBUG: Revision: '0'
04-08 11:28:54.660 202-202/? A/DEBUG: ABI: 'arm'
04-08 11:28:54.661 202-202/? A/DEBUG: pid: 23720, tid: 23758, name: mqt_js  >>> com.redwerks.mindmonkey <<<
04-08 11:28:54.661 202-202/? A/DEBUG: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x971a0084
04-08 11:28:54.708 202-202/? A/DEBUG:     r0 9c6369d0  r1 0000001a  r2 0000001c  r3 fffffffe
04-08 11:28:54.708 202-202/? A/DEBUG:     r4 9719ffa0  r5 af00a9e0  r6 9719ffa4  r7 9f3fe498
04-08 11:28:54.708 202-202/? A/DEBUG:     r8 00000003  r9 fffffffb  sl 9f0b2834  fp 9f4040a4
04-08 11:28:54.708 202-202/? A/DEBUG:     ip 00000020  sp 9f3fe3d0  lr aef39907  pc 9ed0bb06  cpsr 80010030
04-08 11:28:54.709 202-202/? A/DEBUG:     #00 pc 00006b06  <unknown>
04-08 11:28:54.710 202-202/? A/DEBUG:     #01 pc 000fe903  /data/app/com.redwerks.mindmonkey-1/lib/arm/libjsc.so
04-08 11:28:54.710 202-202/? A/DEBUG:     #02 pc fffffff9  <unknown>
04-08 11:28:55.554 202-202/? E/DEBUG: AM write failed: Broken pipe
04-08 11:28:55.557 781-797/? I/BootReceiver: Copying /data/tombstones/tombstone_07 to DropBox (SYSTEM_TOMBSTONE)
04-08 11:28:55.566 781-24304/? W/ActivityManager:   Force finishing activity com.redwerks.mindmonkey/.MainActivity
04-08 11:28:55.605 781-1031/? I/WindowState: WIN DEATH: Window{97beca7 u0 com.redwerks.mindmonkey/com.redwerks.mindmonkey.MainActivity}
04-08 11:28:55.606 781-1345/? D/GraphicsStats: Buffer count: 8
04-08 11:28:55.633 216-216/? I/Zygote: Process 23720 exited due to signal (11)
04-08 11:28:55.654 781-791/? I/ActivityManager: Process com.redwerks.mindmonkey (pid 23720) has died
04-08 11:28:55.674 781-8966/? I/OpenGLRenderer: Initialized EGL, version 1.4
04-08 11:28:56.185 781-799/? W/WindowAnimator: Failed to dispatch window animation state change.
                                               android.os.DeadObjectException
                                                   at android.os.BinderProxy.transactNative(Native Method)
                                                   at android.os.BinderProxy.transact(Binder.java:503)
                                                   at android.view.IWindow$Stub$Proxy.onAnimationStopped(IWindow.java:534)
                                                   at com.android.server.wm.WindowAnimator.updateWindowsLocked(WindowAnimator.java:286)
                                                   at com.android.server.wm.WindowAnimator.animateLocked(WindowAnimator.java:678)
                                                   at com.android.server.wm.WindowAnimator.-wrap0(WindowAnimator.java)
                                                   at com.android.server.wm.WindowAnimator$1.doFrame(WindowAnimator.java:123)
                                                   at android.view.Choreographer$CallbackRecord.run(Choreographer.java:856)
                                                   at android.view.Choreographer.doCallbacks(Choreographer.java:670)
                                                   at android.view.Choreographer.doFrame(Choreographer.java:603)
                                                   at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
                                                   at android.os.Handler.handleCallback(Handler.java:739)
                                                   at android.os.Handler.dispatchMessage(Handler.java:95)
                                                   at android.os.Looper.loop(Looper.java:148)
                                                   at android.os.HandlerThread.run(HandlerThread.java:61)
                                                   at com.android.server.ServiceThread.run(ServiceThread.java:46)

@mpatric
Copy link
Contributor Author

mpatric commented Apr 11, 2016

I've just confirmed that this issue still exists in v0.23.1

@ghost
Copy link

ghost commented Apr 12, 2016

I am seeing a similar error message as well on Android:
I am getting this: A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x4604b088 in tid 3316 (mqt_js)
I am trying the same application on 2 different android versions:

  • On Samsung S6 with Android version 5.1.1, it crashes all the time at boot
  • On Nexus 5 with Android version 6.0, I could not see this issue.

The log output in the failing case:

logfailure.txt

@mpatric
Copy link
Contributor Author

mpatric commented May 3, 2016

This issue still exists in v0.24.1

@kevinejohn
Copy link
Contributor

+1

@kevinejohn
Copy link
Contributor

I noticed if you turn off debug mode it doesn't crash.

screen shot 2016-05-13 at 4 39 22 pm

@mpatric
Copy link
Contributor Author

mpatric commented May 16, 2016

As far as I recall, it does crash when debug mode is turned off - it just takes longer for the crash to happen.

@bongole
Copy link

bongole commented May 18, 2016

+1

1 similar comment
@tomauty
Copy link
Contributor

tomauty commented May 24, 2016

+1

@xvalentino
Copy link
Contributor

Anyone have an idea for a workaround? Since there seems to be some kind of memory leak, is there a way we can manually call some kind of garbage collection? I need my app to be able to run all day, while it always crashes at best about every ~12 hours.

@texas697
Copy link

+1

1 similar comment
@brunoccc
Copy link

+1

@experimentsin
Copy link

We see this too. A lot in debug mode. From the dumps, it looks like a crash on the JSC (JavaScriptCore) execution thread.

I started thinking in terms of building a debug version of JSC to see if we could get more information. What I found wasn't entirely encouraging. The JSC build used in React Native seems to come from here:

https://github.com/facebook/android-jsc

and is only buildable with Buck out of the box. I also looked to see which version of JSC it was based on. In fetch_sources.sh it grabs:

http://builds.nightly.webkit.org/files/trunk/src/WebKit-r174650.tar.bz2

I searched for that version here:

https://webkit.org/nightly/archives/

and the timestamp on it is: October 14, 2014 1:09 PM GMT.

I would suggest that the dependence of React Native for Android on an 18 month old (and counting) snapshot of JSC should be of some concern to us all.

@experimentsin
Copy link

I'm continuing to experiment with this off to the side. I find that if I rebuild android-jsc with JIT compilation fully disabled and relink our app with it, it no longer crashes in debug mode on Android.

This doesn't necessarily mean that JIT compilation is buggy I guess; it could just be that memory pressure is reduced slightly and/or it perturbs the timing of something enough to hide the problem.

FWIW, the published android-jsc seems to use this compile time configuration of JavaScriptCore:

preprocessor_flags = [
    '-DWTF_USE_EXPORT_MACROS=1',
    '-DBUILDING_JavaScriptCore=1',
    '-DENABLE_JIT=1',
    '-DENABLE_DFG_JIT=0',
    '-DENABLE_LLINT=1',
    '-DINTPTR_MAX=LONG_MAX',
    '-DLOG_TAG="JavaScriptCore"',
  ],

which I think gives us the Baseline JIT only. JSC has layered JIT solutions - see these:

https://webkit.org/blog/3362/introducing-the-webkit-ftl-jit/
https://trac.webkit.org/wiki/JavaScriptCore

for example.

Anyway, flipping to ENABLE_JIT=0 (in a couple of places in the BUCK file) changes the behaviour of things enough to stop the crashing so far. But trials continue.

@rahuljiresal
Copy link

rahuljiresal commented Jun 23, 2016

I was able to reproduce it consistently in our project. I get the same crash every time I'm making a call to a server and the response is NOT a 2xx response. It crashes for 4xx, 5xx and so on.

However, when I tried to reproduce it in isolation, by creating a new project, the crash would not depend on the server's response. It would solely depend on how many components are being loaded.

Also, FWIW, for me, the crash does not happen when I'm connected to the Chrome Debugger. Only happens if I'm not connected, which is bad because it happens in production.

@fab1an
Copy link

fab1an commented Jun 24, 2016

See my comment here: software-mansion/react-native-svg#38 (comment)

@tomazahlin
Copy link

For me this is still crashing in 0.28. Anyone else has this problem?

@hlandao
Copy link

hlandao commented Jul 16, 2016

+1

@tomauty
Copy link
Contributor

tomauty commented Jul 27, 2016

Yeah, not sure if this is related to ART for me anymore, but I do have 2 views overlaying one another when this happens, both containing ART code.

@ggsrivas
Copy link

Did anyone find any workaround or solution to this? I am facing the same issue.

@Traviskn
Copy link

Traviskn commented Sep 26, 2016

I am seeing the same problems using ReactNativeART on Android. (I am running react-native version 0.34, freshly generated app) I initially followed this tutorial (http://browniefed.com/blog/getting-react-art-running-on-react-native/), and got the example VectorWidget.js (from https://github.com/reactjs/react-art/blob/master/examples/vector-widget/VectorWidget.js) working fine on iOS.

On Android however VectorWidget crashes almost immediately. It seems that performing an animation or transform more than about twice per second will crash the app. If I don't perform any animations or transforms it will not crash.

This is the error I always see when the app crashes:

09-25 19:43:55.376 2857-3394/com.artproject A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x9e300098 in tid 3394 (mqt_js)

Occasionally I will see messages about stopping threads and garbage collection before the crash error:

09-25 19:46:46.761 3967-3977/com.artproject W/art: Suspending all threads took: 7.056ms
09-25 19:46:46.768 3967-3977/com.artproject I/art: Background sticky concurrent mark sweep GC freed 1840(73KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 6MB/6MB, paused 9.787ms total 20.292ms

When starting the app I always see lots of warnings, not sure if they are somehow related:

09-25 19:45:02.173 3967-3991/com.artproject D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true

                                                              [ 09-25 19:45:02.243  3967: 3967 D/         ]
                                                              HostConnection::get() New Host Connection established 0xaa496eb0, tid 3967


                                                              [ 09-25 19:45:02.309  3967: 3991 D/         ]
                                                              HostConnection::get() New Host Connection established 0xae827540, tid 3991
09-25 19:45:02.324 3967-3991/com.artproject I/OpenGLRenderer: Initialized EGL, version 1.4
09-25 19:45:02.939 3967-3991/com.artproject E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae8313f0
09-25 19:45:02.989 3967-3967/com.artproject I/art: Thread[1,tid=3967,Native,Thread*=0xb4074500,peer=0x746c7258,"main"] recursive attempt to load library "/data/app/com.artproject-1/lib/x86/libfb.so"
09-25 19:45:03.020 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTRenderableViewManager
09-25 19:45:03.021 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupShadowNode
09-25 19:45:03.037 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeShadowNode
09-25 19:45:03.038 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextShadowNode
09-25 19:45:03.038 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewManager
09-25 19:45:03.040 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewShadowNode
09-25 19:45:03.066 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDialogPickerManager
09-25 19:45:03.069 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode
09-25 19:45:03.070 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
09-25 19:45:03.086 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDropdownPickerManager
09-25 19:45:03.087 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
09-25 19:45:03.091 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.image.ReactImageManager
09-25 19:45:03.168 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager
09-25 19:45:03.168 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ModalHostShadowNode
09-25 19:45:03.169 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
09-25 19:45:03.171 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode
09-25 19:45:03.171 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager
09-25 19:45:03.172 3967-4000/com.artproject W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextShadowNode

I am happy to post my application code if that will help.

@eremzeit
Copy link
Contributor

+1

I found that we were way more likely to see this issue if we were making a ton of Surfaces (eg. 30+). Though, it's unclear if the high number of Surfaces is the cause or is just increasing the likelihood of any single Surface intermittently crashing.

And I found an anecdotal correlation between the crash happening and the js thread fps dropping below 10fps or so, but take that with a grain of salt.

@fab1an
Copy link

fab1an commented Oct 11, 2016

Do you use images / fresco?

Sent from my iPhone

On 11 Oct 2016, at 09:40, Alan Jones notifications@github.com wrote:

+1

I found that we were way more likely to see this issue if we were making a ton of Surfaces (eg. 30+). Though, it's unclear if the high number of Surfaces is the cause or is just increasing the likelihood of any single Surface intermittently crashing.

And I found an anecdotal correlation between the crash happening and the js thread fps dropping below 10fps or so, but take that with a grain of salt.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@hellogerard
Copy link

This comment in the react-native-svg repo solved this crash for me. To save you from clicking thru, I added:

shouldComponentUpdate() {
  return false;
}

to all my SVG components. Note this may not help you if you are animating your SVGs.

@Traviskn
Copy link

After following @fab1an 's comments through a couple of repositories, it seems that this is actually the result of a bug in the fresco library, which React Native uses under the hood to render and animate SVG's - facebook/fresco#1363 (comment)

@zoharlevin
Copy link

I'm experiencing a lot of crashes since upgrading from react native 0.34.0 to 0.35.0 when working with Svg components (using react-native-svg).
I'm getting the same error:
A/libc: Fatal signal 11 (SIGSEGV), code -6, fault addr 0x3c08 in tid 23384 (mqt_js)

I've tried doing
shouldComponentUpdate() { return false; } but I can't do that on all Components.

Also, if I try to narrow it down to a specific component (by removing the others) I can't reproduce the crash with specific components, and it seems like I need to have at least a few of them rendering for the app to crash (some minimum amount of components rendering otherwise it won't crash).

If I return to react native 0.34.0 it doesn't seem to happen, or at least I haven't been able to make it crash on 0.34.0 yet.

Anybody know of other solutions to this or at least how I can better debug it and get more detailed info from the crash?

@ptomasroos
Copy link
Contributor

We are experiencing the same problems.

On 25 Oct 2016, at 13:58, zoharlevin notifications@github.com wrote:

I'm experiencing a lot of crashes since upgrading from react native 0.34.0 to 0.35.0 when working with Svg components (using react-native-svg).
I'm getting the same error:
A/libc: Fatal signal 11 (SIGSEGV), code -6, fault addr 0x3c08 in tid 23384 (mqt_js)

I've tried doing
shouldComponentUpdate() {
return false;
} but I can't do that on all Components.

Also, if I try to narrow it down to a specific component (by removing the others) I can't reproduce the crash with specific components, and it seems like I need to have at least a few of them rendering for the app to crash (some minimum amount of components rendering otherwise it won't crash).

If I return to react native 0.34.0 it doesn't seem to happen, or at least I haven't been able to make it crash on 0.34.0 yet.

Anybody know of other solutions to this or at least how I can better debug it and get more detailed info from the crash?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@iggyfisk
Copy link

I put together a repo that reproduces the crash, just clone and npm install
https://github.com/happypancake/animatedcrash

When we run it with JS Dev Mode turned on in an Android emulator, or an older device (Galaxy Nexus) it crashes reliably after 3-20 clicks on the heart. With JS Dev Mode off, my fingers got tired before any crashes. Same on a modern flagship phone with JS Dev Mode on, seemingly no crashes.

@iggyfisk
Copy link

iggyfisk commented Nov 8, 2016

Still getting crashes in the test repo above with RN 0.37

@Naoto-Ida
Copy link

+1 RN 0.34.1

@avkvak
Copy link

avkvak commented Dec 5, 2016

+1 RN 0.38

@vinceyuan
Copy link
Contributor

vinceyuan commented Dec 16, 2016

Same problem here with RN 0.38.0 on Android 5. A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0xcbd400a4 in tid 15158 (mqt_js)
I can reproduce it with animatedcrash app made by @iggyfisk (thanks!) when JS Dev Mode is on. I can not reproduce it on my app and animatedcrash app when JS Dev Mode is off.
I don't use ART directly in my app. (Not sure the libraries use it.) Probably, it's Animated's problem.

@magicismight
Copy link
Contributor

I have fixed this in my react-native-svg library.
It's the parsed d data caused the crash, the d prop after serialized is quit large, and transport it through the JSBridge frequently will crash the app.
Just move the d parsing to the native side will fix this.
software-mansion/react-native-svg@4112d60#diff-5245fbc6ed7e8fbcf2c1239beb8059e0

@fab1an
Copy link

fab1an commented Jan 6, 2017

I threw away the react-native bridge WritableMap/WritableArray, replaced it with using only strings and saw much improved performance: #10504

@AlbertBrand
Copy link
Contributor

We might have found the cause for this crash, see PR #11804. Can you check whether the proposed fix solves this crash?

@FlaviooLima
Copy link

Having the same problem when i render a big amount of svg's.

React-Native v0.31
Samsung S5 mini, Android v5.1.1

I/art     (13459): Clamp target GC heap from 142MB to 128MB
I/art     (13459): Alloc partial concurrent mark sweep GC freed 8(256B) AllocSpace objects, 0(0B) LOS objects, 1% free, 126MB/128MB, paused 993us total 25.267ms
I/art     (13459): Clamp target GC heap from 142MB to 128MB
I/art     (13459): Alloc concurrent mark sweep GC freed 5(160B) AllocSpace objects, 0(0B) LOS objects, 1% free, 126MB/128MB, paused 1.106ms total 32.160ms
I/art     (13459): Forcing collection of SoftReferences for 1480KB allocation
I/art     (13459): Clamp target GC heap from 142MB to 128MB
I/art     (13459): Alloc concurrent mark sweep GC freed 4(128B) AllocSpace objects, 0(0B) LOS objects, 1% free, 126MB/128MB, paused 1.187ms total 31.849ms
E/art     (13459): Throwing OutOfMemoryError "Failed to allocate a 1516012 byte allocation with 1467240 free bytes and 1432KB until OOM"
E/AndroidRuntime(13459): FATAL EXCEPTION: mqt_native_modules
E/AndroidRuntime(13459): Process: com.MyApp, PID: 13459
E/AndroidRuntime(13459): java.lang.OutOfMemoryError: Failed to allocate a 1516012 byte allocation with 1467240 free bytes and 1432KB until OOM
E/AndroidRuntime(13459): at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
E/AndroidRuntime(13459): at android.graphics.Bitmap.nativeCreate(Native Method)
E/AndroidRuntime(13459): at android.graphics.Bitmap.createBitmap(Bitmap.java:942)
E/AndroidRuntime(13459): at android.graphics.Bitmap.createBitmap(Bitmap.java:913)
E/AndroidRuntime(13459): at android.graphics.Bitmap.createBitmap(Bitmap.java:880)
E/AndroidRuntime(13459): at com.horcrux.svg.RNSVGSvgViewShadowNode.drawOutput(RNSVGSvgViewShadowNode.java:45)
E/AndroidRuntime(13459): at com.horcrux.svg.RNSVGSvgViewShadowNode.onCollectExtraUpdates(RNSVGSvgViewShadowNode.java:41)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.ReactShadowNode.dispatchUpdates(ReactShadowNode.java:200)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.UIImplementation.applyUpdatesRecursive(UIImplementation.java:769)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.UIImplementation.applyUpdatesRecursive(UIImplementation.java:759)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.UIImplementation.applyUpdatesRecursive(UIImplementation.java:759)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.UIImplementation.applyUpdatesRecursive(UIImplementation.java:759)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.UIImplementation.applyUpdatesRecursive(UIImplementation.java:759)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.UIImplementation.applyUpdatesRecursive(UIImplementation.java:759)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.UIImplementation.applyUpdatesRecursive(UIImplementation.java:759)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.UIImplementation.applyUpdatesRecursive(UIImplementation.java:759)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.UIImplementation.applyUpdatesRecursive(UIImplementation.java:759)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.UIImplementation.applyUpdatesRecursive(UIImplementation.java:759)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.UIImplementation.applyUpdatesRecursive(UIImplementation.java:759)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.UIImplementation.applyUpdatesRecursive(UIImplementation.java:759)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.UIImplementation.updateViewHierarchy(UIImplementation.java:517)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.UIImplementation.dispatchViewUpdates(UIImplementation.java:505)
E/AndroidRuntime(13459): at com.facebook.react.uimanager.UIManagerModule.onBatchComplete(UIManagerModule.java:480)
E/AndroidRuntime(13459): at com.facebook.react.cxxbridge.NativeModuleRegistry.onBatchComplete(NativeModuleRegistry.java:99)
E/AndroidRuntime(13459): at com.facebook.react.cxxbridge.CatalystInstanceImpl$BridgeCallback.onBatchComplete(CatalystInstanceImpl.java:129)
E/AndroidRuntime(13459): at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
E/AndroidRuntime(13459): at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime(13459): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(13459): at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
E/AndroidRuntime(13459): at android.os.Looper.loop(Looper.java:145)
E/AndroidRuntime(13459): at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
E/AndroidRuntime(13459): at java.lang.Thread.run(Thread.java:818)
W/ActivityManager( 2351):   Force finishing activity 1 com.MyApp/.MainActivity
D/InputDispatcher( 2351): Focused application set to: xxxx
D/InputDispatcher( 2351): Focus left window: 13459
D/PointerIcon( 2351): setMouseIconStyle1 pointerType: 1001 iconType:101 flag:0 pid:2351 uid:1000
D/PointerIcon( 2351): setMouseCustomIcon IconType is same.101
D/PointerIcon( 2351): setHoveringSpenIconStyle1 pointerType: 10001 iconType:1 flag:0 pid:2351 uid:1000
D/PointerIcon( 2351): setHoveringSpenCustomIcon IconType is same.1

For me adding: android:largeHeap="true" in the application in the AndroidManifest resolve the issue.

    <application
      android:name=".MainApplication"
      android:allowBackup="true"
      android:label="MyLabel"
      android:icon="@mipmap/ic_launcher"
      android:largeHeap="true"
      android:theme="@style/AppTheme">

@mohammad-rahchamani
Copy link

I'm not rendering anything special but after adding ActivityIndicator to my login page, application stopped working.
@flaviotobi 's workaround solved my issue. 👍

@zijing07
Copy link

zijing07 commented May 29, 2017

I am still meeting with this problem on 0.44.2.

Today I upgrade the version of react-native from 0.41.2 to 0.44.2, along with the react module version to 16.0.0-alpha.6. The app runs well at first, but it suddenly starts crashing and can never get started.

I have tried set android:largeHeap="true", but it does not help. I am testing my app on emulator, I don't know whether platform is related or not. Here is my log:

05-29 17:45:52.584  7152  7182 F libc    : Fatal signal 11 (SIGSEGV), code 2, fault addr 0xa01af000 in tid 7182 (mqt_js)
05-29 17:45:52.688  1198  1198 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-29 17:45:52.688  1198  1198 F DEBUG   : Build fingerprint: 'Android/sdk_google_phone_x86/generic_x86:6.0/MASTER/2872745:userdebug/test-keys'
05-29 17:45:52.688  1198  1198 F DEBUG   : Revision: '0'
05-29 17:45:52.688  1198  1198 F DEBUG   : ABI: 'x86'
05-29 17:45:52.688  1198  1198 F DEBUG   : pid: 7152, tid: 7182, name: mqt_js  >>> com.mozidev.ouch <<<
05-29 17:45:52.688  1198  1198 F DEBUG   : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xa01af000
05-29 17:45:52.693  1198  1198 F DEBUG   :     eax a01af000  ebx a0ba0d9c  ecx 00000000  edx a001c000
05-29 17:45:52.693  1198  1198 F DEBUG   :     esi ae513d80  edi a001c000
05-29 17:45:52.693  1198  1198 F DEBUG   :     xcs 00000073  xds 0000007b  xes 0000007b  xfs 000000b7  xss 0000007b
05-29 17:45:52.693  1198  1198 F DEBUG   :     eip b72b5620  ebp a05f3b70  esp a05f3b2c  flags 00210246
05-29 17:45:52.694  1198  1198 W debuggerd: type=1400 audit(0.0:36): avc: denied { search } for name="com.mozidev.ouch" dev="vdc" ino=21561 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
05-29 17:45:52.695  1198  1198 F DEBUG   : 
05-29 17:45:52.695  1198  1198 F DEBUG   : backtrace:
05-29 17:45:52.696  1198  1198 F DEBUG   :     #00 pc 0001e620  /system/lib/libc.so (strlen+496)
05-29 17:45:52.696  1198  1198 F DEBUG   :     #01 pc 00050305  /data/app/com.mozidev.ouch-2/lib/x86/libjsc.so (JSStringCreateWithUTF8CString+53)
05-29 17:45:52.696  1198  1198 F DEBUG   :     #02 pc 0006ad12  /data/app/com.mozidev.ouch-2/lib/x86/libreactnativejnifb.so (facebook::react::jsStringFromBigString(OpaqueJSContext const*, facebook::react::JSBigString const&)+98)
05-29 17:45:52.696  1198  1198 F DEBUG   :     #03 pc 0005c65b  /data/app/com.mozidev.ouch-2/lib/x86/libreactnativejnifb.so (facebook::react::JSCExecutor::loadApplicationScript(std::unique_ptr<facebook::react::JSBigString const, std::default_delete<facebook::react::JSBigString const> >, std::string)+203)
05-29 17:45:52.696  1198  1198 F DEBUG   :     #04 pc 000669e8  /data/app/com.mozidev.ouch-2/lib/x86/libreactnativejnifb.so
05-29 17:45:52.696  1198  1198 F DEBUG   :     #05 pc 00069d00  /data/app/com.mozidev.ouch-2/lib/x86/libreactnativejnifb.so
05-29 17:45:52.696  1198  1198 F DEBUG   :     #06 pc 00027370  /data/app/com.mozidev.ouch-2/lib/x86/libreactnativejnifb.so (std::function<void ()>::operator()() const+32)
05-29 17:45:52.698  1198  1198 F DEBUG   :     #07 pc 00028a81  /data/app/com.mozidev.ouch-2/lib/x86/libreactnativejnifb.so
05-29 17:45:52.698  1198  1198 F DEBUG   :     #08 pc 00015207  /data/app/com.mozidev.ouch-2/lib/x86/libreactnativejnifb.so
05-29 17:45:52.698  1198  1198 F DEBUG   :     #09 pc 00810b94  /data/app/com.mozidev.ouch-2/oat/x86/base.odex (offset 0x5ce000) (void com.facebook.react.bridge.queue.NativeRunnable.run()+104)
05-29 17:45:52.698  1198  1198 F DEBUG   :     #10 pc 72895c3b  /data/dalvik-cache/x86/system@framework@boot.oat (offset 0x1eb2000)
05-29 17:45:52.778  1198  1198 F DEBUG   : 
05-29 17:45:52.778  1198  1198 F DEBUG   : Tombstone written to: /data/tombstones/tombstone_05
05-29 17:45:52.778  1198  1198 E DEBUG   : AM write failed: Broken pipe
0

However, the release app runs well. :(

@younatics
Copy link

+1

@aahz
Copy link

aahz commented Jul 31, 2017

+1, just got this on 0.47.0-rc.5

@pull-bot
Copy link

pull-bot commented Oct 9, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos hramos added the Icebox label Oct 9, 2017
@hramos hramos closed this as completed Oct 9, 2017
@luco
Copy link

luco commented Oct 23, 2017

Why is this closed while still happening?
I'm on 0.47.2. None of proposed fixes works.

@hramos
Copy link
Contributor

hramos commented Oct 27, 2017

^^ See my comment.

@luco
Copy link

luco commented Oct 27, 2017

@hramos Which one?

@hramos
Copy link
Contributor

hramos commented Oct 30, 2017

I mean, see the facebook-open-source-bot comment left when I closed the issue - it explains why the issue was closed.

@daxaxelrod
Copy link

Still getting this issue

@savelichalex
Copy link

savelichalex commented Mar 7, 2018

Also have this. Using this library. As I see, there is no Animated, just ART

@shibbyy
Copy link

shibbyy commented Apr 16, 2018

The issue still persists! Any help would be appreciated.

@luckyxhu
Copy link

luckyxhu commented May 5, 2018

still get this issue, I have try 3 diff android emulator, on Nexus 4 API 22, it is just work fine, on Nexus 5X API 23, it crash!!! on Nexus 6 API P, it is work fine too.

RN Version: 0.55.2

crash logs:

05-05 13:26:37.554 3331-3331/com.elecirc.MobiNG A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0xd5dc8000 in tid 3331 (.elecirc.MobiNG)
05-05 13:26:37.556 3331-3356/com.elecirc.MobiNG A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xbbadbeef in tid 3356 (mqt_js)
05-05 13:26:37.656 1324-1324/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-05 13:26:37.656 1324-1324/? A/DEBUG: Build fingerprint: 'Android/sdk_google_phone_x86_64/generic_x86_64:6.0/MASTER/4660549:userdebug/test-keys'
05-05 13:26:37.656 1324-1324/? A/DEBUG: Revision: '0'
05-05 13:26:37.656 1324-1324/? A/DEBUG: ABI: 'x86'
05-05 13:26:37.656 1324-1324/? A/DEBUG: pid: 3331, tid: 3331, name: .elecirc.MobiNG  >>> com.elecirc.MobiNG <<<
05-05 13:26:37.656 1324-1324/? A/DEBUG: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xd5dc8000
05-05 13:26:37.661 1324-1324/? A/DEBUG:     eax 000b4200  ebx ea1deeb4  ecx 00027080  edx f40be0bc
05-05 13:26:37.661 1324-1324/? A/DEBUG:     esi d4c81000  edi d5dc8000
05-05 13:26:37.661 1324-1324/? A/DEBUG:     xcs 00000023  xds 0000002b  xes 0000002b  xfs 00000007  xss 0000002b
05-05 13:26:37.661 1324-1324/? A/DEBUG:     eip ea1d8a38  ebp 003fffc4  esp ffec5204  flags 00210202
05-05 13:26:37.667 1324-1324/? A/DEBUG: backtrace:
05-05 13:26:37.667 1324-1324/? A/DEBUG:     #00 pc 00002a38  /system/lib/libOpenglSystemCommon.so (goldfish_dma_write(goldfish_dma_context*, void*, unsigned int)+56)
05-05 13:26:37.667 1324-1324/? A/DEBUG:     #01 pc 00003853  /system/lib/libOpenglSystemCommon.so (ExtendedRCEncoderContext::lockAndWriteDma(void*, unsigned int)+67)
05-05 13:26:37.667 1324-1324/? A/DEBUG:     #02 pc 00003062  /system/lib/lib_renderControl_enc.so
05-05 13:26:37.667 1324-1324/? A/DEBUG:     #03 pc 0000314e  /system/lib/hw/gralloc.ranchu.so
05-05 13:26:37.667 1324-1324/? A/DEBUG:     #04 pc 0000a351  /system/lib/libui.so (android::GraphicBufferMapper::unlockAsync(native_handle const*, int*)+113)
05-05 13:26:37.667 1324-1324/? A/DEBUG:     #05 pc 000086f1  /system/lib/libui.so (android::GraphicBuffer::unlockAsync(int*)+49)
05-05 13:26:37.667 1324-1324/? A/DEBUG:     #06 pc 0006bae6  /system/lib/libgui.so (android::Surface::unlockAndPost()+70)
05-05 13:26:37.667 1324-1324/? A/DEBUG:     #07 pc 000b6b00  /system/lib/libandroid_runtime.so
05-05 13:26:37.667 1324-1324/? A/DEBUG:     #08 pc 73827746  /data/dalvik-cache/x86/system@framework@boot.oat (offset 0x1eb2000)

@facebook facebook locked as resolved and limited conversation to collaborators Oct 9, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests