I seem to have discovered an infinite loop bug in ctags, which TextMate depends on.
1. Create a new document 2. Paste in the text "This is a buggy <Java> program" 3. Change file type to Java 4. Save
At this point, TextMate beachballs and I have to force quit. After that, I find that a ctags process is still running and consuming 100% of the CPU. Can anyone reproduce this?
Trevor
P.S. TextMate 1.5.1 (948)
Hey there,
2006/5/3, Trevor Harmon trevor@vocaro.com:
I seem to have discovered an infinite loop bug in ctags, which TextMate depends on.
- Create a new document
- Paste in the text "This is a buggy <Java> program"
- Change file type to Java
- Save
Can anyone reproduce this?
I just did some super-basic-testing on this: (I can be writing pure non sense)
I'm using TM 1.5.1 (985), and something's definitely weirdo in here.
1. I copied/pasted directly from your text, from my email message. TM went nuts as soon as i clicked on the Save button on the Save Dialog. Again, ctags consuming ~60%CPU and increasing RAM usage by seconds, till ~140 MiB, where i killed the ctags process.
2. I tried to paste exactly the same text, written and copied this time by me in another TM document created from scratch. This time, TM saved the file correctly, no problems at all.
3. Then, i pasted your text from my email message, and modified it till it read "Testing". Then, proceeded to save: again, the same memory leak.
4. Created a new fancy TM document, and wrote "This is a buggy <Java> program". Changed filetype, and saved correctly, no problems at all.
5. Created a new TM document. Pasted the text from your email message. This time, changed filetype from Plain Text to HTML, and saved correctly. Then, changed back from HTML to Java file type, and replaced. Again, the memory leak.
6. I'm out of ideas :P
-- "The Universe is a big place, perhaps the biggest" Kilgore Trout, Venus On The Half Shell
This is clearly a problem with the Exuberant tags implementation and TmCodeBrowser, you should probably file your complaints there. A quick fix is the following: open the file .ctags.tmcodebrowser which lives in your home directory, (i.e. type "mate .ctags.tmcodebrowser" in the command line) and add the following two lines at the end, after an empty line:
--langdef=java --langmap=java:.java
save and close, and you should not have problems anymore. Of course, you can't use tmcodebrowser for java now, unless you add the necessary command there. Also, you will be getting a "ctags: Warning: Language "java" already defined" in the console as a consequence.
Definitely make sure to contact Gerd Knops (http://www.cocoabits.com/ TmCodeBrowser/) and the Exuberant tags team (http:// ctags.sourceforge.net/) because this is clearly a bug with ctags. But ASAIK, it is TmCodeBrowser that uses ctags, not TextMate itself.
On May 2, 2006, at 6:54 PM, Trevor Harmon wrote:
I seem to have discovered an infinite loop bug in ctags, which TextMate depends on.
- Create a new document
- Paste in the text "This is a buggy <Java> program"
- Change file type to Java
- Save
At this point, TextMate beachballs and I have to force quit. After that, I find that a ctags process is still running and consuming 100% of the CPU. Can anyone reproduce this?
Trevor
P.S. TextMate 1.5.1 (948)
Haris
On May 2, 2006, at 6:54 PM, Trevor Harmon wrote:
I seem to have discovered an infinite loop bug in ctags, which TextMate depends on.
As others have noted TmCodeBrowser uses ctags and causes TextMate to hang when ctags hangs.
I am not sure if the Exuberant tags (http://ctags.sourceforge.net/) are actively maintained at the moment, there are several known bits of text that can make it hang. Fixing that in ctags requires a bit more than casual poking.
So with the next version of TmCodeBrowser it will read from ctags asynchronously in the background. That way TextMate will be encapsulated from any ctags problems. If ctags should fail to answer within a reasonable amount of time TmCodeBrowser will terminate it.
I plan to release that version of TmCodeBrowser later today and will announce it to the list.
Gerd