# Error while loading shared libraries: Internal Error

**URL:** <https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286>\
**Category:** mangOH Green\
**Created:** [May 9, 2023, 2:04pm UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286 "2023-05-09T14:04:22Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![aruna](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@aruna](https://mangoh.discourse.group/u/aruna)\
**Post date:** [May 9, 2023, 2:04pm UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/1 "2023-05-09T14:04:22Z")

</div>

Hi All,

I am using MangOH green with WP76 module, I have a application which use shared library files to fetch the data from client devices. The shared library file is compiled for arm7 architecture. Able to compile the code successfully but while executing the app it is throwing the below mentioned error

“error while loading shared libraries: Internal Error”

Getting one warning message while compiling also

"  
/home/wimate/.leaf/wp76-toolchain\_SWI9X07Y\_02.37.10.04-linux64/sysroots/x86\_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/7.3.0/real-ld: warning: ld-linux-armhf.so.3, needed by /home/wimate/Sierra\_Wireless/Trial\_Sierra/components/melpcnc//libcustom\_Arm.so, not found (try using -rpath or -rpath-link)"

Please let me know how to solve this warning and what could be the cause for that internal error?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 9, 2023, 3:25pm UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/2 "2023-05-09T15:25:56Z")

</div>

For the warning, did you try to put liblinux-armhf.so.3 in the same location as  
libcustom\_Arm.so while compiling?

Or here shows you might need to copy the required libraries in /sysroots/armv7a-neon-poky-linux-gnueabi/usr/lib/

> **[Unable to resolve this cjson library issue](https://forum.legato.io/t/unable-to-resolve-this-cjson-library-issue/6493/14)**
>
> libjson-c.so.zip (46.9 KB) Hi @jyijyi Please find the attachment this shared lib, its ARM build only

For running the app, did you put the required libraries (liblinux-armhf.so.3) in the module /usr/lib folder?  
Here says “The dynamic linker will typically look in the `/lib` and `/usr/lib` directories for libraries at runtime.”

> **[Component Definition .cdef - Legato Docs](https://docs.legato.io/latest/defFilesCdef.html#defFilesCdef_requiresLib)**
>
> legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development

You might need to enter the following to copy libraries to this folder:

```auto
mkdir /tmp/tmp_usr_lib;mkdir /tmp/tmp_usr_lib_wr;

mount -t overlay overlay /usr/lib -o lowerdir=/usr/lib,upperdir=/tmp/tmp_usr_lib,workdir=/tmp/tmp_usr_lib_wr;

```

---

<div class="post-metadata">

**Author:** ![aruna](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@aruna](https://mangoh.discourse.group/u/aruna)\
**Post date:** [May 12, 2023, 10:15am UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/3 "2023-05-12T10:15:47Z")

</div>

Hi i have tried it earlier there was an error couldn’t open shared library file. Now it is solved and there is no warning while compiling the code, Still facing the same issue

**“error while loading shared libraries: /lib/libcustom\_Arm.so: internal error”**

Please find the library file details below

**libcustom\_Arm.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=7aac04ea29ab20ac8de64e31d9295, with debug\_info, not stripped**

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 12, 2023, 10:22am UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/4 "2023-05-12T10:22:27Z")

</div>

how do you compile **libcustom\_Arm.so**

---

<div class="post-metadata">

**Author:** ![aruna](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@aruna](https://mangoh.discourse.group/u/aruna)\
**Post date:** [May 12, 2023, 10:26am UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/5 "2023-05-12T10:26:09Z")

</div>

It is shared by client, they are using the same library file in Raspberry pi and Debian10.10. Due to some issue with Raspberry pi they want the system to migrate for sierra device

---

<div class="post-metadata">

**Author:** ![aruna](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@aruna](https://mangoh.discourse.group/u/aruna)\
**Post date:** [May 12, 2023, 10:28am UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/6 "2023-05-12T10:28:41Z")

</div>

Readelf -A gives below info

Attribute Section: aeabi  
File Attributes  
Tag\_CPU\_name: “7-A”  
Tag\_CPU\_arch: v7  
Tag\_CPU\_arch\_profile: Application  
Tag\_ARM\_ISA\_use: Yes  
Tag\_THUMB\_ISA\_use: Thumb-2  
Tag\_FP\_arch: VFPv3-D16  
Tag\_ABI\_PCS\_wchar\_t: 4  
Tag\_ABI\_FP\_denormal: Needed  
Tag\_ABI\_FP\_exceptions: Needed  
Tag\_ABI\_FP\_number\_model: IEEE 754  
Tag\_ABI\_align\_needed: 8-byte  
Tag\_ABI\_align\_preserved: 8-byte, except leaf SP  
Tag\_ABI\_enum\_size: int  
Tag\_ABI\_VFP\_args: VFP registers  
Tag\_CPU\_unaligned\_access: v6

---

<div class="post-metadata">

**Author:** ![aruna](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@aruna](https://mangoh.discourse.group/u/aruna)\
**Post date:** [May 12, 2023, 10:38am UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/7 "2023-05-12T10:38:22Z")

</div>

Sorry for this basic question, can you please tell me where exactly i need to do this activity

```auto
mkdir /tmp/tmp_usr_lib;mkdir /tmp/tmp_usr_lib_wr;

mount -t overlay overlay /usr/lib -o lowerdir=/usr/lib,upperdir=/tmp/tmp_usr_lib,workdir=/tmp/tmp_usr_lib_wr;

```

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 12, 2023, 11:10am UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/8 "2023-05-12T11:10:24Z")

</div>

Have you recompiled this lib with wp toolchain

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 12, 2023, 11:10am UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/9 "2023-05-12T11:10:45Z")

</div>

Of course in module’linux console

---

<div class="post-metadata">

**Author:** ![aruna](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@aruna](https://mangoh.discourse.group/u/aruna)\
**Post date:** [May 12, 2023, 11:16am UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/10 "2023-05-12T11:16:16Z")

</div>

My .cdef file  
// myfirstappComponent  
//  
// This is component definition file that specifies the internal content and external interfaces  
// of reusable software components.  
//  
// For more details on the component definition (.cdef) file format see:  
// [Component Definition .cdef - Legato Docs](https://docs.legato.io/latest/defFilesCdef.html)

// Source code files.  
sources:  
{  
myfirstappComponent.c  
}

cflags:  
{  
-DOPENSSL=1 -D\_LINUX  
-std=c99  
-I${LEGATO\_ROOT}/3rdParty/paho.mqtt.c/src -I/home/wimate/Sierra\_Wireless/Trial\_Sierra/components/myfirstappComponent/include  
-pthread  
-g  
}

ldflags:  
{  
-L${LEGATO\_BUILD}/3rdParty/paho.mqtt.c  
-L /home/wimate/Sierra\_Wireless/Trial\_Sierra/components/custom/  
}

// Bind resources from the target module into your application.  
requires:  
{  
component:  
{  
${LEGATO\_ROOT}/components/3rdParty/paho.mqtt.c  
}

```
// IPC APIs used by this component.
api:
{
    le_data.api
}

// File paths local to your target module.
file:
{
    /usr/lib/libssl.so.1.0.2 /lib/
    /usr/lib/libcrypto.so.1.0.2 /lib/

	/lib/libutil.so.1 /lib/

    [rx]/home/root/lib_custom/libcustom_Arm.so /lib/
    [rx]/home/root/lib_custom/ld-linux-armhf.so.3 /lib/
    
}

// Directories on your target module to make accessible to the app.
dir:
{
}

// Linux filesystem device paths.
device:
{
    
}

// Shared libraries pre-installed on the module.
lib:
{
    libpaho-mqtt3cs.so
    libcustom_Arm.so 
    ssl 
    crypto
}

```

}

---

<div class="post-metadata">

**Author:** ![aruna](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@aruna](https://mangoh.discourse.group/u/aruna)\
**Post date:** [May 12, 2023, 11:17am UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/11 "2023-05-12T11:17:54Z")

</div>

Yeah tried with linux console,

same library files i included in .adef file also

it has compiled successfully

---

<div class="post-metadata">

**Author:** ![aruna](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@aruna](https://mangoh.discourse.group/u/aruna)\
**Post date:** [May 12, 2023, 11:21am UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/12 "2023-05-12T11:21:46Z")

</div>

in console i performed this activity

root@swi-mdm9x28-wp:~/lib\_custom# mkdir /tmp/tmp\_usr\_lib  
root@swi-mdm9x28-wp:~/lib\_custom# mkdir /tmp/tmp\_usr\_lib\_wr  
root@swi-mdm9x28-wp:~/lib\_custom# mount -t overlay overlay /usr/lib -o lowerdir=/usr/lib,upperdir=/tm  
p/tmp\_usr\_lib,workdir=/tmp/tmp\_usr\_lib\_wr;

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 12, 2023, 11:39am UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/13 "2023-05-12T11:39:02Z")

</div>

Does libcustom\_Arm.so already in module /usr/lib folder?  
Have you recompiled this lib with wp toolchain

---

<div class="post-metadata">

**Author:** ![aruna](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@aruna](https://mangoh.discourse.group/u/aruna)\
**Post date:** [May 12, 2023, 12:06pm UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/14 "2023-05-12T12:06:09Z")

</div>

No it was not in module, But i recompiled with wp76 tool chain

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 12, 2023, 12:18pm UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/15 "2023-05-12T12:18:05Z")

</div>

Didn’t your app need this lib in run time?

---

<div class="post-metadata">

**Author:** ![aruna](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@aruna](https://mangoh.discourse.group/u/aruna)\
**Post date:** [May 12, 2023, 12:20pm UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/16 "2023-05-12T12:20:36Z")

</div>

For that i have copied the file to module in folder lib\_custom, and made that linking in .cdef file

```auto
// File paths local to your target module.
file:
{
    /usr/lib/libssl.so.1.0.2 /lib/
    /usr/lib/libcrypto.so.1.0.2 /lib/

	/lib/libutil.so.1 /lib/

    [rx]/home/root/lib_custom/libcustom_Arm.so /lib/
    [rx]/home/root/lib_custom/ld-linux-armhf.so.3 /lib/
    
}

```

---

<div class="post-metadata">

**Author:** ![aruna](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@aruna](https://mangoh.discourse.group/u/aruna)\
**Post date:** [May 12, 2023, 12:22pm UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/17 "2023-05-12T12:22:14Z")

</div>

I am not able to copy in /lib/ or /usr/lib/ folder, it s throwing error read only systems

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 12, 2023, 1:25pm UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/18 "2023-05-12T13:25:56Z")

</div>

Then can you write a simple linux app to see if it can load this lib?  
This can isolate legato factor

---

<div class="post-metadata">

**Author:** ![aruna](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@aruna](https://mangoh.discourse.group/u/aruna)\
**Post date:** [May 12, 2023, 1:26pm UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/19 "2023-05-12T13:26:30Z")

</div>

Hi

Now i have moved my library files to /usr/lib and /lib folder also

getting this error  
lsm=SMACK fn=smack\_inode\_permission action=denied subject=“app.myfirstapp” object=“admin” requested=r pid=18064 comm=“myfirstappCompo” name=" ```  
libcustom\_Arm.so" dev=“tmpfs” ino

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 12, 2023, 2:01pm UTC](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286/20 "2023-05-12T14:01:28Z")

</div>

Then can you write a simple linux app to see if it can load this lib?  
This can isolate legato factor

[Next page](https://mangoh.discourse.group/t/error-while-loading-shared-libraries-internal-error/10286.md?page=2)
