NI Route Coordinator Stopped With Segfault Error and Fails to Restart

Updated May 9, 2024

Reported In

Operating System

  • Linux

Issue Details

When I run the dmesg -T command on my PC, NI Route Coordinator (niroco) service stops with the error shown below and fails to restart:

niroco[4357]: segfault at 0 ip 00007fab6804d84c sp 00007ffe019c4600 error 4 in libc.so.6[7fab68028000+175000]Code: 4c 8d 25 77 e2 1a 00 55 48 89 fd 4c 89 e7 53 31 db e8 28 84 05 00 eb 0a 66 0f 1f 44 00 00 48 83 c3 01 89 df 48 83 fb 06 74 f4 <48> 8b 74 dd 00 83 7e 30 ff 74 05 e8 54 e5 ff ff 48 83 fb 0c 75 de

What can be the cause of this issue and how can it be resolved?

Solution

This error happens because newlocale() is throwing the error "_locale_ is not a string pointer referring to a valid locale". In other word, locale() is not installed in the system. The newlocale() function creates a new locale object, or modifies an existing object, returning a reference to the new or modified object as the function result. If newlocale() is not installed, your program might throw this error.

In Ubuntu, run the following command as root to reinstall locale(), this should resolve the Segfault error:
 sudo apt install glibc-langpack-en

In Fedora, run the following command as root to reinstall locale(), this should resolve the Segfault error:
 dnf install glibc-langpack-en

    Additional Information

    If the command responds with the message "Unable to locate package", then that package hasn't been installed yet.

    Run the following command to check if locale is installed.
    localedef --list-archive | grep en_US.utf8
     
    With the following commands, you can see which locale is installed in your system.
    • localedef --list-archive |grep en_US
    • locale -a | grep en_US
    Here you can find two possible workarounds with commands to get it installed:
     
    Method 1)

    sudo apt-get update
    sudo apt-get install -y locales locales-all
    export LANGUAGE=en_US.UTF-8
    export LC_ALL=en_US.UTF-8
    export LANG=en_US.UTF-8
    export LC_TYPE=en_US.UTF-8
    sudo locale-gen
    sudo dpkg-reconfigure locales


    Method 2)

    sudo locale-gen en_US
    sudo locale-gen en_US.UTF-8
    sudo update-locale