# Error while loading shared libraries

**URL:** <https://forum.legato.io/t/error-while-loading-shared-libraries/2265>\
**Category:** Legato Application Framework\
**Created:** [November 23, 2016, 4:58am UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265 "2016-11-23T04:58:46Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![jchitty](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jchitty/32/72_2.png) [@jchitty](https://forum.legato.io/u/jchitty)\
**Post date:** [July 11, 2017, 10:55pm UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/21 "2017-07-11T22:55:46Z")

</div>

Hi, @Vamsi3012,

Your Supervisor is failing to mount the SMACK (smackfs) file system.

Is your kernel built with SMACK enabled?

–Jen

---

<div class="post-metadata">

**Author:** ![jchitty](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jchitty/32/72_2.png) [@jchitty](https://forum.legato.io/u/jchitty)\
**Post date:** [July 11, 2017, 11:04pm UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/22 "2017-07-11T23:04:12Z")

</div>

@virajpadte, your problem is different. Your Supervisor is getting killed by the SIGALRM signal that gets fired in case the Supervisor takes longer than 30 seconds to run its start-up sequence.

This is reported in [Legato on Generic Linux](http://forum.legato.io/t/legato-on-generic-linux/2419). I suspect you are having the same SMACK-related issues.

–Jen

---

<div class="post-metadata">

**Author:** ![virajpadte](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/virajpadte/32/264_2.png) [@virajpadte](https://forum.legato.io/u/virajpadte)\
**Post date:** [July 11, 2017, 11:49pm UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/23 "2017-07-11T23:49:56Z")

</div>

@jchitty Thanks for been so responsive and committed to help. So from the discussion on smack issues, I presume we need to perform the following steps for getting this to work with newer kernels:

Add SCM\_SECURITY to the standard library headers;  
in unixSocket.c, in unixSocket\_CreateSeqPacketUnnamed(), set the SO\_PASSSEC socket option flag;  
In unixSocket.c, in ExtractAncillaryData(), handle the SCM\_SECURITY message (just throw it away);

Make the Supervisor add a couple of new SMACK rules:  
“framework admin w”  
“admin framework w”

Set the extended attribute “security.SMACK64EXEC” to “framework” on all command-line tools bundled with the framework.

---

<div class="post-metadata">

**Author:** ![jchitty](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jchitty/32/72_2.png) [@jchitty](https://forum.legato.io/u/jchitty)\
**Post date:** [July 12, 2017, 7:05pm UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/24 "2017-07-12T19:05:31Z")

</div>

Yes. The only other thing that might be needed is in framework/c/src/start/start.c, in the function MakeDir(), change the line

```
le_result_t result = le_dir_Make(dirPath, DEFAULT_PERMS);

```

to

```
le_result_t result = dir_MakeSmack(dirPath, DEFAULT_PERMS, "_");

```

This ensures that directories created by the start-up program get the correct SMACK label.

---

<div class="post-metadata">

**Author:** ![Vamsi3012](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@Vamsi3012](https://forum.legato.io/u/Vamsi3012)\
**Post date:** [July 12, 2017, 8:00pm UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/25 "2017-07-12T20:00:19Z")

</div>

Hi @jchitty,

I do not know this. How do I check this?

Regards,  
Vamsi

---

<div class="post-metadata">

**Author:** ![jchitty](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jchitty/32/72_2.png) [@jchitty](https://forum.legato.io/u/jchitty)\
**Post date:** [July 12, 2017, 8:33pm UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/26 "2017-07-12T20:33:43Z")

</div>

Hi, @Vamsi3012,

Do you have a file called `/boot/config-4.4.50-v7+` (or something like that in `/boot/` that matches the version of your kernel as output by `uname -r`)?

If so, when you run the following,

```
grep CONFIG_SECURITY_SMACK /boot/config-`uname -r`

```

You should see something like this

```
CONFIG_SECURITY_SMACK=y
# CONFIG_SECURITY_SMACK_BRINGUP is not set
CONFIG_SECURITY_SMACK_NETFILTER=y

```

The key point is that the following must appear in your kernel’s build configuration:

```
CONFIG_SECURITY_SMACK=y

```

If you see this instead, then SMACK is disabled in your kernel:

```
# CONFIG_SECURITY_SMACK is not set

```

---

<div class="post-metadata">

**Author:** ![Vamsi3012](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@Vamsi3012](https://forum.legato.io/u/Vamsi3012)\
**Post date:** [July 13, 2017, 7:18am UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/27 "2017-07-13T07:18:35Z")

</div>

Hi @jchitty,

Thanks for the continuous support.

I checked, and it turns out that there is no such file. ![](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/d5b2cd9cec3ce3e3a1dbec556101ff24440dc90b.png)

Could that be the reason? Or was there something wrong that I did while building the kernel?

Regards,  
Vamsi

---

<div class="post-metadata">

**Author:** ![CoRfr](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/corfr/32/69_2.png) [@CoRfr](https://forum.legato.io/u/CoRfr)\
**Post date:** [July 13, 2017, 8:24am UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/28 "2017-07-13T08:24:19Z")

</div>

Maybe `/proc/config.gz` ?

---

<div class="post-metadata">

**Author:** ![Vamsi3012](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@Vamsi3012](https://forum.legato.io/u/Vamsi3012)\
**Post date:** [July 13, 2017, 9:12am UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/29 "2017-07-13T09:12:24Z")

</div>

Hi @CoRfr,

I do not have that either 😐  
 ![](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/918f8c41b5d44e0c1bcbc58f1d80c086a62ce8e7.png)

Regards,  
Vamsi

---

<div class="post-metadata">

**Author:** ![virajpadte](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/virajpadte/32/264_2.png) [@virajpadte](https://forum.legato.io/u/virajpadte)\
**Post date:** [July 13, 2017, 3:06pm UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/30 "2017-07-13T15:06:05Z")

</div>

@Vamsi3012 which platform are you trying to get legato working for?

---

<div class="post-metadata">

**Author:** ![jchitty](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jchitty/32/72_2.png) [@jchitty](https://forum.legato.io/u/jchitty)\
**Post date:** [July 13, 2017, 5:24pm UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/31 "2017-07-13T17:24:47Z")

</div>

If you built the kernel yourself, then you should have a `.config` file in your kernel build directory. Also, you should be able to run `make menuconfig` to check (and change) your kernel build configuration settings.

Cheers,

–Jen

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.legato.io/u/davidc)\
**Post date:** [July 15, 2017, 5:06am UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/32 "2017-07-15T05:06:44Z")

</div>

Hiya,

And if you’re building your own kernel, then to get ‘/proc/config.gz’ you need to make sure that the following two options are enabled in menuconfig:

```auto
File systems —>
   Pseudo filesystems —>
   [*] /proc file system support

```

and

```auto
General setup --->
   [*] Kernel .config support
   [*] Enable access to .config through /proc/config.gz

```

or `CONFIG_PROC_FS`, `CONFIG_IKCONFIG`, and `CONFIG_IKCONFIG_PROC` if editing the `.config` file by hand

have a look here:[https://www.xaprb.com/blog/2006/05/23/how-to-use-linuxs-proc-config-feature/](https://www.xaprb.com/blog/2006/05/23/how-to-use-linuxs-proc-config-feature/) for a nice little write-up about this.

ciao, Dave

---

<div class="post-metadata">

**Author:** ![Vamsi3012](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@Vamsi3012](https://forum.legato.io/u/Vamsi3012)\
**Post date:** [July 17, 2017, 8:37am UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/33 "2017-07-17T08:37:11Z")

</div>

@jchitty,

I did a fresh build all over again and the problem is the same. Again, there was no .config file. So I had to generate it using the following commands:

_modprobe configs_

I had to execute that command because the _config.gz_ was not there. After that I generated the _.config_ file and I see that the settings that should have been merged from the [legatocfg](http://legato.io/legato-docs/latest/raspbianMain.html#raspbianMain_rebuildKernel), are missing. I am not sure what I am doing wrong but I seem to be stuck here.

@davidc,

I shall try what you said and get back to you.

Thank you guys for your continuous support. Is there a possibility that there is already a kernel built for raspberry pi that I could perhaps just download and use?

Regards,  
Vamsi

---

<div class="post-metadata">

**Author:** ![Vamsi3012](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@Vamsi3012](https://forum.legato.io/u/Vamsi3012)\
**Post date:** [July 18, 2017, 2:18pm UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/34 "2017-07-18T14:18:54Z")

</div>

@jchitty and @davidc,

The problem was the way I updated the Kernel. Anyway, I now reinstalled everything neatly and correctly (finally!). But now I am faced with a different problem.

When I run **/./mnt/legato/start** I get this following log and the pi restarts after brief pause of 30 seconds.

 ![](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/6f8141dbe097fd4b2e363e325cfdd45c1ebd13b1.png)syslogd: No process found  
/legato/system/current/bin/startupScript: 42: /legato/systems/current/bin/startupScript: /sbin/syslogd: not found

And once it restarts, the pi doesn’t seem to recognise itself. Because it changes from **pi@lite:~$** to **I have no name!@lite:~$**.

Is this a different Issue? Then maybe I could start a different thread.

Regards,  
Vamsi

---

<div class="post-metadata">

**Author:** ![Vamsi3012](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@Vamsi3012](https://forum.legato.io/u/Vamsi3012)\
**Post date:** [July 18, 2017, 2:22pm UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/35 "2017-07-18T14:22:40Z")

</div>

@virajpadte

I am working with Raspberry Pi 3.

Regards,  
Vamsi

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.legato.io/u/davidc)\
**Post date:** [July 20, 2017, 1:14am UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/36 "2017-07-20T01:14:43Z")

</div>

Hiya,

Just out of interest:

1. do you actually have a `/sbin/syslogd` executable on the PI?
2. what happens if you run the command as a superuser (i.e. `sudo /./mnt/legato/start`)?

ciao, Dave

---

<div class="post-metadata">

**Author:** ![Vamsi3012](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@Vamsi3012](https://forum.legato.io/u/Vamsi3012)\
**Post date:** [July 20, 2017, 7:31am UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/37 "2017-07-20T07:31:39Z")

</div>

Hi @davidc,

> [@davidc](#):
>
> do you actually have a /sbin/syslogd executable on the PI?

After the execution of the command, well there is no syslogd. But I will give it a check and see if this log is available before the execution of the command.

> [@davidc](#):
>
> what happens if you run the command as a superuser (i.e. sudo /./mnt/legato/start)?

I had logged into into the pi as a root user.

Additionally, after the execution of the **/./mnt/legato/start** , every time I restart the pi I get this message when it the pi is starting:  
 ![](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/1e83b066335bf673d2dd74c4f7f4bdff65825b35.png)[FAILED]: Failed to start Avahi mDNS/DNS-SD Stack.  
See systemctl status avahi-deamon.service for details.

But this is file is in a format that is not readable. Found it in the /bin folder of the root partition.

Regards,  
Vamsi

---

<div class="post-metadata">

**Author:** ![Vamsi3012](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@Vamsi3012](https://forum.legato.io/u/Vamsi3012)\
**Post date:** [July 20, 2017, 8:52am UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/38 "2017-07-20T08:52:04Z")

</div>

Hi @davidc

> [@Vamsi3012](#):
>
> After the execution of the command, well there is no syslogd. But I will give it a check and see if this log is available before the execution of the command.

So I tried again and before the execution, there was no syslogd in the /sbin folder.

> [@Vamsi3012](#):
>
> I had logged into into the pi as a root user.

And yes, I now tried with sudo and I still have the same problem.

Regards,  
Vamsi

---

<div class="post-metadata">

**Author:** ![CoRfr](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/corfr/32/69_2.png) [@CoRfr](https://forum.legato.io/u/CoRfr)\
**Post date:** [July 20, 2017, 5:16pm UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/39 "2017-07-20T17:16:51Z")

</div>

BTW I made a patch to make the gdbserver inclusion optional: [Only package gdbserver in devMode if available · legatoproject/legato-af@144b7f8 · GitHub](https://github.com/legatoproject/legato-af/commit/144b7f8b0cf82a999ea04c2ea8150c6170345fca)

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.legato.io/u/davidc)\
**Post date:** [July 20, 2017, 11:07pm UTC](https://forum.legato.io/t/error-while-loading-shared-libraries/2265/40 "2017-07-20T23:07:02Z")

</div>

Hiya,

Hmm, if `/sbsin/syslogd` is not present before you start then there’s a problem for the legato service start.

I haven’t used a RPi for a while, and from a quick google I see that some versions of Raspbian OS don’t use `syslogd` as the logging daemon - instead they use `rsyslog` by default.

Off the top of my head I can see two things to try:

1. see if simply hard symlinking the current logger program to `/sbin/syslogd` to ‘trick’ the legato startup into thinking things are OK.
2. remove the existing system logger package and replace it with syslogd (but this could cause all sorts of issues!).

ciao, Dave

[Previous page](https://forum.legato.io/t/error-while-loading-shared-libraries/2265.md?page=1)
