The `.mem_total` variable has `uint64_t` type, therefore, when multiplying the number `20971512` by the number `1024` with the suffix `U`, we will not get the expected result of `21,474,828,288`, since the number `20971512` without an explicit type indication has `uint32_t` type. First, multiplication will occur in accordance with the `uint32_t` type; this operation will cause a **type overflow**, and only then will this result be assigned to a `uint64_t` type variable. It's worth adding the `UL` suffix to the number `20971512` to avoid **overflow**. Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE. Author A. Slepykh. (cherry picked from commit a6f1551fe785e241e7c5534aa0c580b31a83a28b) (cherry picked from commit 9ee5ab00e04078cf48d827ff13ca4d104b63b56f) (cherry picked from commit 9a70c36a8655f3a95fb4a1665672a34776ecc4e7)
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Code Map for information about this repository's layout and content.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list or join our IRC channel.
Stable branches with backported patches are available in the stable repo.