cscope: Cscope error: cscope: cannot read list size from file cscope.out - cscope

Issue:
I get the following error when I try to open a file in vim (version 7.3).
cs_read_prompt EOF: Illegal seek
E609: Cscope error: cscope: cannot read list size from file cscope.out
Description:
I created the cscope database "cscope.out" using the command "cscope -b -R". The file ~/.vim/plugin/cscope_maps.vim contains the command "cs add cscope.out" to add the cscope database. When I try to open one of the source files, I get the error mentioned above.
uname -a
Linux 2.6.16.60-0.58.1.3835.0.PTF.638363-smp #1 SMP Wed Dec 2 12:27:56 UTC 2009 x86_64 x86_64 x86_64 GNU/Linux
What could be the problem here?
Thanks for your help.

I had the same problem.
Mine got resolved when I found that the size of the "cscope.out" file was too LARGE(~2.5GB).
Create a separate cscope DB for larger sub folders. And add all DBs separately using ":cs add ".
Note: Reverse index(cscope -b -q) creates larger files.

One of the cases where you encounter this error is: if you have a directory that has space(s) in the directory name (even in the path of your source folder) then rename the directory without space(s) and retry.

There may be multiple version of cscope on your system. You may check various location of your cscope binary by
whereis cscope
Then add one of this path in your .vimrc
vim ~/.vimrc
set csprg=/path/to/your/desired/cscope

Related

Bash script can't find file in /opt and gives strange error message

I am trying to use a simple bash script that uses a script in /opt
#!/bin/bash
pvpython=/opt/paraviewopenfoam54/bin/pvbatch
script_path=save_contours.py
$pvpython $script_path
The file pvbatch does exist, however when I try to run the script I get this strange error message which feels like it is missing some characters:
: No such file or directoryaviewopenfoam54/bin/pvbatch
The Ubuntu I am using is Ubuntu 18.04.1 LTS inside a Windows subsystem for Linux. What could cause this error message?
When I run ls -al pvbatch in /opt/paraviewopenfoam54/bin I get
-rwxr-xr-x 1 root root 84200 May 29 2018 pvbatch
cat pvbatch returns an error message
cat: write error: Input/output error
So cat cant read the file which is strange!
My first thought is that there is an issue with the file itself. where was the file created? I see that it is under /opt/paraviewopenfoam54/bin which is a linux managed folder, did you create and edit the file using vim in WSL or did you create it in windows somehow with VS Code or the like?
Let me just check that you are not creating and editing files in windows directly in the /opt folder inside the %LOCALAPPDATA% folders. If the file was created in this method you risk corrupting the WSL installation. Dont Edit WSL files
When using WSL I commonly find issues and especially this Input/output error issue whenever I create a file directly from windows into the Linux filesystem. There are essentially three main ways to fix this specific issue: (these are not steps but rather separate solutions)
-Restart your Ubuntu terminal
-Restart your entire computer
-Delete the file directly from Windows, touch the file, then overwrite the file with the old one
For a more scalable solution, I recommend leaving the file within the windows system and only working within the Linux system within Linux.

Why "gofmt -d" gives "computing diff: exec: "diff": executable file not found in %PATH%" error on windows?

I would like to see what mistakes I made in my golang files. In order to figure it out, I issue a command like this:
gofmt -d myfile.go
According to the gofmt --help manual, it is supposed to list the diff of the current and the desired versions of the file. Instead of this, it produces this error message:
computing diff: exec: "diff": executable file not found in %PATH%
How could this be fixed?
The gofmt tool assumes the system has an installed and available diff. Unfortunately, this tool is not part of a standard Windows installation so you need to add it manually.
For most of us, the easiest way to add the path of the diff tool we already have on our computer. This is the one that has been installed as part of git. (If git hasn't been installed yet then do it at first.)
In order to solve this, you should issue a command from the DOS prompt in which you want to execute gofmt:
set PATH=%PATH%;c:\Program Files\Git\usr\bin
(Maybe you need to change the path according to your git installation.)
For a more permanent solution, you should add the path of diff.exe to the PATH environment variable via the Control Panel.

/usr/local/bin/vim: cannot execute binary file: Exec format error

Trying to learn more about the many mysteries of bash.
I have neovim installed. I have nvim aliased to vim. I have nvim configured to use my vim config.
Let's say I want to use the real vim command, though. which vim yields "/usr/local/bin/vim".
But calling /usr/local/bin/vim directly results in the error given in the title. Why is that? How can I run my vim command directly?
From the result of the file command it seems that the file in /usr/local/bin/vim is somehow broken (the system doesn't recognize it as an elf file).
The file command should identify any executable file with the file format (and other types of files). When this command returns output of data it means that it couldn't identify the file at all.
Since you found the vim executable in Cellar/vim/8.1.1000/bin/vim, you can use this file instead of file which is in /usr/local/bin/vim, or you can create the link by yourself, that should fix this error.
If you would create the link with absolute path instead of relative path, it should work.

How to add directories to Cygwin gcc default search path

I'm a bit of a noob at working with compilers. I want to add an arbitrary directory on my win 8 C:\ drive to the Cygwin gcc default search path.
Here is what I have tried so far. Using gcc --help I found the commands -print-search-dirs and -B <directory> ("add directory to the compiler's search path").
Using the former command output this:
install: /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/
programs: =/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/:/usr/lib/gcc/x86_64-pc-cygwin/4.
9.2/:/usr/lib/gcc/x86_64-pc-cygwin/:/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/:/usr/li
b/gcc/x86_64-pc-cygwin/:/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/../../../../x86_64-p
c-cygwin/bin/x86_64-pc-cygwin/4.9.2/:/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/../../.
./../x86_64-pc-cygwin/bin/
libraries: =/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/:/usr/lib/gcc/x86_64-pc-cygwin/4
.9.2/../../../../x86_64-pc-cygwin/lib/x86_64-pc-cygwin/4.9.2/:/usr/lib/gcc/x86_6
4-pc-cygwin/4.9.2/../../../../x86_64-pc-cygwin/lib/../lib/:/usr/lib/gcc/x86_64-p
c-cygwin/4.9.2/../../../x86_64-pc-cygwin/4.9.2/:/usr/lib/gcc/x86_64-pc-cygwin/4.
9.2/../../../../lib/:/lib/x86_64-pc-cygwin/4.9.2/:/lib/../lib/:/usr/lib/x86_64-p
c-cygwin/4.9.2/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/../../../..
/x86_64-pc-cygwin/lib/:/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/../../../:/lib/:/usr/
lib/
The full path to /usr is C:\cygwin64\usr. The directory I want to add is c:\directory So I tried gcc -B /../directory and other variations, but I get error
gcc: fatal error: no input files
compilation terminated
Seems like it thinks I'm trying to compile something. I want to permanently add a directory to the list of default search paths.
There are two issues at play here.
The first problem has to do with the fact that Cygwin views the top of its directory tree / to be within the Windows directory C:\cygwin64. As a result, you are unable to move above that point in the filesystem. The solution is to go through Cygwin's directory /cygdrive, which is the access point where all Windows disk drives are mounted. You can access the top-level Windows directory C:\ from Cygwin as /cygdrive/c. So for the problem above, instead of using gcc -B /../directory, try using gcc -B /cygdrive/c/directory.
The second issue is that of adding directories to the search path, versus telling it to compile a specific source file. Given the date of this question, I assume you've solved that part of the problem at this point?

Chipmunk iphonestatic command error

so, I just downloaded the latest Version of chipmunk, and when I run the iphonestatic.command from finder I get the following output in my Command Line
Last login: Wed Oct 26 22:15:59 on ttys001
PS1:~ Thermo$ /Users/Thermo/Desktop/Programs\ software/Software/iphonestatic.command ; exit;
usage: dirname path
Build settings from command line:
SDKROOT = iphoneos4.3
xcodebuild: error: 'Chipmunk6.xcodeproj' does not exist.
logout
I can't get the script to build the proper files, and have been trying to figure this out for a while,
thanks for any help
Aha! After a stroke of luck I discovered that you could cause that bug by having a space in your path somewhere.
The first line of the script does this to set the working directory to the parent directory of the script when running it from the finder:
cd `dirname $0`
It barfs when you have a space in the path somewhere. Not exactly certain how to fix it... The workaround is easy enough though, just make sure you put it somewhere it won't have a space.
edit: Looks like it just needs multiple sets of parens:
cd "`dirname "$0"`"

Resources