{"action":"opened","issue":{"url":"https://api.github.com/repos/tjanczuk/edge/issues/253","labels_url":"https://api.github.com/repos/tjanczuk/edge/issues/253/labels{/name}","comments_url":"https://api.github.com/repos/tjanczuk/edge/issues/253/comments","events_url":"https://api.github.com/repos/tjanczuk/edge/issues/253/events","html_url":"https://github.com/tjanczuk/edge/issues/253","id":61745456,"number":253,"title":"StackOverFlowException thrown and process terminated","user":{"login":"leoyoo","id":3276369,"avatar_url":"https://avatars.githubusercontent.com/u/3276369?v=3","gravatar_id":"","url":"https://api.github.com/users/leoyoo","html_url":"https://github.com/leoyoo","followers_url":"https://api.github.com/users/leoyoo/followers","following_url":"https://api.github.com/users/leoyoo/following{/other_user}","gists_url":"https://api.github.com/users/leoyoo/gists{/gist_id}","starred_url":"https://api.github.com/users/leoyoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leoyoo/subscriptions","organizations_url":"https://api.github.com/users/leoyoo/orgs","repos_url":"https://api.github.com/users/leoyoo/repos","events_url":"https://api.github.com/users/leoyoo/events{/privacy}","received_events_url":"https://api.github.com/users/leoyoo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-15T04:23:31Z","updated_at":"2015-03-15T04:23:31Z","closed_at":null,"body":"I'm not sure this is the issue from Edgejs, I just hope anyone meet the same issue with this, and give some suggestions how to figure out the reason. anyway, 'process is terminated due to StackOverflowException' should be happened from .net runtime, right?  \r\n![image](https://cloud.githubusercontent.com/assets/3276369/6654669/ffea43f4-cb0d-11e4-8010-35a10c37717b.png)\r\n\r\nMy Nodejs codes are tcp server, whenever data received, it will call the .net code and the .net code is just responsible for storing data in sql server.\r\nNodejs code which define the edge function as below:\r\nmodule.exports.updateStation = edge.func({\r\n    assemblyFile: clrAssembly,\r\n    typeName: clrType,\r\n    methodName: 'UpdateStationAsync'\r\n});\r\n \r\nbelow is the .net code for the updateStation function: \r\npublic async Task<object> UpdateStationAsync(dynamic station)\r\n        {\r\n            string projid = (string)station.projid;\r\n            string stid = (string)station.stid;\r\n            using (var context = new FlyDataContext(ConnectString))\r\n            {\r\n                var st = await context.Stations.FirstOrDefaultAsync(\r\n                    s => s.ProjectID == projid && s.StationID == stid);\r\n                if (st != null)\r\n                {\r\n                    st.IpAddress = (string)station.ip;\r\n                    st.IpPort = (int)station.port;\r\n                    st.ServerPort = (int)station.serverport;\r\n                    st.LastCmd = (string)station.cmd;\r\n                    st.LastUpdated = DateTime.Now;\r\n                }\r\n                else\r\n                {\r\n                    st = new Station()\r\n                    {\r\n                        ProjectID = projid,\r\n                        StationID = stid,\r\n                        IpAddress = (string)station.ip,\r\n                        IpPort = (int)station.port,\r\n                        ServerPort = (int)station.serverport,\r\n                        Interval = 10,\r\n                        LastCmd = (string)station.cmd,\r\n                        LastUpdated = DateTime.Now\r\n                    };\r\n                    context.Stations.Add(st);\r\n                }\r\n\r\n                return await context.SaveChangesAsync();\r\n            }\r\n        }\r\n\r\nConnectString is read from config file of the Dll, like below:\r\n        private static string _connString = null;\r\n        protected static string ConnectString\r\n        {\r\n            get\r\n            {\r\n                if (string.IsNullOrEmpty(_connString))\r\n                {\r\n                    string codeBase = Assembly.GetExecutingAssembly().CodeBase;\r\n                    UriBuilder uri = new UriBuilder(codeBase);\r\n                    string path = Uri.UnescapeDataString(uri.Path);\r\n                    string configpath = Path.Combine(Path.GetDirectoryName(path), \"Fly.Data.dll.config\");\r\n                    XDocument doc = XDocument.Load(configpath);\r\n                    XElement root = doc.Root;\r\n                    _connString = (from e in root.Element(\"connectionStrings\").Elements(\"add\")\r\n                                   where e.Attribute(\"name\").Value == \"FlyDataContext\"\r\n                                   select e.Attribute(\"connectionString\").Value).FirstOrDefault();\r\n                }\r\n                return _connString;\r\n            }\r\n        }\r\n\r\nI just use Entity Framework to access sql server, not more complex codes there. I'm confused that I looked through my codes, didn't find any recursion calling. \r\n\r\nAnd the point is StachOverflowException happens after the program running for a while, not always occurred at the same place or same time, it 's so strange to me, looks like it is random, but exception always happen after a while, it is about no more than 1 minute. \r\n"}}