facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.58k stars 24.37k forks source link

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

Closed simonbuchan closed 6 years ago

simonbuchan commented 6 years ago

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

react-native-bot commented 6 years ago

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to ContributeWhat to Expect from Maintainers

salmanwaheed commented 6 years ago

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its recipients. This is a temporary error. The following address(es) deferred:

mkdirenv@gmail.com Domain salmanwaheed.info has exceeded the max emails per hour (150/150 (100%)) allowed. Message will be reattempted later

------- This is a copy of the message, including all the headers. ------ Received: from o1.sgmail.github.com ([192.254.114.176]:51484) by box1177.bluehost.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from bounces+848413-a7b0-hello=salmanwaheed.info@sgmail.github.com) id 1epQUi-003IeY-On for hello@salmanwaheed.info; Fri, 23 Feb 2018 20:27:29 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=github.com; h=from:reply-to:to:cc:in-reply-to:references:subject:mime-version:content-type:content-transfer-encoding:list-id:list-archive:list-post:list-unsubscribe; s=s20150108; bh=WuqC23O54K/zOq1lLG4JbyFqmcQ=; b=djpevy4PDmt2JGfu fGbRJfyPTNwFrW/8gCe7wLxZSF8V0uy6PXnXqad/UMVNM02qXr0RnDrhPeYB/rTc n+7vv6/RqaN5oV1LGtFW9Gg2u696cet6YZloSNb1521B+Hj5H6Rrs+kOeAo7oQzw VipgL3tLXetxUCQ5oYK80uEM/I0= Received: by filter0079p1iad2.sendgrid.net with SMTP id filter0079p1iad2-10950-5A90DB96-2 2018-02-24 03:27:18.022511821 +0000 UTC Received: from github-smtp2a-ext-cp1-prd.iad.github.net (github-smtp2a-ext-cp1-prd.iad.github.net [192.30.253.16]) by ismtpd0019p1iad2.sendgrid.net (SG) with ESMTP id 01XlRrQRQamfna_SN9HFXw for hello@salmanwaheed.info; Sat, 24 Feb 2018 03:27:18.022 +0000 (UTC) Date: Sat, 24 Feb 2018 03:27:18 +0000 (UTC) From: React Native Bot notifications@github.com Reply-To: facebook/react-native reply@reply.github.com To: facebook/react-native react-native@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Message-ID: facebook/react-native/issue/17812/issue_event/1490267354@github.com In-Reply-To: facebook/react-native/issues/17812@github.com References: facebook/react-native/issues/17812@github.com Subject: Re: [facebook/react-native] Stack overflow using react element for Picker.Item#value (#17812) Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_5a90da8cb0071_4a2b3fb14c786f3021288f"; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: list X-GitHub-Sender: react-native-bot X-GitHub-Recipient: salmanwaheed X-GitHub-Reason: subscribed List-ID: facebook/react-native List-Archive: https://github.com/facebook/react-native List-Post: mailto:reply@reply.github.com List-Unsubscribe: mailto:unsub+00ef1b38cf1190e50d1ed1bacef26b0ed3e0cb1fab06524b92cf0000000116a89c8c92a169ce117db58c@reply.github.com, https://github.com/notifications/unsubscribe/AO8bOCK9HbtyqHxCym5worgvfdfVUF5hks5tX4CMgaJpZM4R1Qyj X-Auto-Response-Suppress: All X-GitHub-Recipient-Address: hello@salmanwaheed.info X-SG-EID: 92ws1MVnlto3blxqXlf5goB0ee0kdDGWR6vcWx8d649kiolwKrfR6jIRP+bc5lC55pen+3ytGJdWpC fpNvpwsPaNXq11C5tqYqYhd9GHRW+Y9jBpxanu3vi4R8GHQK267y0gsyt2zODvNr1rBvonv1NDT8oL /qWW0tUQ6goTuT4zU1BJqygO6NS2/eQ8SrxmI4YHV8obFNlhbAVIExsHS70WIqDM/DJzqanRQwlRiL 4= X-Spam-Status: No, score=0.1 X-Spam-Score: 1 X-Spam-Bar: / X-Ham-Report: Spam detection software, running on the system "box1177.bluehost.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see root\@localhost for details.

Content preview: Closed #17812. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/facebook/react-native/issues/17812#event-1490267354 [...]

Content analysis details: (0.1 points, 5.0 required)

pts rule name description


0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: github.com] -0.5 SPF_PASS SPF: sender matches SPF record -0.8 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [192.254.114.176 listed in wl.mailspike.net] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 1.3 HTML_IMAGE_ONLY_24 BODY: HTML: images with 2000-2400 bytes of words 0.0 HTML_MESSAGE BODY: HTML included in message 2.5 DCC_CHECK No description available. -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.8 RCVD_IN_MSPIKE_WL Mailspike good senders -1.6 AWL AWL: Adjusted score from AWL reputation of From: address X-Spam-Flag: NO

----==_mimepart_5a90da8cb0071_4a2b3fb14c786f3021288f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit

Closed #17812.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/facebook/react-native/issues/17812#event-1490267354 ----==_mimepart_5a90da8cb0071_4a2b3fb14c786f3021288f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Closed #17812.


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

----==_mimepart_5a90da8cb0071_4a2b3fb14c786f3021288f--