Remove wrong cgroups assert (#72372)
authorJan Vorlicek <janvorli@microsoft.com>
Fri, 22 Jul 2022 15:51:17 +0000 (17:51 +0200)
committerGitHub <noreply@github.com>
Fri, 22 Jul 2022 15:51:17 +0000 (17:51 +0200)
* Remove wrong cgroups assert

When detecting the current cgroup version on Linux, checked and
debug builds assert when the filesystem type of /sys/fs/cgroup is
neither TMPFS_MAGIC nor CGROUP2_SUPER_MAGIC. This change removes
the assert and considers it as "no cgroup support".
Release builds already have this behavior.

Close #62960

* Update the nativeaot version too

src/coreclr/gc/unix/cgroup.cpp
src/coreclr/nativeaot/Runtime/unix/cgroup.cpp
src/coreclr/pal/src/misc/cgroup.cpp

index 50069e4..ad2a412 100644 (file)
@@ -128,7 +128,6 @@ private:
             case TMPFS_MAGIC: return 1;
             case CGROUP2_SUPER_MAGIC: return 2;
             default:
-                assert(!"Unexpected file system type for /sys/fs/cgroup");
                 return 0;
         }
 #endif
index fc7b25b..59cd2e3 100644 (file)
@@ -105,7 +105,6 @@ private:
             case TMPFS_MAGIC: return 1;
             case CGROUP2_SUPER_MAGIC: return 2;
             default:
-                assert(!"Unexpected file system type for /sys/fs/cgroup");
                 return 0;
         }
 #endif
index 890ddf3..6a100d9 100644 (file)
@@ -138,7 +138,6 @@ private:
             case TMPFS_MAGIC: return 1;
             case CGROUP2_SUPER_MAGIC: return 2;
             default:
-                _ASSERTE(!"Unexpected file system type for /sys/fs/cgroup");
                 return 0;
         }
 #endif