# Linux native build from source: small bug in FPaths::MakePathRelativeTo

**URL:** <https://forums.unrealengine.com/t/linux-native-build-from-source-small-bug-in-fpaths-makepathrelativeto/332890>\
**Category:** C++\
**Tags:** linux-build, unreal-engine, bug-report, editor, UE4, CPP, question\
**Created:** [September 20, 2015, 11:34pm UTC](https://forums.unrealengine.com/t/linux-native-build-from-source-small-bug-in-fpaths-makepathrelativeto/332890 "2015-09-20T23:34:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_9270ca35](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9270ca35](https://forums.unrealengine.com/u/anonymous_user_9270ca35)\
**Post date:** [September 20, 2015, 11:34pm UTC](https://forums.unrealengine.com/t/linux-native-build-from-source-small-bug-in-fpaths-makepathrelativeto/332890/1 "2015-09-20T23:34:08Z")

</div>

After following the good documentation at [A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums](https://wiki.unrealengine.com/Building_On_Linux) :

`make SlateViewer` fails with a  
``````

```

Assertion failed: IsValidIndex(Index) [File:Runtime/Core/Public/Containers/UnrealString.h] [Line: 203]
String index out of bounds: Index 1 from a string with a length of 1

```

 error.

After debugging it through gdb, I found the error to point to:  
``````

```
#3 FPaths::MakePathRelativeTo (InPath=…, InRelativeTo=)
at /1/install/UnrealEngine/Engine/Source/Runtime/Core/Private/Misc/Paths.cpp:727

```

  
the problem being the fact that my path starts with a single character (/1) and the code assumes there will always be at least two characters.

It’s probably a very isolated case.

Workaround: mount your 1-character root dir under a different path. (/opt/install works, for example).

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [September 21, 2015, 5:24pm UTC](https://forums.unrealengine.com/t/linux-native-build-from-source-small-bug-in-fpaths-makepathrelativeto/332890/2 "2015-09-21T17:24:16Z")

</div>

Hey -

What Linux environment are you working in? I tried to clone the 4.9 branch into a folder that was one character in length and was able to complete “make SlateViewer” with no error. This was using Ubuntu 15.04. What steps did you take before running make SlateViewer?

Cheers

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9270ca35](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9270ca35](https://forums.unrealengine.com/u/anonymous_user_9270ca35)\
**Post date:** [September 21, 2015, 5:41pm UTC](https://forums.unrealengine.com/t/linux-native-build-from-source-small-bug-in-fpaths-makepathrelativeto/332890/3 "2015-09-21T17:41:14Z")

</div>

Hey , I’m on Ubuntu 14.10 with a lowlatency kernel, but normally it shouldn’t matter, as the code  
does a simple string check.

```
TargetArray[0][1] == TEXT(':')

```

The out of bounds assertion only happens if the FIRST directory in the path is a one-letter dir, as the path gets parsed into TargetArray and only the first step gets verified (probably because of “C:” constructions).

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [September 23, 2015, 5:59pm UTC](https://forums.unrealengine.com/t/linux-native-build-from-source-small-bug-in-fpaths-makepathrelativeto/332890/4 "2015-09-23T17:59:44Z")

</div>

Hey -

What is the file path that you’re using that has this issue? I’ve tried cloning the engine into a folder located in a/1/UnrealEngine and there was no issue with cloning/building the engine. Could you also post the entire terminal output from when the build failed?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [September 28, 2015, 7:57pm UTC](https://forums.unrealengine.com/t/linux-native-build-from-source-small-bug-in-fpaths-makepathrelativeto/332890/5 "2015-09-28T19:57:30Z")

</div>

Hi ,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9270ca35](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9270ca35](https://forums.unrealengine.com/u/anonymous_user_9270ca35)\
**Post date:** [September 29, 2015, 8:51pm UTC](https://forums.unrealengine.com/t/linux-native-build-from-source-small-bug-in-fpaths-makepathrelativeto/332890/6 "2015-09-29T20:51:30Z")

</div>

Hi, sorry for the delay (and the lack of harddisk space 🙂 ), I can still reproduce the bug:

Under /1/install/UnrealEngine :  
(I have a different partition mounted on /1, but I don’t think that should make a difference)

```
./GenerateProjectFiles.sh 2>project1.txt 1>&2
make SlateViewer ARGS=-clean 2>build1.txt 1>&2 
make SlateViewer 2>>build1.txt 1>&2

```

Under /opt/install/UnrealEngine :  
(after sudo mount -o bind /1/install /opt/install)

```
./GenerateProjectFiles.sh 2>projectopt.txt 1>&2
make SlateViewer ARGS=-clean 2>buildopt.txt 1>&2 
make SlateViewer 2>>buildopt.txt 1>&2

```

---

<div class="post-metadata">

**Author:** ![aroudik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@aroudik](https://forums.unrealengine.com/u/aroudik)\
**Post date:** [September 29, 2015, 9:06pm UTC](https://forums.unrealengine.com/t/linux-native-build-from-source-small-bug-in-fpaths-makepathrelativeto/332890/7 "2015-09-29T21:06:14Z")

</div>

I am getting the same error trying to start UE editor from NFS user directory. The directory mounted under /u/home.  
Here is the error:  
[1454][username@machine-name:/Users/Shared/UnrealEngine/4.9/Engine/Binaries/Mac]$ ./UE4Editor.app/Contents/MacOS/UE4Editor  
Assertion failed: IsValidIndex(Index) [File:Runtime/Core/Public/Containers/UnrealString.h] [Line: 203]  
String index out of bounds: Index 1 from a string with a length of 1

It is UE4.9.1 on OS X 10.10.5

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [October 1, 2015, 5:59pm UTC](https://forums.unrealengine.com/t/linux-native-build-from-source-small-bug-in-fpaths-makepathrelativeto/332890/8 "2015-10-01T17:59:39Z")

</div>

Hey -

I’ve entered a bug report (UE-21691) to investigate this issue. For now the best solution would be to either increase the length of the folder name where the engine is located or to place that folder inside another folder with a longer name.

Cheers

---

<div class="post-metadata">

**Author:** ![StBlueFire](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/stbluefire/32/641418_2.png) [@StBlueFire](https://forums.unrealengine.com/u/StBlueFire)\
**Post date:** [August 23, 2019, 1:34pm UTC](https://forums.unrealengine.com/t/linux-native-build-from-source-small-bug-in-fpaths-makepathrelativeto/332890/9 "2019-08-23T13:34:42Z")

</div>

Looks like this might happen on people with old versions of Windows who are cross-compiling and using Windows 10 Linux subsystem. Mine put my files in /mnt/c/ while my partners was just /c/.
