{"action":"created","issue":{"url":"https://api.github.com/repos/royalpinto/node-cares/issues/3","repository_url":"https://api.github.com/repos/royalpinto/node-cares","labels_url":"https://api.github.com/repos/royalpinto/node-cares/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/royalpinto/node-cares/issues/3/comments","events_url":"https://api.github.com/repos/royalpinto/node-cares/issues/3/events","html_url":"https://github.com/royalpinto/node-cares/issues/3","id":163856907,"number":3,"title":"Segmentation Fault (4.2.6)","user":{"login":"dmitrif","id":655800,"avatar_url":"https://avatars.githubusercontent.com/u/655800?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitrif","html_url":"https://github.com/dmitrif","followers_url":"https://api.github.com/users/dmitrif/followers","following_url":"https://api.github.com/users/dmitrif/following{/other_user}","gists_url":"https://api.github.com/users/dmitrif/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitrif/subscriptions","organizations_url":"https://api.github.com/users/dmitrif/orgs","repos_url":"https://api.github.com/users/dmitrif/repos","events_url":"https://api.github.com/users/dmitrif/events{/privacy}","received_events_url":"https://api.github.com/users/dmitrif/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-05T13:56:42Z","updated_at":"2016-07-05T15:21:26Z","closed_at":null,"body":"Hi!\r\n\r\nWhen trying to do a SRV lookup (can post code if necessary), on 4.2.6, I occasionally get a Segmentation Fault with no further explanation resulting in the app crashing.\r\n\r\nTried updating node to 6.2.2, now getting the following during build:\r\n\r\n```\r\nfes_1 | ../deps/cares/src/ares_parse_txt_reply.c: In function 'ares_parse_txt_reply':\r\nfes_1 | ../deps/cares/src/ares_parse_txt_reply.c:153:23: error: 'struct ares_txt_reply' has no member named 'record_start'\r\nfes_1 |                txt_curr->record_start = strptr == aptr;\r\nfes_1 |                        ^\r\nfes_1 | make[1]: *** [Release/obj.target/cares/deps/cares/src/ares_parse_txt_reply.o] Error 1\r\nfes_1 | make[1]: Leaving directory `/var/frontend/node_modules/cares/build'\r\nfes_1 | gyp ERR! build error\r\nfes_1 | gyp ERR! stack Error: `make` failed with exit code: 2\r\nfes_1 | gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)\r\nfes_1 | gyp ERR! stack     at emitTwo (events.js:106:13)\r\nfes_1 | gyp ERR! stack     at ChildProcess.emit (events.js:191:7)\r\nfes_1 | gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)\r\nfes_1 | gyp ERR! System Linux 4.1.13-boot2docker\r\nfes_1 | gyp ERR! command \"/usr/local/bin/node\" \"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\" \"--release\"\r\nfes_1 | gyp ERR! cwd /var/frontend/node_modules/cares\r\nfes_1 | gyp ERR! node -v v6.2.2\r\nfes_1 | gyp ERR! node-gyp -v v3.3.1\r\nfes_1 | gyp ERR! not ok\r\nfes_1 |\r\nfes_1 | npm info lifecycle cares@1.1.3~install: Failed to exec install script```"},"comment":{"url":"https://api.github.com/repos/royalpinto/node-cares/issues/comments/230510593","html_url":"https://github.com/royalpinto/node-cares/issues/3#issuecomment-230510593","issue_url":"https://api.github.com/repos/royalpinto/node-cares/issues/3","id":230510593,"user":{"login":"dmitrif","id":655800,"avatar_url":"https://avatars.githubusercontent.com/u/655800?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitrif","html_url":"https://github.com/dmitrif","followers_url":"https://api.github.com/users/dmitrif/followers","following_url":"https://api.github.com/users/dmitrif/following{/other_user}","gists_url":"https://api.github.com/users/dmitrif/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitrif/subscriptions","organizations_url":"https://api.github.com/users/dmitrif/orgs","repos_url":"https://api.github.com/users/dmitrif/repos","events_url":"https://api.github.com/users/dmitrif/events{/privacy}","received_events_url":"https://api.github.com/users/dmitrif/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T15:21:26Z","updated_at":"2016-07-05T15:21:26Z","body":"Hi, @royalpinto \r\n\r\nThanks for the prompt response!\r\nBelow is the code snippet: \r\n\r\n```\r\nvar cares = require('cares');\r\n\r\nfunction discover(serviceName) {  \r\n  var resolver = new cares.Resolver({\r\n    servers: ['192.168.99.100'],\r\n    udp_port: 8600,\r\n    timeout: 1000\r\n  });\r\n\r\n  resolver.query(\r\n    '_'+ serviceName +'._http.service.consul', \r\n    {\r\n      'class': cares.NS_C_IN,\r\n      'type': cares.NS_T_SRV,\r\n    },\r\n    function (err, response) {\r\n      if (err) { \r\n        console.error(err);\r\n        return;\r\n      }\r\n\r\n      console.log(response);\r\n    }\r\n  );\r\n};\r\n\r\nfor (var i=0; i < 50; i++) {\r\n    discover('sample-service');\r\n}\r\n```\r\n\r\nRegardless of the first few responses (either ETIMEOUT or proper response), after a few responses `cares` fails with either:\r\n\r\n```[1]    2380 segmentation fault  node testDns.js```\r\n\r\nor a more specific error:\r\n\r\n```[1]    2530 bus error  node testDns.js```\r\n\r\nAlthough I have seen some other random errors related to `malloc`."}}
{"actor":{"display_login":"dmitrif"}}