{ "id": "171801", "key": "AC-5771", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2018-06-18T11:15:32.000+0000", "created": "2018-06-18T03:17:46.000+0000", "labels": [ "alloy", "hyperloop" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2018-06-18T11:15:33.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "15000", "name": "Hyperloop" } ], "description": "When using Hyperloop I am trying to get the NSThread callStackSymbols\r\nIt is supposed to return an NSArray, but I am getting an object with key as $native.\r\nI have tried casting, create a new NSArray from the data etc but I am completely unable to use the data.\r\n\r\nSteps to reproduce:\r\n\r\n1. Create new alloy hyperloop enabled project\r\n2. In alloy.js, put this:\r\n\r\n{code:java}\r\nvar NSThread = require('Foundation/NSThread');\r\nvar crashStackTrace = NSThread.callStackSymbols;\r\nTi.API.log(Object.prototype.toString.call(crashStackTrace));\r\nTi.API.log(Object.keys(crashStackTrace));\r\nTi.API.log(Object.values(crashStackTrace));\r\n{code}\r\n\r\nThis logs out as:\r\n\r\n{code}\r\n\r\n[INFO] [object Object]\r\n[INFO] (\r\n[INFO] \"$native\"\r\n[INFO] )\r\n[INFO] (\r\n[INFO] {\r\n[INFO] \"__wrapper__\" = \"(\\n\\t0 CoreFoundation 0x000000010af60ccc __invoking___ + 140\\n\\t1 CoreFoundation 0x000000010af60b84 -[NSInvocation invoke] + 308\\n\\t2 alloy-hyperloop 0x000000010a2a142e +[HyperloopUtils invokeSelector:args:target:instance:] + 1550\\n\\t3 alloy-hyperloop 0x000000010a296081 Dispatch + 1489\\n\\t4 JavaScriptCore 0x000000010f449b63 _ZN3JSC19APICallbackFunction4callINS_18JSCallbackFunctionEEExPNS_9ExecStateE + 595\\n\\t5 ??? 0x00000430d4197034 0x0 + 4607763378228\\n\\t6 JavaScriptCore 0x000000010f410d00 llint_entry + 29438\\n\\t7 JavaScriptCore 0x000000010f40981a vmEntryToJavaScript + 304\\n\\t8 JavaScriptCore 0x000000010f8ead43 _ZN3JSC7JITCode7executeEPNS_2VMEPNS_14ProtoCallFrameE + 147\\n\\t9 JavaScriptCore 0x000000010f8a777b _ZN3JSC11Interpreter11executeCallEPNS_9ExecStateEPNS_8JSObjectENS_8CallTypeERKNS_8CallDataENS_7JSValueERKNS_7ArgListE + 523\\n\\t10 JavaScriptCore 0x000000010faaf59e _ZN3JSC4callEPNS_9ExecStateENS_7JSValueENS_8CallTypeERKNS_8CallDataES2_RKNS_7ArgListE + 62\\n\\t11 JavaScriptCore 0x000000010fb12e55 _ZN3JSC10callGetterEPNS_9ExecStateENS_7JSValueES2_ + 149\\n\\t12 JavaScriptCore 0x000000010f973d9f llint_slow_path_get_by_id + 6223\\n\\t13 JavaScriptCore 0x000000010f40cb5f llint_entry + 12637\\n\\t14 JavaScriptCore 0x000000010f410d00 llint_entry + 29438\\n\\t15 JavaScriptCore 0x000000010f40981a vmEntryToJavaScript + 304\\n\\t16 JavaScriptCore 0x000000010f8ead43 _ZN3JSC7JITCode7executeEPNS_2VMEPNS_14ProtoCallFrameE + 147\\n\\t17 JavaScriptCore 0x000000010f8a777b _ZN3JSC11Interpreter11executeCallEPNS_9ExecStateEPNS_8JSObjectENS_8CallTypeERKNS_8CallDataENS_7JSValueERKNS_7ArgListE + 523\\n\\t18 JavaScriptCore 0x000000010faaf6d1 _ZN3JSC12profiledCallEPNS_9ExecStateENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 177\\n\\t19 JavaScriptCore 0x000000010f458040 JSObjectCallAsFunction + 496\\n\\t20 alloy-hyperloop 0x000000010a21c3c6 __TiBindingEventProcess_block_invoke + 86\\n\\t21 alloy-hyperloop 0x000000010a0d140d TiThreadPerformOnMainThread + 77\\n\\t22 alloy-hyperloop 0x000000010a21c26e TiBindingEventProcess + 1054\\n\\t23 alloy-hyperloop 0x000000010a21c558 -[TiBindingCallbackInvoke invoke:] + 56\\n\\t24 alloy-hyperloop 0x0000000109fcccaf -[KrollContext invoke:] + 159\\n\\t25 alloy-hyperloop 0x0000000109fccd8a __24-[KrollContext enqueue:]_block_invoke + 42\\n\\t26 alloy-hyperloop 0x000000010a0d140d TiThreadPerformOnMainThread + 77\\n\\t27 alloy-hyperloop 0x0000000109fccd57 -[KrollContext enqueue:] + 135\\n\\t28 alloy-hyperloop 0x000000010a21c5bf TiBindingRunLoopEnqueue + 95\\n\\t29 alloy-hyperloop 0x000000010a21ba8e TiBindingEventFire + 334\\n\\t30 alloy-hyperloop 0x000000010a092f30 -[TiProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 208\\n\\t31 alloy-hyperloop 0x0000000109ff4872 -[TiViewProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 418\\n\\t32 alloy-hyperloop 0x000000010a0857f3 -[TiUIButtonProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 259\\n\\t33 alloy-hyperloop 0x000000010a092b5b -[TiProxy fireEvent:withObject:] + 139\\n\\t34 alloy-hyperloop 0x000000010a087be1 -[TiUIButton controlAction:forEvent:] + 705\\n\\t35 UIKit 0x000000010c33e3e8 -[UIApplication sendAction:to:from:forEvent:] + 83\\n\\t36 UIKit 0x000000010c4b97a4 -[UIControl sendAction:to:forEvent:] + 67\\n\\t37 UIKit 0x000000010c4b9ac1 -[UIControl _sendActionsForEvents:withEvent:] + 450\\n\\t38 UIKit 0x000000010c4b8a09 -[UIControl touchesEnded:withEvent:] + 580\\n\\t39 UIKit 0x000000010c3b30bf -[UIWindow _sendTouchesForEvent:] + 2729\\n\\t40 UIKit 0x000000010c3b47c1 -[UIWindow sendEvent:] + 4086\\n\\t41 UIKit 0x000000010c358310 -[UIApplication sendEvent:] + 352\\n\\t42 UIKit 0x000000010cc996af __dispatchPreprocessedEventFromEventQueue + 2796\\n\\t43 UIKit 0x000000010cc9c2c4 __handleEventQueueInternal + 5949\\n\\t44 CoreFoundation 0x000000010af7fbb1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17\\n\\t45 CoreFoundation 0x000000010af644af __CFRunLoopDoSources0 + 271\\n\\t46 CoreFoundation 0x000000010af63a6f __CFRunLoopRun + 1263\\n\\t47 CoreFoundation 0x000000010af6330b CFRunLoopRunSpecific + 635\\n\\t48 GraphicsServices 0x0000000114fdba73 GSEventRunModal + 62\\n\\t49 UIKit 0x000000010c33d057 UIApplicationMain + 159\\n\\t50 alloy-hyperloop 0x0000000109fb2794 main + 100\\n\\t51 libdyld.dylib 0x00000001143ce955 start + 1\\n\\t52 ??? 0x0000000000000001 0x0 + 1\\n)\";\r\n[INFO] }\r\n[INFO] )\r\n\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Hyperloop iOS - NSThread callStackSymbols not returning array and data not usable", "creator": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Hyperloop 3.0.5\r\n\r\nOperating System\r\nName = Mac OS X\r\nVersion = 10.13.2\r\nArchitecture = 64bit\r\n\r\nCPUs = 8\r\nMemory = 17179869184\r\nNode.js\r\nNode.js Version = 8.1.2\r\nnpm Version = 3.10.10\r\nTitanium CLI\r\nCLI Version = 5.1.0\r\nTitanium SDK\r\nSDK Version = 7.1.1.GA\r\nSDK Path = /Users/user/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA\r\nTarget Platform = iphone", "comment": { "comments": [ { "id": "438464", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "It returns an {{NSArray}} instance that needs to be accessed via {{objectAtIndex}}. Working example:\r\n{code:js}\r\nvar NSThread = require('Foundation/NSThread');\r\nvar win = Ti.UI.createWindow({ backgroundColor: '#fff' });\r\n\r\nvar btn = Ti.UI.createButton({\r\n title: 'Test'\r\n});\r\n\r\nbtn.addEventListener('click', function () {\r\n try {\r\n btn.crash();\r\n } catch (e) {\r\n var crashStackTrace = NSThread.callStackSymbols;\r\n\r\n for (var i = 0; i < crashStackTrace.count; i++) {\r\n Ti.API.warn(crashStackTrace.objectAtIndex(i)); \r\n }\r\n }\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-06-18T11:15:33.000+0000", "updated": "2018-06-18T11:15:33.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }