ctags icon indicating copy to clipboard operation
ctags copied to clipboard

main: truncate the tag file failed

Open FrontWhite opened this issue 1 year ago • 6 comments

An error occurred when I used the following command to build, and the desired answer was not found on the Internet.

Chatgpt told me to run as an administrator, I tried but it didn't work ctags_error

FrontWhite avatar Jun 04 '24 07:06 FrontWhite

https://github.com/universal-ctags/citre/issues/123#issuecomment-1127793035 I added "-- kinds-C=- zlD -- kinds-C++=- zlD" according to it, but it didn't work

FrontWhite avatar Jun 04 '24 08:06 FrontWhite

The result implies that ftell(), a standard C function, returns -1. ftell returns -1 when an error occurs.

ftell() is called indirectly from setTagFilePosition(). When I developed the code, I assumed an error never occurred in the context where ftell() is called.

Could you try reproducing the error with the following short input file (input.c)?

}

With the input, run:

> ctags input.c

masatake avatar Jun 04 '24 18:06 masatake

I pushed #4012. It is not a fix for this issue. However, it helps us understand what happens when ftell reports an error.

I will merge #4012 in soon.

masatake avatar Jun 04 '24 18:06 masatake

Merged.

In a day, a new binary executable file that includes #4012 will be pushed at https://github.com/universal-ctags/ctags-nightly-build/releases. I would like you to try the executable. I would like to see the output.

masatake avatar Jun 04 '24 19:06 masatake

Could you try reproducing the error with the following short input file (input.c)?

I did this, but there was no error reported,Here is tags output:

!_TAG_EXTRA_DESCRIPTION anonymous /Include tags for non-named objects like lambda/ !_TAG_EXTRA_DESCRIPTION fileScope /Include tags of file scope/ !_TAG_EXTRA_DESCRIPTION pseudo /Include pseudo tags/ !_TAG_EXTRA_DESCRIPTION subparser /Include tags generated by subparsers/ !_TAG_FIELD_DESCRIPTION epoch /the last modified time of the input file (only for F/file kind tag)/ !_TAG_FIELD_DESCRIPTION file /File-restricted scoping/ !_TAG_FIELD_DESCRIPTION input /input file/ !_TAG_FIELD_DESCRIPTION name /tag name/ !_TAG_FIELD_DESCRIPTION pattern /pattern/ !_TAG_FIELD_DESCRIPTION typeref /Type and name of a variable or typedef/ !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ !_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/ !_TAG_OUTPUT_FILESEP slash /slash or backslash/ !_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ !_TAG_OUTPUT_VERSION 0.0 /current.age/ !_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/ !_TAG_PROC_CWD E:/1800L/SP06/ // !_TAG_PROGRAM_AUTHOR Universal Ctags Team // !_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ !_TAG_PROGRAM_URL https://ctags.io/ /official site/ !_TAG_PROGRAM_VERSION 6.1.0 /v6.1.0/

FrontWhite avatar Jun 05 '24 00:06 FrontWhite

Could you try the latest binary available from https://github.com/universal-ctags/ctags-nightly-build/releases/tag/2024.06.06%2B08e07dc985ea03ebad207a933a94a544f81776e3 ?

I added debug prints that may help us understand what happened.

masatake avatar Jun 07 '24 05:06 masatake

I really wanted to fix this, but I could not get information. If you can reproduce the issue with a new executable, please reopen this.

masatake avatar Jul 07 '24 18:07 masatake