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

Editing template headers results in freeze #98

Open
sbroberg opened this issue Apr 13, 2017 · 5 comments
Open

Editing template headers results in freeze #98

sbroberg opened this issue Apr 13, 2017 · 5 comments

Comments

@sbroberg
Copy link

Not sure if this is a cmake-ide problem or an rtags one:

When editing a .h file that defines a template used by much of the code base, emacs was locking up even though no CPU was being consumed on the box. I'm not positive, but I think I've chased down the reason:

  1. cmake-ide was not finding an associated .cpp file (there is none, it's just a template defined in a .h), so it was using all the flags for the project.
  2. The combined list of all flags (which included the same values repeated over & over, due to the project being organized into submodules) turns out to exceed the command line limit, so I was seeing an "Argument list too long" error in the clang-error buffer.
  3. This error seems to have caused the rtags or cmake-ide task to block emacs (ultimately unblocked by hammering C-g for 10-15 seconds, but will not unblock by itself without user intervention).

Prior to setting rtags-periodic-reparse-timeout to 15, I was unable to actually see the clang-error buffer in step 2 - emacs would just freeze indefinitely.

Is it possible to disable parsing of header files I know to be problematic via config somewhere, or possibly change the behavior of the "Could not find suitable src file" logic so that it doesn't include all flags from the project, but instead uses the flags from another cpp file in the same module as the header (e.g., a unit test cpp file)?

@atilaneves
Copy link
Owner

Try setting to nil either or both of cmake-ide-header-search-other-file and cmake-ide-header-search-first-including

@sbroberg
Copy link
Author

Those are currently set to nil in my config.

@atilaneves
Copy link
Owner

Is this an open source header?

@sbroberg
Copy link
Author

No, it's our own code. Do you want me to create a reproducible case? It may be somewhat difficult, since this problem only started occuring recently. I'm not sure if it has to do with the change to rtags, cmake-ide, or just our project size crossing a threshold.

I feel like the underlying problem is that rtags is blocking emacs when it needs to reanalyze the file, which may not really be your problem. Disabling rtags and relying on irony instead of rtags (but still using cmake-ide) eliminates the problem, but, of course, I lose all of rtags' navigation features. It seems like irony handles the asynchronous reindexing better than rtags does.

@atilaneves
Copy link
Owner

If disabling rtags solves the problem then it's almost definitely an rtags issue. I asked about the header to be able to reproduce the issue, yes, otherwise there's not much I can do but speculate.

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

2 participants