Share

Exuberant Ctags

Tracker: Bugs

5 ctags on Win32 hangs when parsing SQL files - ID: 1752103
Last Update: Comment added ( sf-robot )

I have some strange "SQL" files that I use at work - they're actually run
through the C preprocessor and the output is a valid SQL file (don't ask me
why, it wasn't my idea). However, when ctags runs into this file, it hangs.
I'm running on Win32 (Vista x86), and I'm using the native version from the
website (not the Cygwin version)

Unfortunately, I can't send you the file, but I'm working on finding a test
case and building the program so I can get a backtrace. Here's an example
of the stuff in the file:

//****************Some comments

// Macros
#define FOO 25
#define BAR FOO
#define BAZ text

// Here's a schema
declare schema Test, 0.1, {0001010-0030-3000-3000-0000303030303202};
create table SomeTable (
name BAZ pk,
test text(FOO)
);

There's some more craziness in this file - it's basically the weirdest
"SQL" I've ever seen but the point is, even if Ctags can't make heads or
tails of it, it shouldn't ever hang.

--
Paul Betts <paul@paulbetts.org>


Paul Betts ( kitanokikori ) - 2007-07-11 16:54

5

Closed

Fixed

David Fishburn

None

None

Public


Comments ( 7 )

Date: 2008-05-16 02:20
Sender: sf-robotSourceForge.net Site Admin


This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).


Date: 2008-05-01 15:14
Sender: dfishburn


Without confirmation, assuming problem has been fixed with patch.


Date: 2008-03-29 21:37
Sender: elliotth


reassigning to dfishburn, since he's actually worked on it.

it would be great if the original submitter could comment on whether the
currently-committed code works.


Date: 2008-01-31 14:09
Sender: dfishburn


I just noticed this issue.
I just checked in a changed with respect to escaped strings (which would
be possible via the sql preprocessor. It is part of revision #637.
If possible, could you try with the current build (from trunk) and if the
problem is still there, a reproducible will be necessary.



Date: 2007-07-21 19:24
Sender: elliotth


the other thing i should have said was "it's best if you can build the
latest version from the Subversion repository, rather than the source of
the last release".

also, given that sourceforge doesn't let me put other developers on the
cc: list, i've assigned this to me for the time being. i'll reassign to the
sql maintainer when we've actually got something for him to work on.


Date: 2007-07-21 19:22
Sender: elliotth


do you have a minimal test case yet? it's usually not too hard. just
binary chop chunks out of the file until it stops behaving badly, then
binary chop bits back in until it starts again. then start removing stuff
from before the bad bit.

another thing to try would be to configure with --enable-maintainer-mode
and build dctags, which has the good property of tending to crash on input
it doesn't understand, rather than hang, with the crash often giving a
better idea of the real problem than where normal ctags gets stuck.


Date: 2007-07-11 18:19
Sender: kitanokikoriAccepting Donations


Backtrace:
0:000> kP
ChildEBP RetAddr
WARNING: Stack unwind information not available. Following frames may be
wrong.
003bef48 672c62ec ntdll!KiFastSystemCallRet
003bef8c 672c6770 MSVCR90!realloc+0x9f7
003befd0 6728e51a MSVCR90!read+0xc0
003befec 6728da46 MSVCR90!filbuf+0x7d
003bf024 00104cc8 MSVCR90!getc+0xe0
003bf038 00104de5 ctags!iFileGetc(void)+0x18
[c:\users\paulbe\desktop\ctags56\read.c @ 327]
003bf05c 00104f11 ctags!iFileGetLine(void)+0x35
[c:\users\paulbe\desktop\ctags56\read.c @ 386]
003bf060 001079a4 ctags!fileGetc(void)+0x41
[c:\users\paulbe\desktop\ctags56\read.c @ 431]
003bf070 00108305 ctags!readToken(
struct sTokenInfo * token = 0x00000000)+0x94
[c:\users\paulbe\desktop\ctags56\sql.c @ 373]
003bf0d8 001084dc ctags!parseSqlFile(
struct sTokenInfo * token = 0xffffffff)+0x15
[c:\users\paulbe\desktop\ctags56\sql.c @ 640]
003bf0f0 00102b28 ctags!findSqlTags(void)+0x5c
[c:\users\paulbe\desktop\ctags56\sql.c @ 671]
003bf104 00102bc5 ctags!createTagsForFile(
char * fileName = 0x00000040 "",
int language = -1,
unsigned int passCount = <Memory access error>)+0x58
[c:\users\paulbe\desktop\ctags56\parse.c @ 618]
003bf130 00102ca8 ctags!createTagsWithFallback(
char * fileName = 0xffffffff "",
int language = 0)+0x35 [c:\users\paulbe\desktop\ctags56\parse.c @ 640]
003bf21c 77477948 ctags!parseFile(
char * fileName = 0xffffffff "")+0x98
[c:\users\paulbe\desktop\ctags56\parse.c @ 669]
003bf2a8 000fea82 kernel32!HeapFree+0x14
003bf2c4 000feb54 ctags!recurseIntoDirectory(
char * dirName = 0x0052d5e0 "<A path>")+0xa2
[c:\users\paulbe\desktop\ctags56\main.c @ 265]
003bf2d8 000fe92e ctags!createTagsForEntry(
char * entryName = 0x00000000 "")+0xa4
[c:\users\paulbe\desktop\ctags56\main.c @ 299]
003bf2f0 000fe9a2 ctags!createTagsForWildcardEntry(
char * pattern = 0x000fea82 "???",
unsigned int dirLength = 0x52bce8,
char * entryName = 0xffffffff "")+0x9e
[c:\users\paulbe\desktop\ctags56\main.c @ 184]
003bf440 000fea82 ctags!createTagsForWildcardUsingFindfirst(
char * pattern = 0x00000000 "")+0x52
[c:\users\paulbe\desktop\ctags56\main.c @ 210]
003bf45c 000feb54 ctags!recurseIntoDirectory(
char * dirName = 0x0052d670 "<A path>")+0xa2
[c:\users\paulbe\desktop\ctags56\main.c @ 265]



Attached File

No Files Currently Attached

Changes ( 7 )

Field Old Value Date By
status_id Pending 2008-05-16 02:20 sf-robot
close_date 2008-05-01 15:14 2008-05-16 02:20 sf-robot
close_date - 2008-05-01 15:14 dfishburn
resolution_id None 2008-05-01 15:14 dfishburn
status_id Open 2008-05-01 15:14 dfishburn
assigned_to elliotth 2008-03-29 21:37 elliotth
assigned_to nobody 2007-07-21 19:22 elliotth