Skip to content

Stack overflow using react element for Picker.Item#value #17812

Description

@simonbuchan

Is this a bug report?

Yes.

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: Windows 10
Node: 6.12.3
Yarn: 1.3.2
npm: 3.10.10
Watchman: Not Found
Xcode: N/A
Android Studio: Not Found

Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.52.0 => 0.52.0

Steps to Reproduce

Basic react-native init, edit index.js:

import React from 'react';
import { View, Picker, Text, AppRegistry } from 'react-native';

const App = () => (
  <View>
    <Picker>
      <Picker.Item label="foo" value={<Text>Boom</Text>} />
    </Picker>
  </View>
);

AppRegistry.registerComponent('TestApp', () => App);

Expected Behavior

I would like to get the element to render from Picker#onValueChange.

Actual Behavior

When testing in android emulator, crashes on startup (i.e. closes and shows "ProjectName has stopped" dialog)

Android log monitor, filtering to react, shows:

02-01 03:47:55.851 9871-9905/com.reactnativesvgtesttypes I/ReactNativeJS: Running application "ReactNativeSVGTestTypes" with appParams: {"rootTag":1}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
02-01 03:47:56.022 9871-9905/com.reactnativesvgtesttypes E/ReactNativeJS: RangeError: Maximum call stack size exceeded.
                                                                          
                                                                          This error is located at:
                                                                              in AndroidDialogPicker (at PickerAndroid.android.js:107)
                                                                              in PickerAndroid (at Picker.js:160)
                                                                              in Picker (at index.js:6)
                                                                              in RCTView (at View.js:71)
                                                                              in View (at index.js:5)
                                                                              in App (at renderApplication.js:35)
                                                                              in RCTView (at View.js:71)
                                                                              in View (at AppContainer.js:102)
                                                                              in RCTView (at View.js:71)
                                                                              in View (at AppContainer.js:122)
                                                                              in AppContainer (at renderApplication.js:34)
02-01 03:47:56.208 9871-9905/com.reactnativesvgtesttypes A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xbbadbeef in tid 9905 (mqt_js), pid 9871 (ivesvgtesttypes)
02-01 03:47:56.253 9916-9916/? A/DEBUG: pid: 9871, tid: 9905, name: mqt_js  >>> com.reactnativesvgtesttypes <<<
02-01 03:47:56.262 9916-9916/? A/DEBUG:     #00 pc 003b1421  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so (WTFCrash+33)
02-01 03:47:56.262 9916-9916/? A/DEBUG:     #01 pc 002544d4  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.262 9916-9916/? A/DEBUG:     #02 pc 002f8399  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so (JSC::PropertySlot::functionGetter(JSC::ExecState*) const+73)
02-01 03:47:56.262 9916-9916/? A/DEBUG:     #03 pc 0013b1d8  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.262 9916-9916/? A/DEBUG:     #04 pc 0013b6d9  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.263 9916-9916/? A/DEBUG:     #06 pc 0017ef4a  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.263 9916-9916/? A/DEBUG:     #07 pc 0017ef4a  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.263 9916-9916/? A/DEBUG:     #08 pc 0017ef4a  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.263 9916-9916/? A/DEBUG:     #09 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.263 9916-9916/? A/DEBUG:     #10 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.263 9916-9916/? A/DEBUG:     #11 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.263 9916-9916/? A/DEBUG:     #12 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.263 9916-9916/? A/DEBUG:     #13 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.263 9916-9916/? A/DEBUG:     #14 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.263 9916-9916/? A/DEBUG:     #15 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.263 9916-9916/? A/DEBUG:     #16 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.263 9916-9916/? A/DEBUG:     #17 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.264 9916-9916/? A/DEBUG:     #18 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.264 9916-9916/? A/DEBUG:     #19 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.264 9916-9916/? A/DEBUG:     #20 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.264 9916-9916/? A/DEBUG:     #21 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.264 9916-9916/? A/DEBUG:     #22 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.264 9916-9916/? A/DEBUG:     #23 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.264 9916-9916/? A/DEBUG:     #25 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.264 9916-9916/? A/DEBUG:     #26 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.264 9916-9916/? A/DEBUG:     #27 pc 0017f0fc  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.264 9916-9916/? A/DEBUG:     #28 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.264 9916-9916/? A/DEBUG:     #29 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.264 9916-9916/? A/DEBUG:     #30 pc 0017ef97  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.264 9916-9916/? A/DEBUG:     #31 pc 0017ac7d  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.265 9916-9916/? A/DEBUG:     #32 pc 00126763  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.267 9916-9916/? A/DEBUG:     #33 pc 001039f8  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.267 9916-9916/? A/DEBUG:     #34 pc 00225591  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so (JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)+113)
02-01 03:47:56.267 9916-9916/? A/DEBUG:     #35 pc 00265bfc  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.268 9916-9916/? A/DEBUG:     #36 pc 0017adac  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.268 9916-9916/? A/DEBUG:     #37 pc 00103b62  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so
02-01 03:47:56.269 9916-9916/? A/DEBUG:     #38 pc 00225591  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so (JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)+113)
02-01 03:47:56.269 9916-9916/? A/DEBUG:     #39 pc 0004be3a  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libjsc.so (JSObjectCallAsFunction+474)
02-01 03:47:56.269 9916-9916/? A/DEBUG:     #40 pc 0006ecba  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libreactnativejni.so (facebook::react::Object::callAsFunction(OpaqueJSValue*, int, OpaqueJSValue const* const*) const+74)
02-01 03:47:56.269 9916-9916/? A/DEBUG:     #41 pc 0006ed7b  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libreactnativejni.so (facebook::react::Object::callAsFunction(std::initializer_list<OpaqueJSValue const*>) const+59)
02-01 03:47:56.269 9916-9916/? A/DEBUG:     #42 pc 00061e84  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libreactnativejni.so (facebook::react::JSCExecutor::callFunction(std::string const&, std::string const&, folly::dynamic const&)+228)
02-01 03:47:56.269 9916-9916/? A/DEBUG:     #43 pc 000674f8  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libreactnativejni.so
02-01 03:47:56.269 9916-9916/? A/DEBUG:     #44 pc 000677c0  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libreactnativejni.so
02-01 03:47:56.269 9916-9916/? A/DEBUG:     #45 pc 00016720  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libreactnativejni.so (std::function<void ()>::operator()() const+32)
02-01 03:47:56.269 9916-9916/? A/DEBUG:     #46 pc 00029d61  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libreactnativejni.so
02-01 03:47:56.269 9916-9916/? A/DEBUG:     #47 pc 00016720  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libreactnativejni.so (std::function<void ()>::operator()() const+32)
02-01 03:47:56.269 9916-9916/? A/DEBUG:     #48 pc 0001aad6  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/lib/x86/libreactnativejni.so
02-01 03:47:56.269 9916-9916/? A/DEBUG:     #49 pc 00013998  /data/app/com.reactnativesvgtesttypes-kpzZWiUhCgU8VpTYQBkAUg==/oat/x86/base.odex (offset 0x12000)

Snack behavior is a little different, it complains about missing a render() method, but converted to using a component class, the error shows:

Device: (21:2525) Error: C++ exception in 'nativeFlushQueueImmediate'

Exception creating JSON string: JSON.stringify cannot serialize cyclic structures. (<unknown file>:21)

This error is located at:
    in AndroidDialogPicker
    in t
    in t
    in RCTView
    in Unknown
    in WrappedComponent
    in t
    in r
    in RCTView
    in RCTView
    in t

Reproducible Demo

See index.js above, or: https://snack.expo.io/BJ7CILeUM

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions