Skip to content

fix possible panic in test mode#369

Merged
eminence merged 1 commit into
eminence:masterfrom
zhao-gang:fix-possible-panic-in-test-mode
May 7, 2026
Merged

fix possible panic in test mode#369
eminence merged 1 commit into
eminence:masterfrom
zhao-gang:fix-possible-panic-in-test-mode

Conversation

@zhao-gang

Copy link
Copy Markdown
Contributor

It's possible some values in /proc/meminfo would be abnormally big which would overflow the multiply calculation.

Didn't find related link on Internet but my Ubuntu 24.04 once showed incorrect SwapFree size which caused panic in procfs.

MemTotal:       32405976 kB
MemFree:         2062608 kB
MemAvailable:    5264828 kB
Buffers:           78156 kB
Cached:          6070016 kB
SwapCached:            0 kB
Active:          8976496 kB
Inactive:       17864952 kB
Active(anon):    8207228 kB
Inactive(anon): 15150596 kB
Active(file):     769268 kB
Inactive(file):  2714356 kB
Unevictable:     1696048 kB
Mlocked:             112 kB
SwapTotal:      67108860 kB
SwapFree:       18446744073708600176 kB
...

It's possible some values in /proc/meminfo would be abnormally big
which would overflow the multiply calculation.

Didn't find related link on Internet but my Ubuntu 24.04 once showed
incorrect SwapFree size which caused panic in procfs.

MemTotal:       32405976 kB
MemFree:         2062608 kB
MemAvailable:    5264828 kB
Buffers:           78156 kB
Cached:          6070016 kB
SwapCached:            0 kB
Active:          8976496 kB
Inactive:       17864952 kB
Active(anon):    8207228 kB
Inactive(anon): 15150596 kB
Active(file):     769268 kB
Inactive(file):  2714356 kB
Unevictable:     1696048 kB
Mlocked:             112 kB
SwapTotal:      67108860 kB
SwapFree:       18446744073708600176 kB
...
@eminence

eminence commented May 7, 2026

Copy link
Copy Markdown
Owner

SwapFree: 18446744073708600176 kB

18000 exabytes sure is a lot of swap :)

This change looks good to me, thank you

@eminence eminence merged commit faa43a5 into eminence:master May 7, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants