I am running a C script which calls many subroutines. I have tested and used without problems this script before with slightly different inputs. Now I noticed I get a "segmentation fault (core dumped)" and the script fails.

It has two input files, let's call them file1 and file2. It would be quite difficult to make a simple example of the script so I am asking a general question.

I started debugging and noticed that the segmentation fault does not happen when file2 is located somewhere else and the script finishes successfully.
Particularly, when file2 is located in the directory where I am running the script, it finishes sucessfully.
When it is more than a few directories up and then more of the path, a segmentation fault occurs.

So if I run it as:

Code:
myscript -a file1 -b file2
or

Code:
myscript -a file1 -b ../file2
it is fine.
When I run it as e.g.

Code:
myscript -a file1 -b ../../../home/server/disk1/user7/software/inputs/file2
Is there a reason why the location of the file could affect the running?