{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/2630","labels_url":"https://api.github.com/repos/nodejs/node/issues/2630/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/2630/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/2630/events","html_url":"https://github.com/nodejs/node/issues/2630","id":104145489,"number":2630,"title":"Crashing during GC in 3.2.0","user":{"login":"justinmchase","id":10974,"avatar_url":"https://avatars.githubusercontent.com/u/10974?v=3","gravatar_id":"","url":"https://api.github.com/users/justinmchase","html_url":"https://github.com/justinmchase","followers_url":"https://api.github.com/users/justinmchase/followers","following_url":"https://api.github.com/users/justinmchase/following{/other_user}","gists_url":"https://api.github.com/users/justinmchase/gists{/gist_id}","starred_url":"https://api.github.com/users/justinmchase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinmchase/subscriptions","organizations_url":"https://api.github.com/users/justinmchase/orgs","repos_url":"https://api.github.com/users/justinmchase/repos","events_url":"https://api.github.com/users/justinmchase/events{/privacy}","received_events_url":"https://api.github.com/users/justinmchase/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/buffer","name":"buffer","color":"f7c6c7"},{"url":"https://api.github.com/repos/nodejs/node/labels/v8","name":"v8","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-31T22:19:58Z","updated_at":"2015-09-01T04:07:32Z","closed_at":null,"body":"I'm still investigating but I did a build of iojs so I can get a callstack and here is where it's crashing:\r\n```\r\n \tntdll.dll!00007ffadd65a24b()\tUnknown\r\n \tntdll.dll!00007ffadd65eaca()\tUnknown\r\n \tntdll.dll!00007ffadd602fca()\tUnknown\r\n \tntdll.dll!00007ffadd614b95()\tUnknown\r\n \tiojs.exe!free(void * pBlock) Line 51\tC\r\n>\tiojs.exe!v8::internal::Heap::FreeDeadArrayBuffersHelper(v8::internal::Isolate * isolate, std::map<void *,unsigned __int64,std::less<void *>,std::allocator<std::pair<void * const,unsigned __int64> > > & live_buffers, std::map<void *,unsigned __int64,std::less<void *>,std::allocator<std::pair<void * const,unsigned __int64> > > & not_yet_discovered_buffers) Line 1770\tC++\r\n \tiojs.exe!v8::internal::Heap::FreeDeadArrayBuffers(bool from_scavenge) Line 1844\tC++\r\n \tiojs.exe!v8::internal::Heap::Scavenge() Line 1651\tC++\r\n \tiojs.exe!v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector collector, const v8::GCCallbackFlags gc_callback_flags) Line 1196\tC++\r\n \tiojs.exe!v8::internal::Heap::CollectGarbage(v8::internal::GarbageCollector collector, const char * gc_reason, const char * collector_reason, const v8::GCCallbackFlags gc_callback_flags) Line 912\tC++\r\n \tiojs.exe!v8::internal::Factory::NewHeapNumber(double value, v8::internal::MutableMode mode, v8::internal::PretenureFlag pretenure) Line 1075\tC++\r\n \tiojs.exe!v8::internal::Runtime_AllocateHeapNumber(int args_length, v8::internal::Object * * args_object, v8::internal::Isolate * isolate) Line 1157\tC++\r\n \t0000025bcee062b8()\tUnknown\r\n \tiojs.exe!v8::internal::Runtime_AllocateHeapNumber(int args_length, v8::internal::Object * * args_object, v8::internal::Isolate * isolate) Line 1157\tC++\r\n \t000000504bb6e8f8()\tUnknown\r\n \t000000504bb6e8f0()\tUnknown\r\n \t000000316e0b9fd9()\tUnknown\r\n \t000000504be18db0()\tUnknown\r\n \tiojs.exe!v8::internal::JSFunction::ReplaceCode(v8::internal::Code * code) Line 6068\tC++\r\n```\r\n\r\nMy app has native components and is dealing with Buffer's. It was running fine before 3.0 so this may be a new bug. Its 100% reproducible if someone wants details on that. "},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/136576393","html_url":"https://github.com/nodejs/node/issues/2630#issuecomment-136576393","issue_url":"https://api.github.com/repos/nodejs/node/issues/2630","id":136576393,"user":{"login":"justinmchase","id":10974,"avatar_url":"https://avatars.githubusercontent.com/u/10974?v=3","gravatar_id":"","url":"https://api.github.com/users/justinmchase","html_url":"https://github.com/justinmchase","followers_url":"https://api.github.com/users/justinmchase/followers","following_url":"https://api.github.com/users/justinmchase/following{/other_user}","gists_url":"https://api.github.com/users/justinmchase/gists{/gist_id}","starred_url":"https://api.github.com/users/justinmchase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinmchase/subscriptions","organizations_url":"https://api.github.com/users/justinmchase/orgs","repos_url":"https://api.github.com/users/justinmchase/repos","events_url":"https://api.github.com/users/justinmchase/events{/privacy}","received_events_url":"https://api.github.com/users/justinmchase/received_events","type":"User","site_admin":false},"created_at":"2015-09-01T04:07:32Z","updated_at":"2015-09-01T04:07:32Z","body":"@trevnorris Thank you Trevor :)\r\n\r\nI looked into it for a while and frankly, I'm not sure where to begin. Unfortunately my code is a little complex but it is OSS so the good news is it should be pretty easy to reproduce. I've only tested on windows so far. \r\n\r\nThe short answer to the question about `node::Buffer::New()` is that, I'm not sure yet. I know that I\"m using `node::Buffer::New(char*, size_t)` but I'm not totally sure about the non-copying references yet. I know dependencies are using `node-ref` down the line, so its possible. \r\n\r\nTo reproduce:\r\n```\r\n$ git clone git@github.com:evolvelabs/electron-mumble.git\r\n$ cd electron-mumble\r\n$ npm install\r\n$ cd examples\r\n```\r\n\r\nOnce in the examples you can modify the `sin.js` sample to this, for it to work:\r\n```\r\n32|    connection.authenticate('mrbumpy', 'gameplantest'); \r\n```\r\nThen run via:\r\n```\r\n$ MUMBLE_URL=voice.evolvehq.com iojs.exe debug sin.js\r\n```\r\n\r\nThis is essentially streaming a buffer full of generated sin wav data to a mumble server, you won't be able to hear it without logging into the same server as another account but it doesn't really matter because the process crashes after the first call to writeSound, after sending the buffer the first time. I've been using the `debug` flag, then attaching Visual Studio to iojs.exe and that is how I got the callstack above. \r\n\r\nUnfortunately this is a somewhat complex app with dependencies on other projects with native modules. I have forked, upgraded to nan `~2.0.0` all of the dependencies, and they are built in a way that allows them to be compatible with node/iojs, as well as electron. The dependency hierarchy looks like this:\r\n\r\n* electron-mumble (fork of node-mumble)\r\n  * electron-jitterbuffer (node-jitterbuffer)\r\n  * electron-celt  (node-celt)\r\n  * electron-opus (node-opus)\r\n    * electron-ogg-packet (node-ogg-packet)\r\n      * electron-ref-struct (ref-struct)\r\n        * electron-ref (node-ref)\r\n          * electron-weak (node-weak)\r\n\r\nThe only addition to the forks were electron build support and binary prebuild deployment/hosting. Ref-struct and below all had extensive unit test suites which passed when i ran them. Above that have only integration tests, which also passed until electron-mumble examples were run. All used to run successuflly before node `~3.0.0`.\r\n\r\nI will continue to look at this also, trying to make a simpler reproduction of the issue. I haven't isolated where the allocation is that is causing the crash later. "}}