ivan-m / SourceGraph

Static code analysis using graph-theoretic techniques
GNU General Public License v3.0
27 stars 11 forks source link

Apparent inifite time to process code #4

Open WeeBull opened 8 years ago

WeeBull commented 8 years ago

I using SourceGraph (actually the @utdemir fork, so it'll build) some parser code that I've written to try to identify recursive loops in the type graph and call graph. I seems that I'm managing to throw SourceGraph into an infinite loop, as processing never completes (24 hours later, still going, no files written to SourceGraph/graphs apart from the legend PNGS and a zero length code.dot).

I think it's getting lost in code associated with finding cycles and cliques. Profiling shows this:

COST CENTRE          MODULE                                %time %alloc

pathTree.subPathTree Data.Graph.Analysis.Algorithms.Common  51.9   53.5
pathTree.g'          Data.Graph.Analysis.Algorithms.Common  32.7   36.4
pathTree             Data.Graph.Analysis.Algorithms.Common   4.0    5.0 
makeLeaf.p'          Data.Graph.Analysis.Algorithms.Common   3.1    3.1
pathTree.sucs        Data.Graph.Analysis.Algorithms.Common   3.1    0.4

I've attached a full profile from the first five minutes of running. SourceGraphProf.zip

Any suggestions on how I can get around this problem?

ivan-m commented 8 years ago

Yeah, ummm.... I've forgotten to keep this maintained...

It's quite likely that changes I've made to FGL have been reflected here. Any chance of a minimal code sample I can use to try and work out what's going on? And do you know which version of FGL this was built against?

WeeBull commented 8 years ago

On 8 Sep 2016, at 05:49, Ivan Lazar Miljenovic notifications@github.com wrote: Any chance of a minimal code sample I can use to try and work out what's going on?

I’m trying to extract an example. Honestly, It’s about 10k lines of code (750 functions and similar data types + constructors) and I’m trying to work out whether a run is going to complete, but just take a while, or just never return is causing difficultly. Unfortunately the code base isn’t public.

I’ll keep trying because I realise this is probably almost impossible without being able to reproduce.

And do you know which version of FGL this was built against?

I’ve built against fgl-5.5.2.3.