Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9557] Android: Stack overflow when having commonJS circular reference

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-07-16T17:41:19.000+0000
Affected Version/sRelease 2.0.2
Fix Version/sSprint 2012-15 Core, Release 3.0.0
ComponentsAndroid
LabelsSupportTeam, core, qe-testadded
ReporterEduardo Gomez
AssigneeNeeraj Gupta
Created2012-06-14T15:51:47.000+0000
Updated2014-02-26T16:57:15.000+0000

Description

Issue

After commonJS modules are circular reference an stack overflow happens. Once a module has been loaded, can it be cached in stack? Just like Titanium is currently doing with code. i.e.

Caching

When a JavaScript module is loaded, the object returned by require should be cached by Titanium and provided again to consumers without evaluating the module's JavaScript code multiple times.

Stack trace

06-14 16:10:30.137: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.137: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.137: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.137: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.137: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.137: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.147: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.157: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.157: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.167: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.167: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.177: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.177: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.177: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.177: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.177: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.197: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.197: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.207: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.207: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.217: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.217: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.217: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.227: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.227: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.237: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.237: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.237: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.237: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.237: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.247: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.257: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.267: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.267: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.267: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.267: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.267: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.267: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.267: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.287: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.287: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.297: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.297: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.297: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.307: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.307: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.317: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.317: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.327: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.327: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.327: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.327: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.327: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.347: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.347: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.357: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.357: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.357: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.357: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.357: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.357: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.357: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.377: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.377: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.377: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.377: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.377: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.377: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.377: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.407: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.407: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.407: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.407: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.407: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.407: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.407: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.427: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.427: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.437: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.437: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.437: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.437: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.437: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.437: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.437: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.457: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.457: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.457: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.457: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.457: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.457: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.457: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.467: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.467: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.477: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.477: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.477: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.477: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.477: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.497: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.497: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.507: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.507: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.517: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.517: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.517: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.517: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.517: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.527: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.527: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.537: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.537: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.537: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.537: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.537: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.547: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.547: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.557: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.557: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.557: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.557: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.557: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.567: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.567: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.577: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.577: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.587: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.597: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.597: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.597: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.597: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.607: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.617: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.617: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.617: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.617: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.617: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.617: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.627: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.627: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.637: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.637: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.637: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.637: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.637: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.647: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.647: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.657: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.657: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.667: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.667: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.667: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.667: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.667: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.677: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.677: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.687: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.687: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.687: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.687: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.687: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.707: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.707: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.707: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.717: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.717: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.717: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.717: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.727: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.727: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.737: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.737: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.747: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.747: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.747: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.747: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.747: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.757: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.757: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.767: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.767: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.767: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.767: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.767: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.777: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.777: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.777: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.787: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.787: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.787: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.787: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.807: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.807: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.817: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.817: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.817: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.817: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.817: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.827: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.827: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.837: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.837: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.837: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.837: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.837: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.837: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.847: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.847: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.847: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.857: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.857: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.857: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.857: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.857: D/Module(4079): Loading module: /ui/controls/ImageLoader -> Resources/ui/controls/ImageLoader.js
06-14 16:10:30.867: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.867: D/Module(4079): Loading module: /ui/css/CatalogView -> Resources/ui/css/CatalogView.js
06-14 16:10:30.877: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.877: D/Module(4079): Loading module: /ui/css/MessageBubbleChat -> Resources/ui/css/MessageBubbleChat.js
06-14 16:10:30.907: D/Module(4079): Loading module: /commonJS/Dal -> Resources/commonJS/Dal.js
06-14 16:10:30.937: D/Module(4079): Loading module: /ui/css/MessageBubbleChat -> Resources/ui/css/MessageBubbleChat.js
06-14 16:10:30.937: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.937: D/Module(4079): Loading module: /infrastructure/IMS -> Resources/infrastructure/IMS.js
06-14 16:10:30.947: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.957: D/Module(4079): Loading module: /commonJS/ContactsDb -> Resources/commonJS/ContactsDb.js
06-14 16:10:30.957: D/Module(4079): Loading module: /commonJS/Dal -> Resources/commonJS/Dal.js
06-14 16:10:30.957: D/Module(4079): Loading module: /infrastructure/Tools -> Resources/infrastructure/Tools.js
06-14 16:10:30.977: I/DEBUG(1267): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
06-14 16:10:30.977: I/DEBUG(1267): Build fingerprint: 'verizon/aloha/aloha/aloha:2.2.1/FRG83D/eng.lge.20101218.151114:user/release-keys'
06-14 16:10:30.977: I/DEBUG(1267): pid: 4079, tid: 4087  >>> com.povsw.ims <<<
06-14 16:10:30.977: I/DEBUG(1267): signal 11 (SIGSEGV), fault addr 00000003
06-14 16:10:30.977: I/DEBUG(1267):  r0 30007bc9  r1 4735d6ec  r2 4d77209a  r3 00000000
06-14 16:10:30.977: I/DEBUG(1267):  r4 00000001  r5 81273d0c  r6 4735d6ec  r7 4d772061
06-14 16:10:30.977: I/DEBUG(1267):  r8 54635ae1  r9 00000004  10 00279ea0  fp 4735d6f8
06-14 16:10:30.977: I/DEBUG(1267):  ip 4d7720b9  sp 4735d6f0  lr 326bdee4  pc 4d7720b8  cpsr 80000030
06-14 16:10:31.057: I/DEBUG(1267):          #00  pc 4d7720b8  
06-14 16:10:31.057: I/DEBUG(1267):          #01  lr 326bdee4  <unknown>
06-14 16:10:31.057: I/DEBUG(1267): code around pc:
06-14 16:10:31.057: I/DEBUG(1267): 4d772098 42f88061 4d7720a9 00000002 00000001 
06-14 16:10:31.057: I/DEBUG(1267): 4d7720a8 42f88121 00000008 cbcd7096 65757274 
06-14 16:10:31.057: I/DEBUG(1267): 4d7720b8 42f88061 4d7720c9 00000000 00000000 
06-14 16:10:31.057: I/DEBUG(1267): 4d7720c8 42f88121 0000000a f897bd0a 736c6166 
06-14 16:10:31.057: I/DEBUG(1267): 4d7720d8 00000065 42f88061 4d7720ed fffffffe 
06-14 16:10:31.057: I/DEBUG(1267): code around lr:
06-14 16:10:31.057: I/DEBUG(1267): 326bdec4 e59fc04c e12fff3c e52d0004 e59f0044 
06-14 16:10:31.057: I/DEBUG(1267): 326bded4 e52d0004 e59f2040 e59fc040 e12fff3c 
06-14 16:10:31.057: I/DEBUG(1267): 326bdee4 e51b8004 e59a000c eaffffee 0c00000d 
06-14 16:10:31.057: I/DEBUG(1267): 326bdef4 22704500 26f046a9 22701600 81273d0c 
06-14 16:10:31.057: I/DEBUG(1267): 326bdf04 4d5b6040 4d772029 4e6dd6dd 2270ac80 
06-14 16:10:31.057: I/DEBUG(1267): stack:
06-14 16:10:31.057: I/DEBUG(1267):     4735d6b0  813de544  /data/data/com.povsw.ims/lib/libkroll-v8.so
06-14 16:10:31.057: I/DEBUG(1267):     4735d6b4  4735d6ec  
06-14 16:10:31.057: I/DEBUG(1267):     4735d6b8  4d772061  
06-14 16:10:31.057: I/DEBUG(1267):     4735d6bc  54635ae1  
06-14 16:10:31.057: I/DEBUG(1267):     4735d6c0  00000004  
06-14 16:10:31.057: I/DEBUG(1267):     4735d6c4  00279ea0  [heap]
06-14 16:10:31.057: I/DEBUG(1267):     4735d6c8  00000001  
06-14 16:10:31.057: I/DEBUG(1267):     4735d6cc  81273d0c  /data/data/com.povsw.ims/lib/libkroll-v8.so
06-14 16:10:31.057: I/DEBUG(1267):     4735d6d0  4735d6ec  
06-14 16:10:31.057: I/DEBUG(1267):     4735d6d4  4d5b609c  
06-14 16:10:31.057: I/DEBUG(1267):     4735d6d8  4d5b609c  
06-14 16:10:31.057: I/DEBUG(1267):     4735d6dc  4d5b6021  
06-14 16:10:31.057: I/DEBUG(1267):     4735d6e0  4735d6dc  
06-14 16:10:31.057: I/DEBUG(1267):     4735d6e4  4735d6f8  
06-14 16:10:31.057: I/DEBUG(1267):     4735d6e8  df002777  
06-14 16:10:31.057: I/DEBUG(1267):     4735d6ec  e3a070ad  
06-14 16:10:31.057: I/DEBUG(1267): #00 4735d6f0  337a07b5  
06-14 16:10:31.057: I/DEBUG(1267):     4735d6f4  54635ae1  
06-14 16:10:31.057: I/DEBUG(1267):     4735d6f8  4735d738  
06-14 16:10:31.057: I/DEBUG(1267):     4735d6fc  326bd0f4  
06-14 16:10:31.057: I/DEBUG(1267):     4735d700  30007bc9  
06-14 16:10:31.057: I/DEBUG(1267):     4735d704  4d772061  
06-14 16:10:31.057: I/DEBUG(1267):     4735d708  30007bc9  
06-14 16:10:31.057: I/DEBUG(1267):     4735d70c  4d772061  
06-14 16:10:31.057: I/DEBUG(1267):     4735d710  4d772061  
06-14 16:10:31.057: I/DEBUG(1267):     4735d714  4d772061  
06-14 16:10:31.057: I/DEBUG(1267):     4735d718  4d772061  
06-14 16:10:31.057: I/DEBUG(1267):     4735d71c  5258c779  
06-14 16:10:31.057: I/DEBUG(1267):     4735d720  4d772061  
06-14 16:10:31.057: I/DEBUG(1267):     4735d724  4d772061  
06-14 16:10:31.057: I/DEBUG(1267):     4735d728  4d772061  
06-14 16:10:31.057: I/DEBUG(1267):     4735d72c  337a05e1  
06-14 16:10:31.057: I/DEBUG(1267):     4735d730  583395ed  
06-14 16:10:31.057: I/DEBUG(1267):     4735d734  300072ad  
06-14 16:10:31.637: I/BootReceiver(1350): Copying /data/tombstones/tombstone_04 to DropBox (SYSTEM_TOMBSTONE)
06-14 16:10:31.807: I/ActivityManager(1350): Process com.povsw.ims (pid 4079) has died.
06-14 16:10:31.807: I/WindowManager(1350): WIN DEATH: Window{44d1ed28 com.povsw.ims/org.appcelerator.titanium.TiActivity paused=false}
06-14 16:10:31.817: I/WindowManager(1350): WIN DEATH: Window{44d60de8 com.povsw.ims/com.povsw.ims.BuzzzterActivity paused=false}
06-14 16:10:31.817: I/WindowManager(1350): WIN DEATH: Window{44d3ef60 com.povsw.ims/org.appcelerator.titanium.TiActivity paused=false}
06-14 16:10:31.847: I/ActivityManager(1350): Start proc com.povsw.ims for activity com.povsw.ims/.BuzzzterActivity: pid=4192 uid=10065 gids={1015, 1006, 3003}
06-14 16:10:31.967: I/ActivityManager(1350): No longer want com.android.DunServer (pid 2809): hidden #11
06-14 16:10:31.987: I/UsageStats(1350): Unexpected resume of com.povsw.ims while already resumed in com.povsw.ims
06-14 16:10:31.987: W/ActivityManager(1350): Scheduling restart of crashed service com.android.DunServer/.DunService in 5000ms
06-14 16:10:32.177: I/TiApplication(4192): (main) [0,0] checkpoint, app created.
06-14 16:10:32.857: I/TiApplication(4192): (main) [681,681] Titanium 2.0.2 (2012/05/30 10:21 2ff31a3)
06-14 16:10:33.087: I/TiApplication(4192): (main) [227,908] Titanium Javascript runtime: v8

Associated Community thread

http://developer.appcelerator.com/question/137080/circular-reference

Doc

http://docs.appcelerator.com/titanium/2.0/index.html#!/guide/CommonJS_Modules_in_Titanium

Comments

  1. Ivan Skugor 2012-06-15

  2. Stephen Tramer 2012-07-16

    Relevant selection from the commonjs 1.1 spec: bq. If there is a dependency cycle, the foreign module may not have finished executing at the time it is required by one of its transitive dependencies; in this case, the object returned by "require" must contain at least the exports that the foreign module has prepared before the call to require that led to the current module's execution. Effectively, if we have an a->b->a dependency cycle, only those portions of module "a" which occur before the require('b') directive are guaranteed to be loaded during the require('a') in "b". This is a requirement of the specification and a reasonable engineering limitation. It is up to the module developer to ensure that they manage cyclic dependencies correctly.
  3. Stephen Tramer 2012-07-16

    TESTING

    ---- Create an app with the following resources: app.js
       var a = require('a');
       Ti.API.info("Finished require!");
       a.foo();
       a.bar();
       
    a.js
       exports.foo = function() {
       	Ti.API.info('foo');
       }
       
       var b = require('b');
       
       exports.bar = function() {
       	b.bar();
       }
       
    b.js
       var a = require('a');
       
       exports.bar = function() {
       	a.foo();
       }
       
    Output should include:
       I/TiAPI   ( 1284): Finished require!
       I/TiAPI   ( 1284): foo
       I/TiAPI   ( 1284): foo
       
  4. Bill Dawson 2012-07-16

    Pull request ready: https://github.com/appcelerator/titanium_mobile/pull/2578
  5. Satyam Sekhri 2012-08-31

    No stack overflow and desired result (as per the testing instructions). Verified On: Titanium Studio: 2.1.2.201208301612 Titanium SDK: 2.2.0.v20120830182512 Device: LG-P970 (v2.2) Android Runtime: v8, Rhino

JSON Source