You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an application is started by by the supervisor a check is made to see if all file bindings are valid by calling DoesLinkExist in "framework/daemons/linux/supervisor/app.c". This function may fail during certain conditions. This happened to me with a shared object file which caused a crash on the main application. This fault only appears after the first reboot which is very bad since the system probably will be considered valid and out of probation at this time.
Scenario:
Application in installed and started
DoesLinkExist returns false
An empty file is created in the sandbox
A file is bindmounted on/over the empty file.
The application starts successfully.
Systems goes out of probation.
System reboot
DoesLinkExist returns true (BUG) and the file listed in the application .adef is never bindmounted into the sandbox.
The application fails since it sees the empty file.
The DoesLinkExist function checks the inodes for equality, but inodes are only unique within its own filesystem. The condtion thats triggers the bug is that the empty file created in step 3 just happed to get the same inode number(flash partition) as the file that is supposed to be bindmounted into the sandbox (e.g rootfs partition) which causes the bindmount to be ignored.
The suggested solution is to also check the device for equality.
(legato 18.10.3)
+++ b/framework/daemons/linux/supervisor/app.c
@@ -1810,10 +1810,20 @@ static bool DoesLinkExist
}
else
{
if (srcStat.st_ino == destStat.st_ino)
if ((srcStat.st_dev == destStat.st_dev) && (srcStat.st_ino == destStat.st_ino))
{
The text was updated successfully, but these errors were encountered:
When an application is started by by the supervisor a check is made to see if all file bindings are valid by calling DoesLinkExist in "framework/daemons/linux/supervisor/app.c". This function may fail during certain conditions. This happened to me with a shared object file which caused a crash on the main application. This fault only appears after the first reboot which is very bad since the system probably will be considered valid and out of probation at this time.
Scenario:
The DoesLinkExist function checks the inodes for equality, but inodes are only unique within its own filesystem. The condtion thats triggers the bug is that the empty file created in step 3 just happed to get the same inode number(flash partition) as the file that is supposed to be bindmounted into the sandbox (e.g rootfs partition) which causes the bindmount to be ignored.
The suggested solution is to also check the device for equality.
(legato 18.10.3)
+++ b/framework/daemons/linux/supervisor/app.c
@@ -1810,10 +1810,20 @@ static bool DoesLinkExist
}
else
{
The text was updated successfully, but these errors were encountered: