Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with new opengrok jumping inside a fortran file to a fortran subroutine - doesn't find symbol #1316

Open
ilovemaui opened this issue Jan 5, 2017 · 11 comments

Comments

@ilovemaui
Copy link

this is in opengrok-0.13-rc5

so here is an example. I have a fortran file called foo.f

inside foo.f there is another subroutine in here call foo1 with a definition like this:

subroutine foo1 (a,b,c,d,e,f)
when I click on foo1 - it tries to run this:
https://myopengrok/source/s?defs=foo1
and it doesn't find it

but if I tried running in a old version of opengrok - 0.9, and I do the same thing, instead of running the above url, it does this instead, and works:
https://myopengrok/source/s?refs=foo1

@vladak
Copy link
Member

vladak commented Jan 5, 2017

What ctags implementation/version do you use ? Could you post a sample file ?

@ilovemaui
Copy link
Author

here is the ctags info:
$ ./ctags --version
Universal Ctags 0.0.0, Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
Compiled: Aug 2 2016, 17:38:54
URL: https://ctags.io/
Optional compiled features: +wildcards, +regex, +option-directory, +coproc

I checked a few files, and there doesn't seem to be any rhyme or reason why some of these work, and some don't. I can look in a fortran .f file with 9 subroutines/functions in it. and 7 of them will try to invoke the new command with s?defs=, and others will use the s?refs= command.

The only other things I see in the logs (in lots of places), and I don't know if it has anything to do with this problem are things like this:

an 05, 2017 8:11:15 AM org.opensolaris.opengrok.analysis.Ctags readTags
WARNING: Unexpected end of file!
Jan 05, 2017 8:11:15 AM org.opensolaris.opengrok.analysis.Ctags$1 run
WARNING: Error from ctags: ctags: Warning: Language "clojure" already defined
ctags: Warning: Language "pascal" already defined
ctags: Warning: Language "rust" already defined

Jan 05, 2017 8:11:15 AM org.opensolaris.opengrok.analysis.Ctags readTags
WARNING: Ctags problem:
java.lang.IllegalThreadStateException: process hasn't exited
at java.lang.UNIXProcess.exitValue(UNIXProcess.java:424)
at org.opensolaris.opengrok.analysis.Ctags.readTags(Ctags.java:383)
at org.opensolaris.opengrok.analysis.Ctags.doCtags(Ctags.java:262)
at org.opensolaris.opengrok.analysis.plain.PlainAnalyzer.analyze(PlainAnalyzer.java:80)
at org.opensolaris.opengrok.analysis.plain.AbstractSourceCodeAnalyzer.analyze(AbstractSourceCodeAnalyzer.java:69)
at org.opensolaris.opengrok.analysis.AnalyzerGuru.populateDocument(AnalyzerGuru.java:358)
at org.opensolaris.opengrok.index.IndexDatabase.addFile(IndexDatabase.java:622)
at org.opensolaris.opengrok.index.IndexDatabase.indexDown(IndexDatabase.java:883)
at org.opensolaris.opengrok.index.IndexDatabase.indexDown(IndexDatabase.java:848)
at org.opensolaris.opengrok.index.IndexDatabase.indexDown(IndexDatabase.java:848)
at org.opensolaris.opengrok.index.IndexDatabase.indexDown(IndexDatabase.java:848)
at org.opensolaris.opengrok.index.IndexDatabase.indexDown(IndexDatabase.java:848)
at org.opensolaris.opengrok.index.IndexDatabase.indexDown(IndexDatabase.java:848)
at org.opensolaris.opengrok.index.IndexDatabase.update(IndexDatabase.java:397)
at org.opensolaris.opengrok.index.IndexDatabase$2.run(IndexDatabase.java:184)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

@tulinkry
Copy link
Contributor

I'm trying but I can't reproduce it. If you could post the faulty file (truncated, censored, without unneccessary code) which would reproduce the problem, that would be fine.

Refs get generated when it's probably the definition of the symbol.
Defs get generated when the symbol is not a definition and has occurred more than once in that file.

@ilovemaui
Copy link
Author

So I looked at this again, and I can find no rhyme or reason why this occurs. It's random throughout our code base. I was looking at a fortran file (that had around 15 subroutines), and 2 of the files could be reference via the definition (and those subroutines were highlighted in opengrok in a dark blue color), where the other files had no special color. I can't seem to find any pattern that might speak to this. Any ideas?

@vladak
Copy link
Member

vladak commented Mar 30, 2017

The way I deal with such problems is I try to isolate the problem as far as I can by making the file smaller and smaller and reindex each time to see if the problem is still there. Once I arrive to minimal reproducible case then redact the file and post it. At least this is what I did when we encountered bugs in Universal ctags.

@vladak
Copy link
Member

vladak commented Mar 30, 2017

You should definitely try to run latest greatest Universal ctags binary on the files to see what set of definitions are produced. OpenGrok gets the function definitions from Universal ctags.

@ilovemaui
Copy link
Author

thanks, i will try pulling down the latest version of universal-ctags, and see if it is fixed in there.

@vladak
Copy link
Member

vladak commented Apr 19, 2017

@ilovemaui any news ?

@ilovemaui
Copy link
Author

I am not sure if this is still broken. I plan to build the latest version of OpenGrok soon, so can see if all of these issues are fixed there.

@vladak
Copy link
Member

vladak commented Apr 19, 2017

Here the key is to try the latest universal-ctags, OpenGrok changes will not help there I believe.

@ilovemaui
Copy link
Author

ok. will let you know. will try to test in the next couple of weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants