haacked / seegit

SeeGit - The Git Repository Visualizer
MIT License
508 stars 107 forks source link

Stack Overflow Exception #56

Closed jogibear9988 closed 9 years ago

jogibear9988 commented 11 years ago

I got a Stack overflow Exception in LibGit2Sharp at RepositoryGraphBuilder.cs an line 109!

Anything I can do here?

jogibear9988 commented 11 years ago

For Example Try with the official SharpDevelop Git Repo, and it crashes...

Therzok commented 11 years ago

We're handling this recursively, on adding each parent commit. We should revise the graph addition. Around 3906 nested method calls on my crash.

Therzok commented 11 years ago

Was thinking of transforming the data into a stack of commits.

AddCommitsToGraph creates a new stack for the current graph.

Case 1: commit.Parents > 1, call AddCommitsToGraph Case 2: commit.Parents = 1, add to stack

Start popping results and do actions?

This way, we only get a width number of function calls, never a depth one.

Therzok commented 11 years ago

In fact, it needs a queue not a stack. We also need to preserve order.

Therzok commented 11 years ago

Fixing it this way is not an option. SeeGit ran for 10 mins trying to generate the graph and I ran out of ram. (It ate up to 1.5 gb before I killed the process.)

Therzok commented 11 years ago

Hey @jogibear9988 try out branch fixOverflow. It's a temporary solution and it might eat up all your RAM. =D

jogibear9988 commented 11 years ago

Now I got the same exception on line 91 in the same class!

foreach (var parent in commit.Parents) { HighlightCommitsOnCurrentBranch(parent, GetCommitVertex(parent)); }

Therzok commented 11 years ago

So it worked after all, right? I'll apply a patch for this issue too.

Therzok commented 11 years ago

Try out the new version in the fixOverflow branch.

jogibear9988 commented 11 years ago

Does not crash.... Taks a very long time, than hangs here: RaisePropertyChanged(() => Graph);