This repository was archived by the owner on Dec 2, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 2, 2026. It is now read-only.
GitTreeEntry: pointer being freed was not allocated #1257
Copy link
Copy link
Open
Description
Happens during garbage collection, our codebase is complex and I'm having trouble narrowing this down to a specific cause - let me know how I can help by providing more info.
NodeGit 0.17 / 0.18 running in Electron 1.4
Application Specific Information:
abort() called
*** error for object 0x7ff7dd4365f0: pointer being freed was not allocated
Thread 0 Crashed:: CrRendererMain Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fffb4989dd6 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fffb4a75787 pthread_kill + 90
2 libsystem_c.dylib 0x00007fffb48ef4bb __abort + 140
3 libsystem_c.dylib 0x00007fffb48ef42f abort + 144
4 libsystem_malloc.dylib 0x00007fffb49df03f free + 530
5 nodegit.node 0x0000000112547721 NodeGitWrapper<GitTreeEntryTraits>::~NodeGitWrapper() + 39 (nodegit_wrapper.cc:42)
6 nodegit.node 0x0000000112547790 GitTreeEntry::~GitTreeEntry() + 14 (tree_entry.cc:28)
7 libnode.dylib 0x000000010a0c023d v8::internal::GlobalHandles::DispatchPendingPhantomCallbacks(bool) + 157
8 libnode.dylib 0x000000010a0c058e v8::internal::GlobalHandles::PostGarbageCollectionProcessing(v8::internal::GarbageCollector, v8::GCCallbackFlags) + 46
9 libnode.dylib 0x000000010a0cfa58 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) + 1768
10 libnode.dylib 0x000000010a0ceea4 v8::internal::Heap::CollectGarbage(v8::internal::GarbageCollector, char const*, char const*, v8::GCCallbackFlags) + 676
11 libnode.dylib 0x000000010a097211 v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) + 177
12 libnode.dylib 0x000000010a3ca9d8 v8::internal::IncrementalStringBuilder::Extend() + 120
13 libnode.dylib 0x000000010a1975a8 v8::internal::JsonStringifier::SerializeString(v8::internal::Handle<v8::internal::String>) + 1144
14 libnode.dylib 0x000000010a19a4e1 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) + 705
15 libnode.dylib 0x000000010a198390 v8::internal::JsonStringifier::SerializeJSReceiverSlow(v8::internal::Handle<v8::internal::JSReceiver>) + 416
16 libnode.dylib 0x000000010a19b192 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) + 3954
17 libnode.dylib 0x000000010a19cabb v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) + 10395
18 libnode.dylib 0x000000010a19cabb v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) + 10395
19 libnode.dylib 0x000000010a199ee9 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) + 5529
20 libnode.dylib 0x000000010a1996dc v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) + 3468
21 libnode.dylib 0x000000010a195a2d v8::internal::JsonStringifier::Stringify(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>) + 93
22 libnode.dylib 0x0000000109dc731a 0x1099c9000 + 4186906
23 ??? 0x000013e04e906147 0 + 21854111686983
24 ??? 0x000013e04e907cb5 0 + 21854111694005
25 ??? 0x000013e04eaeac1f 0 + 21854113672223
26 ??? 0x000013e04eaea749 0 + 21854113670985
27 ??? 0x000013e04eaea52d 0 + 21854113670445
28 ??? 0x000013e04eaea1ae 0 + 21854113669550
29 ??? 0x000013e04eac95db 0 + 21854113535451
30 ??? 0x000013e04e907cb5 0 + 21854111694005
31 ??? 0x000013e04f2cb750 0 + 21854121932624
32 ??? 0x000013e04f17f412 0 + 21854120571922
33 ??? 0x000013e04f17f186 0 + 21854120571270
34 ??? 0x000013e04e907cb5 0 + 21854111694005
35 ??? 0x000013e04f2cb3ab 0 + 21854121931691
36 ??? 0x000013e04eb32556 0 + 21854113965398
37 ??? 0x000013e04f2cb232 0 + 21854121931314
38 ??? 0x000013e04e907cb5 0 + 21854111694005
39 ??? 0x000013e04f2ca5b4 0 + 21854121928116
40 ??? 0x000013e04f181a57 0 + 21854120581719
41 ??? 0x000013e04f1818f4 0 + 21854120581364
42 ??? 0x000013e04f1816f4 0 + 21854120580852
43 ??? 0x000013e04e942263 0 + 21854111933027
44 ??? 0x000013e04e925d6f 0 + 21854111817071
45 libnode.dylib 0x000000010a08bf10 0x1099c9000 + 7089936
46 libnode.dylib 0x000000010a08bd19 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) + 313
47 libnode.dylib 0x0000000109d5816d v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) + 541
48 com.github.electron.framework 0x0000000108088de7 0x105bdc000 + 38456807
49 com.github.electron.framework 0x00000001080537ad 0x105bdc000 + 38238125
50 com.github.electron.framework 0x000000010864953e 0x105bdc000 + 44487998
51 com.github.electron.framework 0x0000000105e89032 0x105bdc000 + 2805810
52 com.github.electron.framework 0x0000000105e89123 0x105bdc000 + 2806051
53 com.github.electron.framework 0x00000001079675a5 0x105bdc000 + 30979493
54 com.github.electron.framework 0x0000000105de6eab 0x105bdc000 + 2141867
55 com.github.electron.framework 0x000000010795fb99 0x105bdc000 + 30948249
56 com.github.electron.framework 0x000000010795eb39 0x105bdc000 + 30944057
57 com.github.electron.framework 0x0000000105de6eab 0x105bdc000 + 2141867
58 com.github.electron.framework 0x0000000105e07c7c 0x105bdc000 + 2276476
59 com.github.electron.framework 0x0000000105e07f8c 0x105bdc000 + 2277260
60 com.github.electron.framework 0x0000000105e0856b 0x105bdc000 + 2278763
61 com.github.electron.framework 0x0000000105ddc839 0x105bdc000 + 2099257
62 com.github.electron.framework 0x0000000105dfec3a 0x105bdc000 + 2239546
63 com.github.electron.framework 0x0000000105ddc224 0x105bdc000 + 2097700
64 com.apple.CoreFoundation 0x00007fff9f323981 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
65 com.apple.CoreFoundation 0x00007fff9f304a7d __CFRunLoopDoSources0 + 557
66 com.apple.CoreFoundation 0x00007fff9f303f76 __CFRunLoopRun + 934
67 com.apple.CoreFoundation 0x00007fff9f303974 CFRunLoopRunSpecific + 420
68 com.apple.Foundation 0x00007fffa0d18612 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 277
69 com.github.electron.framework 0x0000000105ddce9e 0x105bdc000 + 2100894
70 com.github.electron.framework 0x0000000105ddc674 0x105bdc000 + 2098804
71 com.github.electron.framework 0x0000000105e1dfc1 0x105bdc000 + 2367425
72 com.github.electron.framework 0x0000000105e0735d 0x105bdc000 + 2274141
73 com.github.electron.framework 0x0000000106aa9e5a 0x105bdc000 + 15523418
74 com.github.electron.framework 0x00000001064a2e80 0x105bdc000 + 9203328
75 com.github.electron.framework 0x00000001064a2066 0x105bdc000 + 9199718
76 com.github.electron.framework 0x0000000105bde007 AtomMain + 71
77 com.github.electron.helper 0x0000000105bd5f26 main + 38
78 libdyld.dylib 0x00007fffb485b255 start + 1
Metadata
Metadata
Assignees
Labels
No labels
Activity
tommoor commentedon Mar 26, 2017
Issue does not exist in 0.16 - could it have been introduced by #1138 ?
rcjsuen commentedon Mar 26, 2017
I'm assuming you don't call
tree.free()ortreeEntry.free()anywhere, correct?Do you use
tree.getEntry(filePath)ortree.entryByPath(filePath)in your code?tommoor commentedon Mar 26, 2017
The current code is not manually calling
freealthough I have been working through the codebase today manually freeing objects in my attempts to debug this without success thus far.We're using
tree.getEntry(filePath)liberally, not usingentryByPathanywhere.rcjsuen commentedon Mar 26, 2017
You're on Mac, right? Are you seeing the crash on other operating systems?
We use
tree.getEntry(filePath)too and I'm doing some tests on our server on Windows 10 but I'm not crashing.tommoor commentedon Mar 26, 2017
Unfortunately our codebase only runs on Mac right now.
rcjsuen commentedon Mar 26, 2017
Do you use
tree.entryByName(name)ortree.entryByIndex?tommoor commentedon Mar 26, 2017
We don't use either of those methods. We use
tree.entries()which internally usesentryByIndexhowevertommoor commentedon Mar 26, 2017
Honestly the last two releases just seem very unstable in a number of ways, I'm changing code around to try and get around this bug and it's just triggering totally different segfaults - I'm tempted to report them all as a separate issues… e.g now I'm getting something else triggered by GC:
Another another error about pointer being freed on a different object: