Hi i have done it is able to load file,
See if it works for unsandboxed app
Btw, which line in the lib is making the SMACK error?
Hi ,
This is the error ,message i am getting
May 12 20:14:10 swi-mdm9x28-wp user.info Legato: INFO | supervisor[2550]/supervisor T=main | proc.c proc_Start() 1363 | Execing ‘myfirstappComponentExe’
May 12 20:14:10 swi-mdm9x28-wp user.info Legato: INFO | supervisor[2550]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxCoreDumpFileBytes to value 102400.
May 12 20:14:10 swi-mdm9x28-wp user.info Legato: INFO | supervisor[2550]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxFileBytes to value 102400.
May 12 20:14:10 swi-mdm9x28-wp user.info Legato: INFO | supervisor[2550]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxLockedMemoryBytes to value 8192.
May 12 20:14:10 swi-mdm9x28-wp user.info Legato: INFO | supervisor[2550]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxFileDescriptors to value 256.
May 12 20:14:10 swi-mdm9x28-wp user.info Legato: INFO | supervisor[2550]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxMQueueBytes to value 512.
May 12 20:14:10 swi-mdm9x28-wp user.info Legato: INFO | supervisor[2550]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxThreads to value 20.
May 12 20:14:10 swi-mdm9x28-wp user.info Legato: INFO | supervisor[2550]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxQueuedSignals to value 100.
May 12 20:14:10 swi-mdm9x28-wp user.err Legato: =ERR= | myfirstappComponentExe[2550] | myfirstappComponentExe: error while loading shared libraries: libcustom_Arm.so: cannot open shared object file: No such file or directory
May 12 20:14:10 swi-mdm9x28-wp user.info Legato: INFO | supervisor[876]/supervisor T=main | proc.c proc_SigChildHandler() 2079 | Process ‘myfirstappComponentExe’ (PID: 2550) has exited with exit code 127.
May 12 20:14:10 swi-mdm9x28-wp user.notice kernel: [ 192.186730] audit: type=1400 audit(1683902650.814:4): lsm=SMACK fn=smack_inode_permission action=denied subject=“app.myfirstapp” object=“files1” requested=r pid=2550 comm=“myfirstappCompo” name=“libcustom_Arm.so” dev=“ubifs” ino
May 12 20:14:11 swi-mdm9x28-wp user.warn Legato: -WRN- | supervisor[876]/supervisor T=main | app.c app_SigChildHandler() 4165 | Process ‘myfirstappComponentExe’ in app ‘myfirstapp’ faulted: Ignored.
See if it works for unsandboxed app
Btw, which line in the lib is making the SMACK error?
Followed same sandboxed is false,
tried by setting xattr also
May 12 20:18:58 swi-mdm9x28-wp user.info Legato: INFO | supervisor[876]/supervisor T=main | app.c CreateFileLink() 2183 | Skipping file link ‘/home/root/lib_custom/libcustom_Arm.so’ to ‘/legato/systems/current/appsWriteable/myfirstapp/lib/ libcustom_Arm.so’: Already exists
What is the full error log for unsandboxed app
HI jyijyi,
Due to some emergency work i couldnt send the log data, please check the log data below, i have fixed the permission issues, no it is loading
Jan 6 07:26:06 swi-mdm9x28-wp user.info Legato: INFO | supervisor[873]/supervisor T=main | app.c CreateFileLink() 2253 | Created file link ‘/dev/urandom’ to ‘/legato/systems/current/appsWriteable/myfirstapp/dev/urandom’.
Jan 6 07:26:06 swi-mdm9x28-wp user.info Legato: INFO | supervisor[873]/supervisor T=main | resourceLimits.c GetCfgResourceLimit() 207 | Configured resource limit maxStackBytes is not available. Using the default value 0.
Jan 6 07:26:06 swi-mdm9x28-wp user.info Legato: INFO | supervisor[873]/supervisor T=main | proc.c proc_Start() 1403 | Starting process ‘myfirstappComponentExe’ with pid 20029
Jan 6 07:26:06 swi-mdm9x28-wp user.info Legato: INFO | supervisor[873]/supervisor T=main | supervisor.c SigChildHandler() 877 | Reaping unconfigured child process 20025.
Jan 6 07:26:06 swi-mdm9x28-wp user.info Legato: INFO | supervisor[20029]/supervisor T=main | proc.c proc_Start() 1363 | Execing ‘myfirstappComponentExe’
Jan 6 07:26:06 swi-mdm9x28-wp user.info Legato: INFO | supervisor[20029]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxCoreDumpFileBytes to value 102400.
Jan 6 07:26:06 swi-mdm9x28-wp user.info Legato: INFO | supervisor[20029]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxFileBytes to value 102400.
Jan 6 07:26:06 swi-mdm9x28-wp user.info Legato: INFO | supervisor[20029]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxLockedMemoryBytes to value 8192.
Jan 6 07:26:06 swi-mdm9x28-wp user.info Legato: INFO | supervisor[20029]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxFileDescriptors to value 256.
Jan 6 07:26:06 swi-mdm9x28-wp user.info Legato: INFO | supervisor[20029]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxMQueueBytes to value 512.
Jan 6 07:26:06 swi-mdm9x28-wp user.info Legato: INFO | supervisor[20029]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxThreads to value 20.
Jan 6 07:26:06 swi-mdm9x28-wp user.info Legato: INFO | supervisor[20029]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxQueuedSignals to value 100.
Jan 6 07:26:06 swi-mdm9x28-wp user.err Legato: =ERR= | myfirstappComponentExe[20029] | myfirstappComponentExe: error while loading shared libraries: /legato/apps/7618ecbb168bc980d0c4f2cca97a086e/read-only/bin/…/lib/ libcustom_Arm.so: internal error
Jan 6 07:26:06 swi-mdm9x28-wp user.info Legato: INFO | supervisor[873]/supervisor T=main | proc.c proc_SigChildHandler() 2079 | Process ‘myfirstappComponentExe’ (PID: 20029) has exited with exit code 127.
Jan 6 07:26:06 swi-mdm9x28-wp user.warn Legato: -WRN- | supervisor[873]/supervisor T=main | app.c app_SigChildHandler() 4165 | Process ‘myfirstappComponentExe’ in app ‘myfirstapp’ faulted: Ignored.
Jan 6 07:26:06 swi-mdm9x28-wp user.info Legato: INFO | supervisor[873]/supervisor T=main | app.c app_StopComplete() 4862 | app ‘myfirstapp’ has stopped.
Jan 6 07:26:06 swi-mdm9x28-wp user.info Legato: INFO | supervisor[873]/supervisor T=main | apps.c DeactivateAppContainer() 374 | Application ‘myfirstapp’ has stopped.
do you know why there is a space character just before “libcustom_Arm.so”?
/legato/apps/7618ecbb168bc980d0c4f2cca97a086e/read-only/bin/…/lib/ libcustom_Arm.so: internal error
You also get this space character here:
Normally for this message of “Skipping file link…”, you should not have this space character:
sorry when i tried to make bold it has happened, earlier i made only file name then changed whole line
I diff your libcustom_Arm.so and standard library like libssl.so.1.0.2 , it seems to be a bit different to a normal library, not sure if it is related to the internal error when loading the library:
libcustom_Arm.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=7aac04ea29ab20ac8de64e31d9295, with debug_info, not stripped
owner@ubuntu:~$ file /opt/swi/y22-ext/sysroots/armv7a-neon-poky-linux-gnueabi/usr/lib/libssl.so.1.0.2
/opt/swi/y22-ext/sysroots/armv7a-neon-poky-linux-gnueabi/usr/lib/libssl.so.1.0.2: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=8ec623fe775f879f2a4e32cad24d38ee7bc4e71e, stripped
BTW, here has an example on how to load 3rd party library libsqlite3.so in the application, it should be similar to your situation.
You can see whether it has problem to load the 3rd party libarary.
testsql.7z (2.8 MB)
If it works, try to port your code to this application