{ "id": "140825", "key": "TIMOB-18128", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2014-12-02T20:41:01.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "children", "core", "defect", "error", "reprod" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:55:38.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "App fail with error when call many time children.length.\r\n{code:title=index.xml|borderStyle=solid}\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n{code:title=index.js|borderStyle=solid}\r\nfunction doClick(e) {\r\n for(var i=0;i<200;i++) {\r\n var c = $.index.children[1];\r\n c.children.length;\r\n c.add(Ti.UI.createLabel({text: 'label '+i}));\r\n c=null;\r\n }\r\n}\r\n\r\n$.index.open();\r\n{code}\r\n\r\n{noformat}\r\n[WARN] : dalvikvm: JNI local reference table (0xb7efb8e0) dump:\r\n[ERROR] : dalvikvm: JNI ERROR (app bug): local reference table overflow (max=512)\r\n[WARN] : dalvikvm: Last 10 entries (of 512):\r\n[WARN] : dalvikvm: 511: 0xa6487320 ti.modules.titanium.ui.LabelProxy\r\n[WARN] : dalvikvm: 510: 0xa651a008 ti.modules.titanium.ui.LabelProxy\r\n[WARN] : dalvikvm: 509: 0xa64ac1a0 ti.modules.titanium.ui.LabelProxy\r\n[WARN] : dalvikvm: 508: 0xa64c3ae0 ti.modules.titanium.ui.LabelProxy\r\n[WARN] : dalvikvm: 507: 0xa6940728 ti.modules.titanium.ui.LabelProxy\r\n[WARN] : dalvikvm: 506: 0xa693a460 ti.modules.titanium.ui.LabelProxy\r\n[WARN] : dalvikvm: 505: 0xa651f9e0 ti.modules.titanium.ui.LabelProxy\r\n[WARN] : dalvikvm: 504: 0xa643be38 ti.modules.titanium.ui.LabelProxy\r\n[WARN] : dalvikvm: 503: 0xa6932a50 ti.modules.titanium.ui.LabelProxy\r\n[WARN] : dalvikvm: 502: 0xa651a490 ti.modules.titanium.ui.LabelProxy\r\n[WARN] : dalvikvm: Summary:\r\n[WARN] : dalvikvm: 1 of java.lang.String\r\n[WARN] : dalvikvm: 1 of org.appcelerator.kroll.runtime.v8.V8Object\r\n[WARN] : dalvikvm: 1 of org.appcelerator.kroll.KrollDict\r\n[WARN] : dalvikvm: 31 of ti.modules.titanium.ui.ViewProxy (1 unique instances)\r\n[WARN] : dalvikvm: 477 of ti.modules.titanium.ui.LabelProxy (30 unique instances)\r\n[WARN] : dalvikvm: 1 of org.appcelerator.titanium.proxy.TiViewProxy[] (30 elements)\r\n[INFO] : dalvikvm: \"KrollRuntimeThread\" prio=5 tid=10 RUNNABLE\r\n[INFO] : dalvikvm: | group=\"main\" sCount=0 dsCount=0 obj=0xa64ff6e8 self=0xb7e859a0\r\n[INFO] : dalvikvm: | sysTid=29757 nice=0 sched=0/0 cgrp=[fopen-error:2] handle=-1209371152\r\n[INFO] : dalvikvm: | state=R schedstat=( 3292880506 583750565 1678 ) utm=272 stm=56 core=0\r\n[INFO] : dalvikvm: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)\r\n[INFO] : dalvikvm: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)\r\n[INFO] : dalvikvm: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884)\r\n[INFO] : dalvikvm: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107)\r\n[INFO] : dalvikvm: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347)\r\n[INFO] : dalvikvm: at android.os.Handler.dispatchMessage(Handler.java:95)\r\n[INFO] : dalvikvm: at android.os.Looper.loop(Looper.java:137)\r\n[INFO] : dalvikvm: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)\r\n[INFO] : dalvikvm:\r\n[INFO] : libc: Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 29757 (KrollRuntimeThr)\r\n{noformat}\r\n", "attachment": [], "flagged": false, "summary": "Android: Repeated call children.length leads to generate exception \"local reference table overflow\"", "creator": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "subtasks": [], "reporter": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "environment": "Titanium SDK 3.3.0.GA/3.4.0.GA/3.4.1.GA, Alloy 1.6.0-dev, Googel Nexus 4 - 4.2.2 - API 17 (Genymotion)", "comment": { "comments": [ { "id": "334501", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Based on your error log, you can see there are 477 of ti.modules.titanium.ui.LabelProxy (30 unique instances), total is 512. So the root reason for local reference table overflow, is you called too many New Object(in your case: label), not the children.length.", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-12-03T08:35:31.000+0000", "updated": "2014-12-03T08:35:31.000+0000" }, { "id": "334504", "author": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "body": "Also:\r\nc.children[0]\r\n\r\n\r\nYou say 30 Labels is too many ?\r\ncomment children.length and error go away.\r\n\r\n\r\n\r\n", "updateAuthor": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "created": "2014-12-03T08:44:32.000+0000", "updated": "2014-12-03T08:48:59.000+0000" }, { "id": "334508", "author": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "body": "Test this code with 20 000 labels. Runs without error.\r\n{code:title=index.js|borderStyle=solid}\r\nfunction doClick(e) {\r\n for(var i=0;i<20000;i++) {\r\n $.myChildren.add(Ti.UI.createLabel({text: 'label '+i})); \r\n }\r\n}\r\n\r\n$.index.open();\r\n{code}\r\n\r\nPretty simple testcase which fail the app:\r\n{code:borderStyle=solid}\r\nfor(var i=0;i<20000;i++) {\r\n $.index.children[1]; \r\n }\r\n{code}", "updateAuthor": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "created": "2014-12-03T09:00:44.000+0000", "updated": "2014-12-03T09:26:55.000+0000" }, { "id": "334510", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "It seems calling .children[] will return a Object in local reference table, which is not released. \r\nDid you run the test in simulator or device? as I can't reproduce your problem on both simulator and device", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-12-03T09:30:12.000+0000", "updated": "2014-12-03T09:42:38.000+0000" }, { "id": "334511", "author": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "body": "{code}\r\nfor(var i=0;i<20000;i++) {\r\n $.index.children[1]; \r\n }\r\n{code}\r\n\r\nDevice Lenovo A630, Android 4.0.4 - *ok*\r\nGenymotion Emulator (Googel Nexus 4 - 4.2.2 - API 17) - *error*\r\nAndroid Emulator - 4.1.2 - *error*\r\nSimulator iPhone 4s - *ok*\r\n", "updateAuthor": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "created": "2014-12-03T09:43:45.000+0000", "updated": "2014-12-03T10:21:25.000+0000" }, { "id": "334518", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Ok. I can reproduce you problem in Emulator (Google Nexus 4 - 4.2.2 - API 17)。\r\n\r\nWill forward this ticket to our Mobil engineer team to investigate. Thank you for your report.", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-12-03T10:32:34.000+0000", "updated": "2014-12-03T10:32:34.000+0000" }, { "id": "334534", "author": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "body": "Same error with: Ti.Platform.displayCaps", "updateAuthor": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "created": "2014-12-03T13:37:54.000+0000", "updated": "2014-12-03T13:37:54.000+0000" }, { "id": "335039", "author": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "body": "Monkey patch: https://gist.github.com/falkolab/3657846b9a795d83c07d", "updateAuthor": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "created": "2014-12-05T14:33:36.000+0000", "updated": "2014-12-05T14:33:36.000+0000" }, { "id": "335109", "author": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "body": "OMG... , same error: \r\n{code}\r\nfor (var i = 0; i < 1000; i++) {\r\n $.myChildren.getParent();\r\n}\r\n{code}", "updateAuthor": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "created": "2014-12-05T20:12:39.000+0000", "updated": "2014-12-05T20:12:39.000+0000" }, { "id": "341146", "author": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "body": "What about Ti.Platform.displayCaps and $.myChildren.getParent() ?", "updateAuthor": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "created": "2015-01-29T12:21:13.000+0000", "updated": "2015-01-29T12:21:13.000+0000" }, { "id": "348412", "author": { "name": "arif", "key": "arif", "displayName": "Arjan", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "same issue here with SDK 3.5.1.GA", "updateAuthor": { "name": "arif", "key": "arif", "displayName": "Arjan", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-04-03T07:25:39.000+0000", "updated": "2015-04-03T07:25:39.000+0000" }, { "id": "424835", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I am able to reproduce this issue, the application crashes are repeatedly clicking the \"Click me\" lablel. This was reproduced with the following environment;\r\nPixel (7.1)\r\nStudio 4.9.0.201705302345\r\nTi SDK 6.1.1 GA\r\nAppc NPM 4.2.9\r\nAppc CLI 6.2.2\r\nTi CLI 5.0.14\r\nAlloy 1.9.11\r\nXcode 8.2 (8C38)\r\nNode v4.8.2\r\nJava 1.8.0_131", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-07-26T20:33:25.000+0000", "updated": "2017-07-26T20:33:25.000+0000" } ], "maxResults": 13, "total": 13, "startAt": 0 } } }