Created
June 24, 2013 22:13
-
-
Save chbrown/5854153 to your computer and use it in GitHub Desktop.
nodegit woes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gdb --args node --noopt --nocache_optimized_code --nooptimize_closures cli.js gitlist ~/src/akka | |
GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Wed Feb 6 22:51:23 UTC 2013) | |
Copyright 2004 Free Software Foundation, Inc. | |
GDB is free software, covered by the GNU General Public License, and you are | |
welcome to change it and/or distribute copies of it under certain conditions. | |
Type "show copying" to see the conditions. | |
There is absolutely no warranty for GDB. Type "show warranty" for details. | |
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ........ done | |
(gdb) run | |
Starting program: /usr/local/bin/node --noopt --nocache_optimized_code --nooptimize_closures cli.js gitlist /Users/chbrown/src/akka | |
Reading symbols for shared libraries +++++++...................................................................................................................................... done | |
Reading symbols for shared libraries .... done | |
--- repository: /Users/chbrown/src/akka --- | |
--- branch: master --- | |
6320 commits | |
--- commit: 0a31ad718883ef0314de6dc8c6c2c9699eadfdae --- | |
--- 0 parent(s) --- | |
Skipping. | |
--- commit: d01a293fa7bf66ef2d94d4498063fe719b89a85c --- | |
--- 1 parent(s) --- | |
--- 1 diffLists(s) --- | |
Program received signal EXC_BAD_ACCESS, Could not access memory. | |
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000010 | |
[Switching to process 16406 thread 0x2303] | |
std::vector<GitDiffList::DeltaContent*, std::allocator<GitDiffList::DeltaContent*> >::push_back (this=0x8, __x=@0x114089870) at stl_vector.h:602 | |
602 if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) | |
(gdb) backtrace | |
#0 std::vector<GitDiffList::DeltaContent*, std::allocator<GitDiffList::DeltaContent*> >::push_back (this=0x8, __x=@0x114089870) at stl_vector.h:602 | |
#1 0x0000000100dce5be in GitDiffList::WalkWorkData (delta=<value temporarily unavailable, due to optimizations>, range=<value temporarily unavailable, due to optimizations>, line_origin=32 ' ', content=<value temporarily unavailable, due to optimizations>, content_len=106, payload=<value temporarily unavailable, due to optimizations>) at ../src/diff_list.cc:384 | |
#2 0x00000001031278a4 in diff_patch_cb (priv=0x114089d60, bufs=0x114089940, len=2) at /Users/chbrown/github/committers/node_modules/nodegit/vendor/libgit2/src/diff_output.c:693 | |
#3 0x000000010319fa2c in xdl_emit_diffrec (rec=0x1030e94c3 " xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n \n <modelVersion>4.0.0</modelVersion>\n\n <name>Akka Actor Kernel</name>\n <artifactId>akka</"..., size=106, pre=0x1031ae285 " ", psize=1, ecb=0x114089cf0) at /Users/chbrown/github/committers/node_modules/nodegit/vendor/libgit2/src/xdiff/xutils.c:55 | |
#4 0x00000001031998a3 in xdl_emit_record (xdf=0x114089bf0, ri=3, pre=0x1031ae285 " ", ecb=0x114089cf0) at /Users/chbrown/github/committers/node_modules/nodegit/vendor/libgit2/src/xdiff/xemit.c:47 | |
#5 0x00000001031992ce in xdl_emit_diff (xe=0x114089b68, xscr=0x1030e9240, ecb=0x114089cf0, xecfg=0x114089e60) at /Users/chbrown/github/committers/node_modules/nodegit/vendor/libgit2/src/xdiff/xemit.c:213 | |
#6 0x0000000103198c7e in xdl_diff (mf1=0x114089ce0, mf2=0x114089cd0, xpp=0x114089e90, xecfg=0x114089e60, ecb=0x114089cf0) at /Users/chbrown/github/committers/node_modules/nodegit/vendor/libgit2/src/xdiff/xdiffi.c:561 | |
#7 0x0000000103123ed6 in diff_patch_generate (ctxt=0x114089e10, patch=0x114089d60) at /Users/chbrown/github/committers/node_modules/nodegit/vendor/libgit2/src/diff_output.c:749 | |
#8 0x0000000103123335 in git_diff_foreach (diff=0x10be2ad30, file_cb=0x100dce396 <GitDiffList::WalkWorkFile(git_diff_delta const*, float, void*)>, hunk_cb=0x100dce4d4 <GitDiffList::WalkWorkHunk(git_diff_delta const*, git_diff_range const*, char const*, unsigned long, void*)>, data_cb=0x100dce4dc <GitDiffList::WalkWorkData(git_diff_delta const*, git_diff_range const*, char, char const*, unsigned long, void*)>, payload=0x10bd675a0) at /Users/chbrown/github/committers/node_modules/nodegit/vendor/libgit2/src/diff_output.c:977 | |
#9 0x0000000100dce35b in GitDiffList::WalkWork (payload=0x10bd675a0) at ../src/diff_list.cc:311 | |
#10 0x0000000100123bbd in uv__thread_start () | |
#11 0x00007fff92a097a2 in _pthread_start () | |
#12 0x00007fff929f61e1 in thread_start () | |
Current language: auto; currently c++ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not obvious, sorry :(. It's possibly a threading issue since RevWalk is not totally thread safe, and you're definitely crossing thread-boundaries in your code. Can you gist your cli.js?
I'm going to rewrite RevWalk and DiffList over the next two days. I'd like to use your stuff as a test case. The bad news, I think, is I doubt my code will merge to master for at least 1-2 weeks, and when it does it will be a breaking API change.