Issue 1:
var fs = require('fs');
var path = require('path');
for (var i = 0; i < 1000; i++){
fs.open(path.join(__dirname, "test.txt"), "a", function(err, fd) {
if (err) {
return;
}
fs.writeFile(fd, i + "\n");
});
}

When run code above, DOM tree gone, DevTool show dialog: "Detached from the target. Remote debugging has been terminated with reason: Render process gone. Please re-attach to the new target"

Issue 2:
To repro:

Upgrade Atom on Windows to 0.36.0 of Electron

Open a file

Renderer crash:

# ChildEBP RetAddr
00 0018dbf8 777f492e ntdll!NtTerminateProcess+0xc
01 0018dcd0 74ee7b42 ntdll!RtlExitUserProcess+0x9e
02 0018dce4 6d173fac KERNEL32!ExitProcessImplementation+0x12
03 0018dcf0 6d17427d MSVCR120!__crtExitProcess+0x15 [f:\dd\vctools\crt\crtw32\startup\crt0dat.c @ 774]
04 0018dd38 6d1bbbc7 MSVCR120!doexit+0x115 [f:\dd\vctools\crt\crtw32\startup\crt0dat.c @ 678]
05 0018dd4c 6d1e49ff MSVCR120!_exit+0xf [f:\dd\vctools\crt\crtw32\startup\crt0dat.c @ 433]
06 0018dd9c 5f3c4155 MSVCR120!raise+0xe3 [f:\dd\vctools\crt\crtw32\misc\winsig.c @ 526]
07 0018ddbc 5f3c41d5 node!node::Buffer::CallbackInfo::WeakCallback+0x1e [c:\users\paulb\code\atom\electron\vendor\node\src\node_buffer.cc @ 182]
08 0018ddcc 5f5880c0 node!node::Buffer::CallbackInfo::WeakCallback+0x13 [c:\users\paulb\code\atom\electron\vendor\node\src\node_buffer.cc @ 178]
09 0018ddfc 5f588240 node!v8::internal::GlobalHandles::Node::PostGarbageCollectionProcessing+0xb0 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\global-handles.cc @ 324]
0a 0018de18 5f587fe3 node!v8::internal::GlobalHandles::PostScavengeProcessing+0x40 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\global-handles.cc @ 767]
0b 0018de30 5f56ea9d node!v8::internal::GlobalHandles::PostGarbageCollectionProcessing+0x33 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\global-handles.cc @ 904]
0c 0018de74 5f565b0b node!v8::internal::Heap::PerformGarbageCollection+0x33d [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\heap\heap.cc @ 1297]
0d 0018dec8 5f6817bd node!v8::internal::Heap::CollectGarbage+0x19b [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\heap\heap.cc @ 973]
0e (Inline) -------- node!v8::internal::Heap::CollectGarbage+0x29 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\heap\heap-inl.h @ 528]
0f 0018def8 5f7328d1 node!v8::internal::Factory::NewFillerObject+0x8d [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\factory.cc @ 82]
10 (Inline) -------- node!v8::internal::__RT_impl_Runtime_AllocateInTargetSpace+0xbb [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\runtime\runtime-internal.cc @ 246]
11 0018df28 3310a244 node!v8::internal::Runtime_AllocateInTargetSpace+0xc1 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\runtime\runtime-internal.cc @ 236]
WARNING: Frame IP not in any known module. Following frames may be wrong.
12 0018df88 08b967b4 0x3310a244
13 0018dfd4 3b20d00f 0x8b967b4
14 0018e0b8 12682fa3 0x3b20d00f
15 0018e0dc 3312d401 0x12682fa3
16 0018e0f8 33129d1f 0x3312d401
17 0018e124 5f5fc9b0 0x33129d1f
18 0018e16c 5f5fc206 node!v8::internal::`anonymous namespace'::Invoke+0xf0 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\execution.cc @ 98]
19 0018e1b8 5f6a2b50 node!v8::internal::Execution::Call+0x206 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\execution.cc @ 168]
1a 0018e1e0 5f6a2a7a node!v8::internal::Object::GetPropertyWithDefinedGetter+0x70 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\objects.cc @ 940]
1b 0018e248 5f6a1e81 node!v8::internal::Object::GetPropertyWithAccessor+0x25a [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\objects.cc @ 848]
1c 0018e274 5f6251cc node!v8::internal::Object::GetProperty+0x161 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\objects.cc @ 648]
1d 0018e354 5f626a9e node!v8::internal::LoadIC::Load+0x32c [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\ic\ic.cc @ 749]
1e (Inline) -------- node!v8::internal::__RT_impl_Runtime_LoadIC_Miss+0xa4 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\ic\ic.cc @ 2379]
1f 0018e430 3310ce3c node!v8::internal::Runtime_LoadIC_Miss+0xae [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\ic\ic.cc @ 2361]
20 0018e44c 12682c0d 0x3310ce3c
21 0018e488 1267e4e3 0x12682c0d
22 0018e4ac 1267dd2d 0x1267e4e3
23 0018e4d4 1267da72 0x1267dd2d
24 0018e4f4 3310cd87 0x1267da72
25 0018e510 3f2a7376 0x3310cd87
26 0018e550 29b8a38a 0x3f2a7376
27 0018e57c 3310cd87 0x29b8a38a
28 0018e59c 1267d992 0x3310cd87
29 0018e5bc 1267d849 0x1267d992
2a 0018e5dc 1267cb6a 0x1267d849
2b 0018e620 1267c885 0x1267cb6a
2c 0018e64c 3312d401 0x1267c885
2d 0018e668 33129d1f 0x3312d401
2e 0018e694 5f5fc9b0 0x33129d1f
2f 0018e6dc 5f5fc206 node!v8::internal::`anonymous namespace'::Invoke+0xf0 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\execution.cc @ 98]
30 0018e728 5f6a2b50 node!v8::internal::Execution::Call+0x206 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\execution.cc @ 168]
31 0018e750 5f6a2a7a node!v8::internal::Object::GetPropertyWithDefinedGetter+0x70 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\objects.cc @ 940]
32 0018e7b8 5f6a1e81 node!v8::internal::Object::GetPropertyWithAccessor+0x25a [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\objects.cc @ 848]
33 0018e7e4 5f6251cc node!v8::internal::Object::GetProperty+0x161 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\objects.cc @ 648]
34 0018e8c4 5f626a9e node!v8::internal::LoadIC::Load+0x32c [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\ic\ic.cc @ 749]
35 (Inline) -------- node!v8::internal::__RT_impl_Runtime_LoadIC_Miss+0xa4 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\ic\ic.cc @ 2379]
36 0018e9a0 3310ce3c node!v8::internal::Runtime_LoadIC_Miss+0xae [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\ic\ic.cc @ 2361]
37 0018e9bc 1267c706 0x3310ce3c
38 0018e9dc 1267c20d 0x1267c706
39 0018ea28 3310cd87 0x1267c20d
3a 0018ea48 126c88fa 0x3310cd87
3b 0018ea64 126c8711 0x126c88fa
3c 0018ea80 29b29fc9 0x126c8711
3d 0018eaa0 3970b783 0x29b29fc9
3e 0018eac8 2c96bf85 0x3970b783
3f 0018eaf8 1294873d 0x2c96bf85
40 0018eb18 3970b5c7 0x1294873d
41 0018eb48 2c96bf85 0x3970b5c7
42 0018eb78 1294773d 0x2c96bf85
43 0018eb98 3970b399 0x1294773d
44 0018ebbc 3970ab52 0x3970b399
45 0018ebe4 3f284550 0x3970ab52
46 0018ec00 3f284114 0x3f284550
47 0018ec28 3f283dce 0x3f284114
48 0018ec50 3312d401 0x3f283dce
49 0018ec6c 33129d1f 0x3312d401
4a 0018ec98 5f5fc9b0 0x33129d1f
4b 0018ece0 5f5fc206 node!v8::internal::`anonymous namespace'::Invoke+0xf0 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\execution.cc @ 98]
4c 0018ed2c 5f5fd01b node!v8::internal::Execution::Call+0x206 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\execution.cc @ 168]
4d 0018ed74 5f55ddb6 node!v8::internal::Execution::TryCall+0x6b [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\execution.cc @ 205]
4e 0018eddc 5f71a72e node!v8::internal::Isolate::RunMicrotasks+0x186 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\isolate.cc @ 2658]
4f 0018ee10 5f609c0c node!v8::internal::FunctionCallbackArguments::Call+0x7e [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\arguments.cc @ 34]
50 0018ee94 5f60c8bd node!v8::internal::HandleApiCallHelper<0>+0x33c [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\builtins.cc @ 1577]
51 0018eeb8 3310ce3c node!v8::internal::Builtin_implHandleApiCall+0x2d [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\builtins.cc @ 1599]
52 0018eed8 08b70152 0x3310ce3c
53 0018ef04 3312d401 0x8b70152
54 0018ef20 33129d1f 0x3312d401
55 0018ef4c 5f5fc9b0 0x33129d1f
56 0018ef94 5f5fc206 node!v8::internal::`anonymous namespace'::Invoke+0xf0 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\execution.cc @ 98]
57 0018efe0 5f660533 node!v8::internal::Execution::Call+0x206 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\execution.cc @ 168]
58 0018f028 5f660404 node!v8::Function::Call+0x103 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\api.cc @ 4364]
59 0018f04c 5f3abc83 node!v8::Function::Call+0x34 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\v8\src\api.cc @ 4373]
5a 0018f0bc 5f3adebc node!node::AsyncWrap::MakeCallback+0x324 [c:\users\paulb\code\atom\electron\vendor\node\src\async-wrap.cc @ 263]
5b 0018f0e0 5f3cb6b9 node!node::AsyncWrap::MakeCallback+0x59 [c:\users\paulb\code\atom\electron\vendor\node\src\async-wrap-inl.h @ 98]
5c 0018f160 5f8e2d5f node!node::After+0x1d8 [c:\users\paulb\code\atom\electron\vendor\node\src\node_file.cc @ 248]
5d 0018f16c 5f8e4452 node!uv__fs_done+0x2e [c:\users\paulb\code\atom\electron\vendor\node\deps\uv\src\win\fs.c @ 1765]
5e 0018f184 5f8d8544 node!uv__work_done+0x75 [c:\users\paulb\code\atom\electron\vendor\node\deps\uv\src\threadpool.c @ 241]
5f 0018f190 5f8d71b3 node!uv_process_async_wakeup_req+0x33 [c:\users\paulb\code\atom\electron\vendor\node\deps\uv\src\win\async.c @ 97]
60 0018f1b0 5f8d7285 node!uv_process_reqs+0x160 [c:\users\paulb\code\atom\electron\vendor\node\deps\uv\src\win\req-inl.h @ 198]
61 0018f1d4 003ddf40 node!uv_run+0x52 [c:\users\paulb\code\atom\electron\vendor\node\deps\uv\src\win\core.c @ 356]
62 0018f218 003ddd0f atom!atom::NodeBindings::UvRunOnce+0x94 [c:\users\paulb\code\atom\electron\atom\common\node_bindings.cc @ 234]
63 0018f228 003ddd6c atom!base::internal::InvokeHelper<1,void,base::internal::RunnableAdapter<void (__thiscall atom::NodeBindings::*)(void)>,base::internal::TypeList<base::WeakPtr<atom::NodeBindings> const &> >::MakeItSo+0x33 [c:\users\paulb\code\atom\electron\vendor\brightray\vendor\download\libchromiumcontent\src\base\bind_internal.h @ 303]
64 0018f238 00533a75 atom!base::internal::Invoker<base::IndexSequence<0>,base::internal::BindState<base::internal::RunnableAdapter<void (__thiscall atom::NodeBindings::*)(void)>,void __cdecl(atom::NodeBindings *),base::internal::TypeList<base::WeakPtr<atom::NodeBindings> > >,base::internal::TypeList<base::internal::UnwrapTraits<base::WeakPtr<atom::NodeBindings> > >,base::internal::InvokeHelper<1,void,base::internal::RunnableAdapter<void (__thiscall atom::NodeBindings::*)(void)>,base::internal::TypeList<base::WeakPtr<atom::NodeBindings> const &> >,void __cdecl(void)>::Run+0x12 [c:\users\paulb\code\atom\electron\vendor\brightray\vendor\download\libchromiumcontent\src\base\bind_internal.h @ 346]
65 (Inline) -------- atom!base::Callback<void __cdecl(void)>::Run+0x8 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\base\callback.h @ 396]
66 0018f294 0180c8d5 atom!base::debug::TaskAnnotator::RunTask+0xf5 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\base\debug\task_annotator.cc @ 51]
67 0018f370 0180c0fd atom!scheduler::TaskQueueManager::ProcessTaskFromWorkQueue+0x2e5 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\components\scheduler\base\task_queue_manager.cc @ 369]
68 0018f488 0180cb1f atom!scheduler::TaskQueueManager::DoWork+0x7d [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\components\scheduler\base\task_queue_manager.cc @ 293]
69 (Inline) -------- atom!base::internal::RunnableAdapter<void (__thiscall scheduler::TaskQueueManager::*)(bool)>::Run+0x9 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\base\bind_internal.h @ 176]
6a (Inline) -------- atom!base::internal::InvokeHelper<1,void,base::internal::RunnableAdapter<void (__thiscall scheduler::TaskQueueManager::*)(bool)>,base::internal::TypeList<base::WeakPtr<scheduler::TaskQueueManager> const &,bool const &> >::MakeItSo+0x25 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\base\bind_internal.h @ 303]
6b 0018f4a0 00533a75 atom!base::internal::Invoker<base::IndexSequence<0,1>,base::internal::BindState<base::internal::RunnableAdapter<void (__thiscall scheduler::TaskQueueManager::*)(bool)>,void __cdecl(scheduler::TaskQueueManager *,bool),base::internal::TypeList<base::WeakPtr<scheduler::TaskQueueManager>,bool> >,base::internal::TypeList<base::internal::UnwrapTraits<base::WeakPtr<scheduler::TaskQueueManager> >,base::internal::UnwrapTraits<bool> >,base::internal::InvokeHelper<1,void,base::internal::RunnableAdapter<void (__thiscall scheduler::TaskQueueManager::*)(bool)>,base::internal::TypeList<base::WeakPtr<scheduler::TaskQueueManager> const &,bool const &> >,void __cdecl(void)>::Run+0x3f [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\base\bind_internal.h @ 346]
6c (Inline) -------- atom!base::Callback<void __cdecl(void)>::Run+0x8 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\base\callback.h @ 396]
6d 0018f4fc 004fd87c atom!base::debug::TaskAnnotator::RunTask+0xf5 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\base\debug\task_annotator.cc @ 51]
6e 0018f640 004fcf59 atom!base::MessageLoop::RunTask+0x1dc [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\base\message_loop\message_loop.cc @ 480]
6f (Inline) -------- atom!std::deque<base::PendingTask,std::allocator<base::PendingTask> >::empty+0x3 [c:\program files (x86)\microsoft visual studio 12.0\vc\include\deque @ 1362]
70 (Inline) -------- atom!std::queue<base::PendingTask,std::deque<base::PendingTask,std::allocator<base::PendingTask> > >::empty+0x3 [c:\program files (x86)\microsoft visual studio 12.0\vc\include\queue @ 122]
71 0018f6c4 00535cb7 atom!base::MessageLoop::DoWork+0x199 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\base\message_loop\message_loop.cc @ 605]
72 0018f6e8 004fd670 atom!base::MessagePumpDefault::Run+0xb7 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\base\message_loop\message_pump_default.cc @ 33]
73 0018f6f4 00539ab8 atom!base::MessageLoop::RunHandler+0x10 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\base\message_loop\message_loop.cc @ 438]
74 0018f718 004fd62d atom!base::RunLoop::Run+0x58 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\base\run_loop.cc @ 56]
75 0018f740 00b5a53b atom!base::internal::Invoker<base::IndexSequence<0>,base::internal::BindState<base::internal::RunnableAdapter<void (__cdecl*)(void const *)>,void __cdecl(void const *),base::internal::TypeList<void const *> >,base::internal::TypeList<base::internal::UnwrapTraits<void const *> >,base::internal::InvokeHelper<0,void,base::internal::RunnableAdapter<void (__cdecl*)(void const *)>,base::internal::TypeList<void const * const &> >,void __cdecl(void)>::Run+0x1d
76 0018f854 0060d85e atom!content::RendererMain+0x3bb [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\content\renderer\renderer_main.cc @ 209]
77 0018f874 0060d70d atom!content::RunNamedProcessTypeMain+0x11e [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\content\app\content_main_runner.cc @ 378]
78 0018f8c0 0060ab93 atom!content::ContentMainRunnerImpl::Run+0x7d [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\content\app\content_main_runner.cc @ 798]
79 0018f8d0 003b9fbd atom!content::ContentMain+0x23 [y:\jenkins\workspace\libchromiumcontent-win\vendor\chromium\src\content\app\content_main.cc @ 19]
7a 0018f974 0244fbcc atom!wWinMain+0x1bf [c:\users\paulb\code\atom\electron\atom\app\atom_main.cc @ 167]
7b 0018f9c0 74ed38f4 atom!__tmainCRTStartup+0x12f [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c @ 618]
7c 0018f9d4 778056c3 KERNEL32!BaseThreadInitThunk+0x24
7d 0018fa1c 7780568e ntdll!__RtlUserThreadStart+0x2f
7e 0018fa2c 00000000 ntdll!_RtlUserThreadStart+0x1b

This check is failing:

void CallbackInfo::WeakCallback(Isolate* isolate, Local<Object> object) {
CHECK(object->IsArrayBuffer()); /******** Kerplowie *********/
Local<ArrayBuffer> buf = object.As<ArrayBuffer>();
ArrayBuffer::Contents obj_c = buf->GetContents();
char* const obj_data = static_cast<char*>(obj_c.Data());
if (buf->ByteLength() != 0)
CHECK_NE(obj_data, nullptr);

if (buf->IsExternal())
buf->Neuter();
callback_(obj_data, hint_);
int64_t change_in_bytes = -static_cast<int64_t>(sizeof(*this));
isolate->AdjustAmountOfExternalAllocatedMemory(change_in_bytes);

delete this;
}